质量资料收发文调整
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ReceivingDocTypeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取实体集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_ReceivingDocType> GetList()
|
||||
{
|
||||
var q = (from x in Funs.DB.Base_ReceivingDocType orderby x.SortIndex select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="?"></param>
|
||||
public static void AddReceivingDocType(Model.Base_ReceivingDocType model)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_ReceivingDocType newModel = new Model.Base_ReceivingDocType
|
||||
{
|
||||
TypeId = model.TypeId,
|
||||
TypeName = model.TypeName,
|
||||
SortIndex = model.SortIndex
|
||||
};
|
||||
|
||||
db.Base_ReceivingDocType.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="teamGroup"></param>
|
||||
public static void UpdateReceivingDocType(Model.Base_ReceivingDocType model)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_ReceivingDocType newModel = db.Base_ReceivingDocType.FirstOrDefault(e => e.TypeId == model.TypeId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.TypeName = model.TypeName;
|
||||
newModel.SortIndex = model.SortIndex;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="TypeId"></param>
|
||||
public static void DeleteReceivingDocTypeById(string TypeId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_ReceivingDocType model = db.Base_ReceivingDocType.FirstOrDefault(e => e.TypeId == TypeId);
|
||||
{
|
||||
db.Base_ReceivingDocType.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 资料收发文类别下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitReceivingDocTypeDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetReceivingDocTypeItem();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 资料收发文类别下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitReceivingDocType(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Text";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetReceivingDocTypeItem();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取资料收发文类别集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetReceivingDocTypeItem()
|
||||
{
|
||||
var q = (from x in Funs.DB.Base_ReceivingDocType orderby x.SortIndex select x).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(q[i].TypeName ?? "", q[i].TypeId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个资料收发文类别信息
|
||||
/// </summary>
|
||||
/// <param name="postId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_ReceivingDocType GetReceivingDocType(string TypeId)
|
||||
{
|
||||
return Funs.DB.Base_ReceivingDocType.FirstOrDefault(e => e.TypeId == TypeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user