예제 #1
0
 public ActionResult SubmitForm(Sys_Organize organizeEntity, string keyValue)
 {
     try
     {
         bool i = false;
         if (keyValue == "" || keyValue == null)
         {
             organizeEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             organizeEntity.F_CreatorTime   = DateTime.Now;
             organizeEntity.F_Id            = System.Guid.NewGuid().ToString();
             string[] notstr = { "ChildNodes" };
             i = organizeApp.Add(organizeEntity, notstr);
         }
         else
         {
             organizeEntity.F_Id = keyValue;
             organizeEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             organizeEntity.F_LastModifyTime   = DateTime.Now;
             string[] notstr = { "ChildNodes", "F_CreatorUserId", "F_CreatorTime" };
             i = organizeApp.Update(organizeEntity, notstr);
         }
         if (i)
         {
             return(Success());
         }
         else
         {
             return(Warning());
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
예제 #2
0
 public void SubmitForm(Sys_Organize entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.F_Id = keyValue;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_LastModifyUserId = LoginInfo.UserId;
         }
         entity.F_LastModifyTime = DateTime.Now;
         service.Update(entity);
     }
     else
     {
         entity.F_Id = Common.GuId();
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_CreatorUserId = LoginInfo.UserId;
         }
         entity.F_CreatorTime = DateTime.Now;
         service.Insert(entity);
     }
 }
 public void SubmitForm(Sys_Organize organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         m_iRepository.Update(organizeEntity);
     }
     else
     {
         organizeEntity.Create();
         m_iRepository.Insert(organizeEntity);
     }
 }
예제 #4
0
 public ActionResult Form(Sys_Organize model)
 {
     if (model.Id == 0)
     {
         var primaryKey = OrganizeService.Insert(model);
         return(primaryKey > 0 ? Success() : Error());
     }
     else
     {
         int row = OrganizeService.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
예제 #5
0
 public ActionResult Form(Sys_Organize model)
 {
     if (model.Id.IsNullOrEmpty())
     {
         var primaryKey = _organizeService.Insert(model);
         return(primaryKey != null?Success() : Error());
     }
     else
     {
         int row = _organizeService.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
예제 #6
0
        public object Put(int id, [FromBody] Sys_Organize model)
        {
            string currentUserName = "";

            model.F_LastModifyTime   = DateTime.Now;
            model.F_LastModifyUserId = currentUserName;

            var updateResult = sys_OrganizeManager.Update(model);

            return(Ok(new
            {
                success = updateResult
            }));
        }
예제 #7
0
        public object Put([FromBody] OrganizeModel organize)
        {
            var updateorganize = new Sys_Organize
            {
                F_Id        = organize.F_Id,
                F_ParentId  = organize.F_ParentId,
                F_Layers    = organize.F_Layers,
                F_FullName  = organize.F_FullName,
                F_EnCode    = organize.F_CategoryId,
                F_ManagerId = organize.F_ManagerId,
            };
            var ret = Repository.Update(updateorganize).Result;

            return(ret.ToJson());
        }
예제 #8
0
        public object Post([FromBody] Sys_Organize model)
        {
            string currentUserName = "";

            model.F_CreatorTime      = DateTime.Now;
            model.F_CreatorUserId    = currentUserName;
            model.F_LastModifyTime   = DateTime.Now;
            model.F_LastModifyUserId = currentUserName;

            var addResult = sys_OrganizeManager.Insert(model);

            return(Ok(new
            {
                success = addResult
            }));
        }
예제 #9
0
        public object Post([FromBody] OrganizeModel organize)
        {
            var addorganize = new Sys_Organize
            {
                F_Id       = Common.GuId(),
                F_ParentId = organize.F_ParentId,
                F_Layers   = 2,
                F_FullName = organize.F_FullName,
                F_EnCode   = organize.F_CategoryId,

                F_ManagerId   = organize.F_ManagerId,
                F_CreatorTime = DateTime.Now
            };
            var ret = Repository.Add(addorganize).Result;

            return(ret.ToJson());
        }
예제 #10
0
        public void SubmitForm(Sys_Organize organizeEntity, string keyValue)
        {
            OperatorModel op = OperatorProvider.Provider.GetCurrent();

            if (!string.IsNullOrEmpty(keyValue))
            {
                //organizeEntity.Modify(keyValue);
                organizeEntity.F_Id               = keyValue;
                organizeEntity.F_LastModifyTime   = DateTime.Now;
                organizeEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserId;
                int flag = service.Update(organizeEntity);
                LogHelper.Info("机构:【" + organizeEntity.F_FullName + "】编辑!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Code.Enum.OpType.System, null, "", "", ViewLevel.Admin);
            }
            else
            {
                //organizeEntity.Create();
                organizeEntity.F_Id            = Common.GuId();
                organizeEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserId;
                organizeEntity.F_CreatorTime   = DateTime.Now;
                service.Insert(organizeEntity);
                LogHelper.Info("机构:【" + organizeEntity.F_FullName + "】新增!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Code.Enum.OpType.System, null, "", "", ViewLevel.Admin);
            }
        }
예제 #11
0
        public Organize GetOrganize(string f_OrganizeId)
        {
            Sys_Organize sys_organize = _repository.FindEntity <Sys_Organize>(p => p.F_Id == f_OrganizeId);
            var          organize     = new Organize();

            if (sys_organize != null)
            {
                if (!string.IsNullOrEmpty(sys_organize.F_Address))
                {
                    organize.F_Address = sys_organize.F_Address;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_AreaId))
                {
                    organize.F_AreaId = sys_organize.F_AreaId;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_CategoryId))
                {
                    organize.F_CategoryId = sys_organize.F_CategoryId;
                }
                organize.F_CreatorTime = sys_organize.F_CreatorTime;
                if (!string.IsNullOrEmpty(sys_organize.F_CreatorUserId))
                {
                    organize.F_CreatorUserId = sys_organize.F_CreatorUserId;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_DeleteUserId))
                {
                    organize.F_DeleteUserId = sys_organize.F_DeleteUserId;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_Description))
                {
                    organize.F_Description = sys_organize.F_Description;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_Email))
                {
                    organize.F_Email = sys_organize.F_Email;
                }
                //organize.F_EnabledMark = sys_organize.F_EnabledMark;
                if (!string.IsNullOrEmpty(sys_organize.F_EnCode))
                {
                    organize.F_EnCode = sys_organize.F_EnCode;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_Fax))
                {
                    organize.F_Fax = sys_organize.F_Fax;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_FullName))
                {
                    organize.F_FullName = sys_organize.F_FullName;
                }
                organize.F_Id = sys_organize.F_Id;
                if (sys_organize.F_LastModifyTime != null)
                {
                    organize.F_LastModifyTime = sys_organize.F_LastModifyTime;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_LastModifyUserId))
                {
                    organize.F_LastModifyUserId = sys_organize.F_LastModifyUserId;
                }
                if (sys_organize.F_Layers != null)
                {
                    organize.F_Layers = sys_organize.F_Layers;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_ManagerId))
                {
                    organize.F_ManagerId = sys_organize.F_ManagerId;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_MobilePhone))
                {
                    organize.F_MobilePhone = sys_organize.F_MobilePhone;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_ParentId))
                {
                    organize.F_ParentId = sys_organize.F_ParentId;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_ShortName))
                {
                    organize.F_ShortName = sys_organize.F_ShortName;
                }
                if (sys_organize.F_SortCode != null)
                {
                    organize.F_SortCode = sys_organize.F_SortCode;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_TelePhone))
                {
                    organize.F_TelePhone = sys_organize.F_TelePhone;
                }
                if (!string.IsNullOrEmpty(sys_organize.F_WeChat))
                {
                    organize.F_WeChat = sys_organize.F_WeChat;
                }
            }
            return(organize);
        }
 public ActionResult SubmitForm(Sys_Organize organizeEntity, string keyValue)
 {
     m_service.SubmitForm(organizeEntity, keyValue);
     return(Success("操作成功。"));
 }
예제 #13
0
 public bool Update(Sys_Organize obj, string[] disablestr = null)
 {
     return(dal.Update(obj, disablestr));
 }
예제 #14
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <returns></returns>
 public bool Add(Sys_Organize obj, string[] disstr = null)
 {
     return(dal.Add(obj, disstr));
 }