114 lines
4.4 KiB
C#
114 lines
4.4 KiB
C#
|
using Model;
|
|||
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Globalization;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
namespace BLL
|
|||
|
{
|
|||
|
public class CheckFineService
|
|||
|
{
|
|||
|
public static Model.SGGLDB db = Funs.DB;
|
|||
|
/// <summary>
|
|||
|
/// 根据质量检查与控制Id删除一个质量检查与控制信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="CheckControlId"></param>
|
|||
|
public static void DeleteCheckList(string id)
|
|||
|
{
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
Model.Check_CheckFine CheckFine = db.Check_CheckFine.First(e => e.CheckFineId == id);
|
|||
|
db.Check_CheckFine.DeleteOnSubmit(CheckFine);
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 添加质量检查与控制
|
|||
|
/// </summary>
|
|||
|
/// <param name="CheckControl"></param>
|
|||
|
public static void AddCheckFine(Model.Check_CheckFine CheckControl)
|
|||
|
{
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
Model.Check_CheckFine newCheckControl = new Model.Check_CheckFine();
|
|||
|
newCheckControl.CheckFineId = CheckControl.CheckFineId;
|
|||
|
newCheckControl.CheckControlCode = CheckControl.CheckControlCode;
|
|||
|
newCheckControl.ProposeUnitId = CheckControl.ProposeUnitId;
|
|||
|
newCheckControl.DocCode = CheckControl.DocCode;
|
|||
|
newCheckControl.ProjectId = CheckControl.ProjectId;
|
|||
|
newCheckControl.UnitWorkId = CheckControl.UnitWorkId;
|
|||
|
newCheckControl.UnitId = CheckControl.UnitId;
|
|||
|
newCheckControl.CheckDate = CheckControl.CheckDate;
|
|||
|
newCheckControl.CheckMan = CheckControl.CheckMan;
|
|||
|
newCheckControl.Fee = CheckControl.Fee;
|
|||
|
newCheckControl.QuestionDef = CheckControl.QuestionDef;
|
|||
|
newCheckControl.LimitDate = CheckControl.LimitDate;
|
|||
|
newCheckControl.RectifyOpinion = CheckControl.RectifyOpinion;
|
|||
|
newCheckControl.AttachUrl = CheckControl.AttachUrl;
|
|||
|
newCheckControl.HandleWay = CheckControl.HandleWay;
|
|||
|
newCheckControl.State = CheckControl.State;
|
|||
|
newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan;
|
|||
|
|
|||
|
db.Check_CheckFine.InsertOnSubmit(newCheckControl);
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据质量检查与控制Id获取一个质量检查与控制信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="CheckControlDetailId"></param>
|
|||
|
public static Model.Check_CheckFine CheckFine(string id)
|
|||
|
{
|
|||
|
return Funs.DB.Check_CheckFine.FirstOrDefault(e => e.CheckFineId == id);
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 修改质量检查与控制
|
|||
|
/// </summary>
|
|||
|
/// <param name="CheckControl"></param>
|
|||
|
public static void UpdateCheckControl(Model.Check_CheckFine CheckControl)
|
|||
|
{
|
|||
|
Model.SGGLDB db = Funs.DB;
|
|||
|
Model.Check_CheckFine newCheckControl = db.Check_CheckFine.First(e => e.CheckFineId == CheckControl.CheckFineId);
|
|||
|
newCheckControl.DocCode = CheckControl.DocCode;
|
|||
|
newCheckControl.ProposeUnitId = CheckControl.ProposeUnitId;
|
|||
|
newCheckControl.UnitWorkId = CheckControl.UnitWorkId;
|
|||
|
newCheckControl.UnitId = CheckControl.UnitId;
|
|||
|
newCheckControl.CheckDate = CheckControl.CheckDate;
|
|||
|
newCheckControl.CheckControlCode = CheckControl.CheckControlCode;
|
|||
|
|
|||
|
newCheckControl.Fee = CheckControl.Fee;
|
|||
|
|
|||
|
newCheckControl.QuestionDef = CheckControl.QuestionDef;
|
|||
|
newCheckControl.LimitDate = CheckControl.LimitDate;
|
|||
|
newCheckControl.RectifyOpinion = CheckControl.RectifyOpinion;
|
|||
|
newCheckControl.AttachUrl = CheckControl.AttachUrl;
|
|||
|
newCheckControl.HandleWay = CheckControl.HandleWay;
|
|||
|
|
|||
|
newCheckControl.State = CheckControl.State;
|
|||
|
newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan;
|
|||
|
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
public static int GetListCount(string projectId)
|
|||
|
{
|
|||
|
using (var db = new Model.SGGLDB(Funs.ConnString))
|
|||
|
{
|
|||
|
IQueryable<Model.Check_CheckFine> q = db.Check_CheckFine;
|
|||
|
if (!string.IsNullOrEmpty(projectId))
|
|||
|
{
|
|||
|
q = q.Where(e => e.ProjectId == projectId);
|
|||
|
}
|
|||
|
|
|||
|
return q.Count();
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|