public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         service.Update(organizeEntity);
         try
         {
             //添加日志
             LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改组织机构信息【" + organizeEntity.F_FullName + "】成功!");
         }
         catch { }
     }
     else
     {
         organizeEntity.Create();
         service.Insert(organizeEntity);
         try
         {
             //添加日志
             LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "新建组织机构信息【" + organizeEntity.F_FullName + "】成功!");
         }
         catch { }
     }
 }
Beispiel #2
0
 public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         service.Update(organizeEntity);
     }
     else
     {
     }
 }
Beispiel #3
0
 public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         service.Update(organizeEntity, m => m.F_Id == keyValue);
     }
     else
     {
         organizeEntity.Create();
         service.Insert(organizeEntity);
     }
 }
Beispiel #4
0
 public void SubmitForm(OrganizeEntity entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         service.Update(entity);
     }
     else
     {
         entity.Create();
         service.Insert(entity);
     }
 }
Beispiel #5
0
 public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         service.Update(organizeEntity);
     }
     else
     {
         organizeEntity.Create();
         service.Insert(organizeEntity);
     }
     cache.RemoveCache(cacheKey);//移除缓存
 }
Beispiel #6
0
        /// <summary>
        /// 保存机构表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="organizeEntity">机构实体</param>
        /// <returns></returns>
        public void AddOrganize(string keyValue, OrganizeEntity organizeEntity)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                organizeEntity.Modify(keyValue);

                int res = this.BaseRepository().Update <OrganizeEntity>(organizeEntity);
            }
            else
            {
                organizeEntity.Create();

                int res = this.BaseRepository().Insert <OrganizeEntity>(organizeEntity);
            }
        }
        /// <summary>
        /// 保存机构表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="organizeEntity">机构实体</param>
        /// <returns></returns>
        public void AddOrganize(string keyValue, OrganizeEntity organizeEntity)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                organizeEntity.Modify(keyValue);

                int res = o.BllSession.OrganizeBll.Update(organizeEntity);
            }
            else
            {
                organizeEntity.Create();

                bool res = o.BllSession.OrganizeBll.Insert(organizeEntity);
            }
        }
Beispiel #8
0
 /// <summary>
 /// 保存机构表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="organizeEntity">机构实体</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, OrganizeEntity organizeEntity)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         Base_Organize organize = Base_Organize.SingleOrDefault("where OrganizeId=@0", keyValue);
         organize            = EntityConvertTools.CopyToModel <OrganizeEntity, Base_Organize>(organizeEntity, organize);
         organize.OrganizeId = keyValue;
         organize.Update();
     }
     else
     {
         organizeEntity.Create();
         Base_Organize organize = EntityConvertTools.CopyToModel <OrganizeEntity, Base_Organize>(organizeEntity, null);
         organize.Insert();
     }
 }
Beispiel #9
0
 public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         service.Update(organizeEntity);
         //添加日志
         LogHelp.logHelp.WriteDbLog(true, "修改机构信息=>" + organizeEntity.FullName, Enums.DbLogType.Update, "机构管理");
     }
     else
     {
         organizeEntity.Create();
         service.Insert(organizeEntity);
         //添加日志
         LogHelp.logHelp.WriteDbLog(true, "添加机构信息=>" + organizeEntity.FullName, Enums.DbLogType.Create, "机构管理");
     }
 }
Beispiel #10
0
 /// <summary>
 /// 操作一个实体信息
 /// </summary>
 /// <param name="organizeEntity"></param>
 /// <param name="keyValue"></param>
 public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         organizeEntity.Modify(keyValue);
         ResultClass <int> _ret = service.Update(organizeEntity);
         if (!_ret.Result)
         {
             throw new Exception(_ret.ErrorMessage);
         }
     }
     else
     {
         organizeEntity.Create();
         ResultClass <int> _ret = service.Insert(organizeEntity);
         if (!_ret.Result)
         {
             throw new Exception(_ret.ErrorMessage);
         }
     }
 }
Beispiel #11
0
        public void SubmitForm(OrganizeEntity organizeEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                List <OrganizeEntity> SelectEntitys = this.GetSelectEntitys(keyValue, "");
                organizeEntity.FIsLeaf = SelectEntitys.Count > 1 ? false : true;

                organizeEntity.Modify(keyValue);
                service.Update(organizeEntity);

                if (organizeEntity.FIsOperation)
                {
                    if (SelectEntitys.Count > 0)
                    {
                        for (int i = 0; i < SelectEntitys.Count; i++)
                        {
                            if (SelectEntitys[i].FId != keyValue)
                            {
                                OrganizeEntity Entity = new OrganizeEntity();
                                Entity = GetForm(SelectEntitys[i].FId);

                                Entity.FIsOperation = organizeEntity.FIsOperation;

                                Entity.Modify(Entity.FId);
                                service.Update(Entity);
                            }
                        }
                    }
                }
            }
            else
            {
                organizeEntity.Create();
                service.Insert(organizeEntity);
            }
        }
Beispiel #12
0
        public Task <int> SubmitForm(OrganizeEntity organizeEntity, string keyValue)
        {
            var claimsIdentity = _httpContext.HttpContext.User.Identity as ClaimsIdentity;
            var claim          = claimsIdentity?.FindFirst(t => t.Type.Equals(ClaimTypes.NameIdentifier));

            if (!string.IsNullOrEmpty(keyValue))
            {
                organizeEntity.Modify(keyValue);
                if (claim != null)
                {
                    organizeEntity.F_LastModifyUserId = claim.Value;
                }
                return(_service.UpdateAsync(organizeEntity));
            }
            else
            {
                organizeEntity.Create();
                if (claim != null)
                {
                    organizeEntity.F_CreatorUserId = claim.Value;
                }
                return(_service.InsertAsync(organizeEntity));
            }
        }