五环质量月报新
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class CqmsTargetService
|
||||
{
|
||||
public static bool Insert(Model.Report_CqmsTarget model)
|
||||
{
|
||||
try
|
||||
{
|
||||
Funs.DB.Report_CqmsTarget.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Update(Model.Report_CqmsTarget model)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_CqmsTarget.FirstOrDefault(a => a.Id == model.Id);
|
||||
if (result != null)
|
||||
{
|
||||
result.ProStage = model.ProStage;
|
||||
result.ProDescribe = model.ProDescribe;
|
||||
result.TargetValue = model.TargetValue;
|
||||
result.MonthPer = model.MonthPer;
|
||||
result.Remarks = model.Remarks;
|
||||
result.SortId = model.SortId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(List<string> newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_CqmsTarget.Where(a => newId.Contains(a.Id)).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_CqmsTarget.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(string newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_CqmsTarget.Where(a => a.ReportId == newId).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_CqmsTarget.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.Report_CqmsTarget Detail(string newId)
|
||||
{
|
||||
var result = Funs.DB.Report_CqmsTarget.FirstOrDefault(a => a.Id == newId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量月报-文本框 内容接口
|
||||
/// </summary>
|
||||
public class TextBoxContentService
|
||||
{
|
||||
public static bool Insert(Model.Report_TextBoxContent model)
|
||||
{
|
||||
try
|
||||
{
|
||||
Funs.DB.Report_TextBoxContent.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Update(Model.Report_TextBoxContent model)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_TextBoxContent.FirstOrDefault(a => a.Id == model.Id);
|
||||
if (result != null)
|
||||
{
|
||||
result.ContentText = model.ContentText;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(List<string> newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_TextBoxContent.Where(a => newId.Contains(a.Id)).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_TextBoxContent.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(string newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_TextBoxContent.Where(a => a.ReportId==newId).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_TextBoxContent.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.Report_TextBoxContent Detail(string newId)
|
||||
{
|
||||
var result = Funs.DB.Report_TextBoxContent.FirstOrDefault(a => a.Id == newId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 最新质量月报接口
|
||||
/// </summary>
|
||||
public class WeekAndMonthReportNewService
|
||||
{
|
||||
public static bool Insert(Model.Report_WeekAndMonthReport_New model)
|
||||
{
|
||||
try
|
||||
{
|
||||
Funs.DB.Report_WeekAndMonthReport_New.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Update(Model.Report_WeekAndMonthReport_New model)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_WeekAndMonthReport_New.FirstOrDefault(a => a.Id == model.Id);
|
||||
if (result != null)
|
||||
{
|
||||
result.StartDate = model.StartDate;
|
||||
result.EndDate = model.EndDate;
|
||||
result.SortId = model.SortId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(List<string> newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_WeekAndMonthReport_New.Where(a => newId.Contains(a.Id)).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_WeekAndMonthReport_New.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Delete(string newId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Funs.DB.Report_WeekAndMonthReport_New.Where(a => a.Id== newId).ToList();
|
||||
if (result.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_WeekAndMonthReport_New.DeleteAllOnSubmit(result);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.Report_WeekAndMonthReport_New Detail(string newId)
|
||||
{
|
||||
var result = Funs.DB.Report_WeekAndMonthReport_New.FirstOrDefault(a => a.Id == newId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user