public string GetInfoById() { return(base.ExecuteActionJsonResult("获取公用代码字典信息", () => { GI_CodeDict entity = EntityOperate <GI_CodeDict> .GetEntityById(Request["DICTID"], "DICTID", true); return new WebApi_Result() { data = entity }; })); }
public string SaveInfo() { return(base.ExecuteActionJsonResult("公用代码字典保存", () => { GI_CodeDict entity = base.GetPageData <GI_CodeDict>(0); entity.DictID = string.IsNullOrWhiteSpace(entity.DictID) ? null : entity.DictID; entity.ParentID = string.IsNullOrWhiteSpace(entity.ParentID) ? null : entity.ParentID; codeDictService.SaveInfo(entity); return new WebApi_Result(); })); }
/// <summary> /// 保存公用代码字典数据 /// </summary> /// <param name="entity">公用代码字典实体</param> public void SaveInfo(GI_CodeDict entity) { if (!string.IsNullOrWhiteSpace(entity.DictID) && entity.DictID != "null") { entity.UpdateM("DictID"); } else { entity.DictID = CommonService.GetPrimaryId(new GI_SerialInfo() { Name = "GI_CodeDict", ColumnName = "DictID", OrganID = entity.OrganID }) + ""; entity.ParentID = (string.IsNullOrWhiteSpace(entity.ParentID) ? "0" : entity.ParentID); entity.SaveModelM(); } }
/// <summary> /// 根据字典编码和父类字典英文名获取实体 /// </summary> /// <param name="DictCode"></param> /// <param name="DictEName"></param> /// <returns></returns> public GI_CodeDict GetCodeDictByDictCodeAndEName(string DictCode, string DictEName) { GI_CodeDict entity = EntityOperate <GI_CodeDict> .GetEntityBySQL("select * from GI_CodeDict where DictCode='" + DictCode + "' and ParentID in (select DictID from GI_CODEDICT where DictNameEN = '" + DictEName + "')"); return(entity); }
/// <summary> /// 通过DictID获取实体类 /// </summary> /// <param name="DictID"></param> /// <returns></returns> public GI_CodeDict GetCodeDictByDictID(string DictID) { GI_CodeDict entity = EntityOperate <GI_CodeDict> .GetEntityById(DictID, "DictID"); return(entity); }