public string SaveInfo()
 {
     return(base.ExecuteActionJsonResult("组织机构保存", () =>
     {
         GI_OrganInfo entity = base.GetPageData <GI_OrganInfo>(0);
         entity.OrganID = string.IsNullOrWhiteSpace(entity.OrganID) ? null : entity.OrganID;
         entity.ParentID = string.IsNullOrWhiteSpace(entity.ParentID) ? null : entity.ParentID;
         organInfoService.SaveInfo(entity);
         return new WebApi_Result();
     }));
 }
 public string GetInfoById()
 {
     return(base.ExecuteActionJsonResult("获取组织机构信息", () =>
     {
         GI_OrganInfo info = EntityOperate <GI_OrganInfo> .GetEntityById(Request["ORGANID"], "ORGANID");
         return new WebApi_Result()
         {
             data = info
         };
     }));
 }
Exemple #3
0
 /// <summary>
 /// 保存组织机构数据
 /// </summary>
 /// <param name="entity">组织机构实体</param>
 public void SaveInfo(GI_OrganInfo entity)
 {
     if (!string.IsNullOrWhiteSpace(entity.OrganID) && entity.OrganID != "null")
     {
         entity.ParentID = string.IsNullOrWhiteSpace(entity.ParentID) ? null : entity.ParentID;
         entity.UpdateM("ORGANID");
     }
     else
     {
         entity.OrganID  = GetPrimaryId();
         entity.ParentID = (string.IsNullOrWhiteSpace(entity.ParentID) ? "0" : entity.ParentID);
         entity.SaveModelM();
     }
 }