96 lines
4.0 KiB
C#
96 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Collections;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class WelderOKRateStatisticsService
|
|
{
|
|
/// <summary>
|
|
/// 根据ID获取统计信息
|
|
/// </summary>
|
|
/// <param name="rateId"></param>
|
|
/// <returns></returns>
|
|
public static Model.Sp_WelderOKRateStatistics GetWelderOKRateStatistics(string rateId)
|
|
{
|
|
return Funs.DB.Sp_WelderOKRateStatistics.FirstOrDefault(e => e.RateId == rateId);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="years"></param>
|
|
/// <param name="months"></param>
|
|
/// <returns></returns>
|
|
public static bool IsExistYearMonth(string years,string months)
|
|
{
|
|
bool isExist = false;
|
|
var q= Funs.DB.Sp_WelderOKRateStatistics.Where(x =>x.Years==years && x.Months == months);
|
|
{
|
|
if (q.Count() > 0)
|
|
{
|
|
isExist = true;
|
|
}
|
|
}
|
|
return isExist;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加持证焊工焊接合格率
|
|
/// </summary>
|
|
/// <param name="welderOKRateStatistics"></param>
|
|
public static void AddWelderOKRateStatistics(Model.Sp_WelderOKRateStatistics welderOKRateStatistics)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Sp_WelderOKRateStatistics newWelderOKRateStatistics = new Model.Sp_WelderOKRateStatistics();
|
|
db.Sp_WelderOKRateStatistics.InsertOnSubmit(newWelderOKRateStatistics);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工艺管道图片
|
|
/// </summary>
|
|
/// <param name="welderOKRateStatistics"></param>
|
|
public static void UpdateWelderOKRateStatistics(Model.Sp_WelderOKRateStatistics welderOKRateStatistics)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Sp_WelderOKRateStatistics newWelderOKRateStatistics = db.Sp_WelderOKRateStatistics.FirstOrDefault(e => e.RateId == welderOKRateStatistics.RateId);
|
|
if (newWelderOKRateStatistics != null)
|
|
{
|
|
newWelderOKRateStatistics.TotalFilmNum = welderOKRateStatistics.TotalFilmNum;
|
|
newWelderOKRateStatistics.OneToatalFilmNum = welderOKRateStatistics.OneToatalFilmNum;
|
|
newWelderOKRateStatistics.OnePassFilmNum = welderOKRateStatistics.OnePassFilmNum;
|
|
newWelderOKRateStatistics.OneRepairFilmNum = welderOKRateStatistics.OneRepairFilmNum;
|
|
newWelderOKRateStatistics.TwoRepairFilmNum = welderOKRateStatistics.TwoRepairFilmNum;
|
|
newWelderOKRateStatistics.ThreeRepairFilmNum = welderOKRateStatistics.ThreeRepairFilmNum;
|
|
newWelderOKRateStatistics.CRepairFilmNum = welderOKRateStatistics.CRepairFilmNum;
|
|
newWelderOKRateStatistics.NoRepairFilmNum = welderOKRateStatistics.NoRepairFilmNum;
|
|
newWelderOKRateStatistics.KPassFilmNum = welderOKRateStatistics.KPassFilmNum;
|
|
newWelderOKRateStatistics.RMaterialFilmNum = welderOKRateStatistics.RMaterialFilmNum;
|
|
newWelderOKRateStatistics.OKRate = welderOKRateStatistics.OKRate;
|
|
newWelderOKRateStatistics.Remark = welderOKRateStatistics.Remark;
|
|
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除持证焊工焊接合格率
|
|
/// </summary>
|
|
/// <param name="imageId"></param>
|
|
public static void DeleteWelderOKRateStatistics(string Id)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Sp_WelderOKRateStatistics welderOKRateStatistics = db.Sp_WelderOKRateStatistics.FirstOrDefault(e => e.RateId == Id);
|
|
if (welderOKRateStatistics != null)
|
|
{
|
|
db.Sp_WelderOKRateStatistics.DeleteOnSubmit(welderOKRateStatistics);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|