コード例 #1
0
ファイル: AMS_SysMenuBLL.cs プロジェクト: xiaolin8/AMS
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Update(AMS_SysMenu entity)
 {
     //return dal.Update(entity) >= 0 ? true : false;
     #region 获取旧值
     var oldEntity = this.GetEntity(AMS_SysLogBLL.Instance.GetKeyFieldValue<AMS_SysMenu>(entity).ToString());
     #endregion
     int IsOk = DbUtils.Update(entity, "MenuId");
     #region 写日操作日志
     if (IsOk > 0)
     {
         AMS_SysLogBLL.Instance.UpdateTaskLog<AMS_SysMenu>(oldEntity, entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
     }
     #endregion
     return IsOk >= 0 ? true : false;
 }
コード例 #2
0
ファイル: OrganizeController.cs プロジェクト: xiaolin8/AMS
        public void LoadAction()
        {
            Response.Buffer = true;
            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "No-Cache");

            string active = HttpContext.Request["action"];                                          //提交类型
            string key = HttpContext.Request["key"];                                                //主键
            string search = HttpContext.Request["search"];                                          //模糊查询条件
            AMS_SysMenuBLL ams_sysmenuibll = new AMS_SysMenuBLL();
            AMS_SysMenu ams_sysmenu = new AMS_SysMenu();
            switch (active)
            {
                case "OrgTreeList"://加载组织架构列表
                    Response.Write(GetTreeTable());
                    Response.End();
                    break;
                case "LoadTree":
                    IList list = ams_organizationbll.GetList();
                    Response.Write(GetTreeList(list));
                    Response.End();
                    break;
                case "autocomplete"://员工自动补全,返回JSON
                    Response.Write(JsonHelper.ListToJson<AMS_User>(ams_userbll.AutoComplete(search), "JSON"));
                    Response.End();
                    break;
                case "Delete":
                    if (ams_organizationbll.IsBelowMenu(key))
                    {
                        ams_organization = ams_organizationbll.GetEntity(key);
                        Response.Write(string.Format(MessageHelper.MSG0010, ams_organization.FullName));
                        Response.End();
                    }
                    else
                    {
                        Response.Write(ams_organizationbll.Delete(key));
                        Response.End();
                    }
                    break;
                case "LoadBindDrop"://绑定下拉框,公司,部门,工作组
                    Response.Write(JsonHelper.DropToJson<AMS_Organization>(ams_organizationbll.GetList(), "JSON"));
                    Response.End();
                    break;
                default:
                    break;
            }
        }
コード例 #3
0
ファイル: AMS_SysMenuBLL.cs プロジェクト: xiaolin8/AMS
 /// <summary>
 /// 增加一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Insert(AMS_SysMenu entity)
 {
     //return dal.Insert(entity) >= 0 ? true : false;
     int IsOk = DbUtils.Insert(entity);
     #region 写日操作日志
     if (IsOk > 0)
     {
         AMS_SysLogBLL.Instance.AddTaskLog<AMS_SysMenu>(entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
     }
     #endregion
     return IsOk >= 0 ? true : false;
 }