2023-05-22-001

This commit is contained in:
2023-05-22 18:45:58 +08:00
parent e16d0cfca5
commit a198785bd4
56 changed files with 10090 additions and 61 deletions
+121
View File
@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class DocTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
public static Model.Base_DocType GetDocTypeById(string docTypeID)
{
return Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="?"></param>
public static void AddDocType(Model.Base_DocType docType)
{
Model.SGGLDB db = Funs.DB;
Model.Base_DocType newDocType = new Model.Base_DocType
{
DocTypeId = docType.DocTypeId,
DocTypeCode = docType.DocTypeCode,
DocTypeName = docType.DocTypeName,
CodeRule = docType.CodeRule,
};
db.Base_DocType.InsertOnSubmit(newDocType);
db.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="teamGroup"></param>
public static void UpdateDocType(Model.Base_DocType docType)
{
Model.SGGLDB db = Funs.DB;
Model.Base_DocType newDocType = db.Base_DocType.FirstOrDefault(e => e.DocTypeId == docType.DocTypeId);
if (newDocType != null)
{
newDocType.DocTypeCode = docType.DocTypeCode;
newDocType.DocTypeName = docType.DocTypeName;
newDocType.CodeRule = docType.CodeRule;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除信息
/// </summary>
/// <param name="docTypeID"></param>
public static void DeleteDocTypeById(string docTypeID)
{
Model.SGGLDB db = Funs.DB;
Model.Base_DocType docType = db.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID);
{
db.Base_DocType.DeleteOnSubmit(docType);
db.SubmitChanges();
}
}
/// <summary>
/// 获取类别下拉项
/// </summary>
/// <returns></returns>
public static List<Model.Base_DocType> GetDocTypeList()
{
var list = (from x in Funs.DB.Base_DocType orderby x.DocTypeCode select x).ToList();
return list;
}
/// <summary>
/// 类型表下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitDocTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "DocTypeId";
dropName.DataTextField = "DocTypeName";
dropName.DataSource = GetDocTypeList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
public static Model.Base_DocType GetDocTypeByName(string name)
{
return Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeName == name);
}
/// <summary>
/// 根据主键获取类别名称
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
public static string GetDocTypeNameById(string docTypeID)
{
string name = string.Empty;
var docType = Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID);
if (docType != null)
{
name = docType.DocTypeName;
}
return name;
}
}
}