using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
///
/// 工艺评定图片
///
public class ProcedureImageService
{
///
/// 根据主键获取图片信息
///
/// 主键
/// 图片信息
public static Model.PW_ProcedureImageManage GetImageById(string ImageId)
{
return (from x in Funs.DB.PW_ProcedureImageManage where x.ImageId == ImageId select x).FirstOrDefault();
}
///
/// 添加工艺图片
///
///
public static void AddProcedureImage(Model.PW_ProcedureImageManage procedureImage)
{
Model.PW_ProcedureImageManage newProcedureImage = new Model.PW_ProcedureImageManage();
newProcedureImage.ImageId = procedureImage.ImageId;
newProcedureImage.ImageContent = procedureImage.ImageContent;
newProcedureImage.AttachUrl = procedureImage.AttachUrl;
newProcedureImage.WeldingMethodId = procedureImage.WeldingMethodId;
newProcedureImage.Thickness = procedureImage.Thickness;
newProcedureImage.WeldTypeId = procedureImage.WeldTypeId;
newProcedureImage.GrooveTypeId = procedureImage.GrooveTypeId;
newProcedureImage.ProjectId = procedureImage.ProjectId;
Funs.DB.PW_ProcedureImageManage.InsertOnSubmit(newProcedureImage);
Funs.DB.SubmitChanges();
}
///
/// 修改工艺管道图片
///
///
public static void UpdateProcedureImage(Model.PW_ProcedureImageManage procedureImage)
{
Model.PW_ProcedureImageManage newProcedureImage = Funs.DB.PW_ProcedureImageManage.FirstOrDefault(e => e.ImageId == procedureImage.ImageId);
newProcedureImage.ImageContent = procedureImage.ImageContent;
newProcedureImage.AttachUrl = procedureImage.AttachUrl;
newProcedureImage.WeldingMethodId = procedureImage.WeldingMethodId;
newProcedureImage.Thickness = procedureImage.Thickness;
newProcedureImage.WeldTypeId = procedureImage.WeldTypeId;
newProcedureImage.GrooveTypeId = procedureImage.GrooveTypeId;
newProcedureImage.ProjectId = procedureImage.ProjectId;
Funs.DB.SubmitChanges();
}
///
/// 删除工艺图片
///
///
public static void DeleteProcedureImage(string imageId)
{
Model.PW_ProcedureImageManage procedureImage = Funs.DB.PW_ProcedureImageManage.FirstOrDefault(e => e.ImageId == imageId);
Funs.DB.PW_ProcedureImageManage.DeleteOnSubmit(procedureImage);
Funs.DB.SubmitChanges();
}
///
/// 获取工艺图片下拉选择项
///
///
///
///
public static void InitImageContentDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string itemText)
{
dropName.DataValueField = "ImageId";
dropName.DataTextField = "ImageContent";
dropName.DataSource = (from x in Funs.DB.PW_ProcedureImageManage orderby x.ImageContent select x).ToList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName, itemText);
}
}
}
}