예제 #1
0
 /// <summary>
 /// 编辑表格行数据
 /// </summary>
 /// <param name="tableName">表名</param>
 /// <param name="pk">主键字段</param>
 /// <param name="entityJons">实体参数</param>
 /// <returns></returns>
 public ActionResult EditDataTableRow(string tableName, string pk, string entityJons)
 {
     try
     {
         Hashtable ht = new Hashtable();
         DataTable dt = DataHelper.DataFilter(_baseDatabasebll.GetColumnList(tableName), "datatype = 'datetime'");
         foreach (DataRow item in dt.Rows)
         {
             ht[item["column"].ToString().ToLower()] = item["column"].ToString().ToLower();
         }
         Hashtable tableField = HashtableHelper.JsonToHashtable(entityJons);
         foreach (string item in ht.Keys)
         {
             tableField.Remove(item);
         }
         int IsOk = DataFactory.Database().Update(tableName, tableField, pk);
         return(Content(new JsonMessage {
             Success = true, Code = IsOk.ToString(), Message = "操作成功"
         }.ToString()));
     }
     catch (Exception ex)
     {
         return(Content(new JsonMessage {
             Success = false, Code = "-1", Message = "操作失败:" + ex.Message
         }.ToString()));
     }
 }
예제 #2
0
        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.Current.Request["action"];                                  //提交类型
            string orderField     = HttpContext.Current.Request["pqGrid_OrderField"];                       //排序字段
            string orderType      = HttpContext.Current.Request["pqGrid_OrderType"];                        //排序类型
            string pqGrid_Sort    = HttpContext.Current.Request["pqGrid_Sort"];                             //要显示字段
            string key            = HttpContext.Current.Request["key"];                                     //主键
            string Parm_Key_Value = HttpContext.Current.Request["Parm_Key_Value"];                          //搜索条件键值

            switch (active)
            {
            case "GridBindList":    //加载列表
                Hashtable parm = HashtableHelper.String_Key_ValueToHashtable(Parm_Key_Value);
                Response.Write(JsonHelper.PqGridJson <BPMS_InterfaceAccess>(bpms_interfaceaccessibll.GetListWhere(parm), pqGrid_Sort));
                Response.End();
                break;

            case "Delete":        //删除数据
                Response.Write(bpms_interfaceaccessibll.Delete(key));
                Response.End();
                break;

            default:
                break;
            }
        }
예제 #3
0
        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.Current.Request["action"];                                  //提交类型
            int    pageIndex      = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageIndex"]);   //当前页
            int    pageSize       = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageSize"]);    //当前页大小
            string orderField     = HttpContext.Current.Request["pqGrid_OrderField"];                       //排序字段
            string orderType      = HttpContext.Current.Request["pqGrid_OrderType"];                        //排序类型
            string pqGrid_Sort    = HttpContext.Current.Request["pqGrid_Sort"];                             //要显示字段
            string key            = HttpContext.Current.Request["key"];                                     //主键
            string Parm_Key_Value = HttpContext.Current.Request["Parm_Key_Value"];                          //搜索条件键值

            switch (active)
            {
            case "GridBindList":    //加载列表
                int       count = 0;
                Hashtable parm  = HashtableHelper.String_Key_ValueToHashtable(Parm_Key_Value);
                Response.Write(JsonHelper.PqGridPageJson <BPMS_SysLoginLog>(bpms_syslogsibll.GetLoginLogList(parm, orderField, orderType, pageIndex, pageSize, ref count), pageIndex, pqGrid_Sort, count));
                Response.End();
                break;

            default:
                break;
            }
        }
예제 #4
0
        public string GetDataPermission(string UserId)
        {
            //验证是否有权访问
            if (!bpms_interfaceaccessibll.IsEnabled(UserId))
            {
                return(MessageHelper.MSG0027);
            }
            Hashtable DataPermissionList = bpms_permissionibll.GetDataPermission(UserId);

            return(HashtableHelper.HashtableToXml(DataPermissionList));
        }
예제 #5
0
        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.Current.Request["action"];                                  //提交类型
            int    pageIndex      = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageIndex"]);   //当前页
            int    pageSize       = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageSize"]);    //当前页大小
            string orderField     = HttpContext.Current.Request["pqGrid_OrderField"];                       //排序字段
            string orderType      = HttpContext.Current.Request["pqGrid_OrderType"];                        //排序类型
            string pqGrid_Sort    = HttpContext.Current.Request["pqGrid_Sort"];                             //要显示字段
            string key            = HttpContext.Current.Request["key"];                                     //主键
            string Category       = HttpContext.Current.Request["Category"];                                //机构分类
            string OrganizationId = HttpContext.Current.Request["OrganizationId"];                          //机构主键
            string Parm_Key_Value = HttpContext.Current.Request["Parm_Key_Value"];                          //搜索条件键值
            string search         = HttpContext.Current.Request["search"];                                  //模糊查询条件

            switch (active)
            {
            case "GridBindList":    //加载列表
                int       count = 0;
                Hashtable parm  = HashtableHelper.String_Key_ValueToHashtable(Parm_Key_Value);
                parm["Category"]       = Category;
                parm["OrganizationId"] = OrganizationId;
                Response.Write(JsonHelper.PqGridPageJson <BPMS_Employee>(bpms_employeeibll.GetPageList(parm, orderField, orderType, pageIndex, pageSize, ref count), pageIndex, pqGrid_Sort, count));
                Response.End();
                break;

            case "Delete":        //删除数据
                //保存成功后将数据同步到微信企业号
                bpms_employee = bpms_employeeibll.GetEntity(key);
                if (!myCommFun.DeleteMember(bpms_employee.Code))
                {
                    ShowMsgHelper.AlertCallback(MessageHelper.MSG0032);
                }
                Response.Write(bpms_employeeibll.Delete(key));
                Response.End();
                break;

            case "autocomplete":    //员工自动补全,返回JSON
                Response.Write(JsonHelper.ListToJson <BPMS_Employee>(bpms_employeeibll.autocomplete(search), "JSON"));
                Response.End();
                break;

            default:
                break;
            }
        }
        /// <summary>
        /// 生成列表页面
        /// </summary>
        /// <param name="Areas">业务区域</param>
        /// <param name="ControllerName">控制器名称</param>
        /// <param name="ClassName">类名备注</param>
        /// <param name="PageListName">列表文件名称</param>
        /// <param name="table">表名</param>
        /// <param name="showFieldJson">显示字段</param>
        /// <param name="AllowOrder">是否排序</param>
        /// <param name="OrderType">排序类型</param>
        /// <param name="OrderField">排序字段</param>
        /// <param name="AllowPageing">是否分页</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="PageLayout">页面布局</param>
        /// <param name="method">操作</param>
        /// <returns></returns>
        public ActionResult GetCodeBuilderList(string Areas, string ControllerName, string ClassName, string PageListName, string table,
                                               string showFieldJson, string AllowOrder, string OrderType, string OrderField, string AllowPageing, string pageSize, string PageLayout, string method)
        {
            codematicbll.Company        = "Learun";
            codematicbll.Author         = "she";
            codematicbll.CreateYear     = DateTime.Now.ToString("yyyy");
            codematicbll.CreateDate     = DateTime.Now.ToString("yyyy.MM.dd HH:mm");
            codematicbll.ClassName      = ClassName;
            codematicbll.PageListName   = PageListName;
            codematicbll.ControllerName = ControllerName;
            codematicbll.AreasName      = Areas;

            Hashtable htmethod = HashtableHelper.ParameterToHashtable(method);

            return(Content(codematicbll.GetCodeBuilderList(table, showFieldJson, AllowOrder, OrderType, OrderField, AllowPageing, pageSize, PageLayout, htmethod).ToString()));
        }
예제 #7
0
        /// <summary>
        /// 生成列表页面
        /// </summary>
        /// <param name="areas">业务区域</param>
        /// <param name="controllerName">控制器名称</param>
        /// <param name="className">类名备注</param>
        /// <param name="pageListName">列表文件名称</param>
        /// <param name="table">表名</param>
        /// <param name="showFieldJson">显示字段</param>
        /// <param name="allowOrder">是否排序</param>
        /// <param name="orderType">排序类型</param>
        /// <param name="orderField">排序字段</param>
        /// <param name="allowPageing">是否分页</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="pageLayout">页面布局</param>
        /// <param name="method">操作</param>
        /// <returns></returns>
        public ActionResult GetCodeBuilderList(string areas, string controllerName, string className, string pageListName, string table,
                                               string showFieldJson, string allowOrder, string orderType, string orderField, string allowPageing, string pageSize, string pageLayout, string method)
        {
            _codematicbll.Company        = "Iooin";
            _codematicbll.Author         = "Carlzhu";
            _codematicbll.CreateYear     = DateTime.Now.ToString("yyyy");
            _codematicbll.CreateDate     = DateTime.Now.ToString("yyyy.MM.dd HH:mm");
            _codematicbll.ClassName      = className;
            _codematicbll.PageListName   = pageListName;
            _codematicbll.ControllerName = controllerName;
            _codematicbll.AreasName      = areas;

            Hashtable htmethod = HashtableHelper.ParameterToHashtable(method);

            return(Content(_codematicbll.GetCodeBuilderList(table, showFieldJson, allowOrder, orderType, orderField, allowPageing, pageSize, pageLayout, htmethod).ToString()));
        }
예제 #8
0
        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.Current.Request["action"];                                  //提交类型
            int    pageIndex      = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageIndex"]);   //当前页
            int    pageSize       = CommonHelper.GetInt(HttpContext.Current.Request["pqGrid_PageSize"]);    //当前页大小
            string orderField     = HttpContext.Current.Request["pqGrid_OrderField"];                       //排序字段
            string orderType      = HttpContext.Current.Request["pqGrid_OrderType"];                        //排序类型
            string pqGrid_Sort    = HttpContext.Current.Request["pqGrid_Sort"];                             //要显示字段
            string key            = HttpContext.Current.Request["key"];                                     //主键
            string Parm_Key_Value = HttpContext.Current.Request["Parm_Key_Value"];                          //搜索条件键值
            string search         = HttpContext.Current.Request["search"];                                  //模糊查询条件

            switch (active)
            {
            case "GridBindList":    //加载列表
                int       count = 0;
                Hashtable parm  = HashtableHelper.String_Key_ValueToHashtable(Parm_Key_Value);
                Response.Write(JsonHelper.PqGridPageJson <BPMS_User>(bpms_useribll.GetPageList(parm, orderField, orderType, pageIndex, pageSize, ref count), pageIndex, pqGrid_Sort, count));
                Response.End();
                break;

            case "Delete":        //删除数据
                string UserId = RequestSession.GetSessionUser().UserId;
                if (key == UserId)
                {
                    Response.Write(string.Format(MessageHelper.MSG0018, RequestSession.GetSessionUser().Account));
                    Response.End();
                }
                Response.Write(bpms_useribll.Delete(key));
                Response.End();
                break;

            case "autocomplete":    //员工自动补全,返回JSON
                Response.Write(JsonHelper.ListToJson <BPMS_User>(bpms_useribll.autocomplete(search), "JSON"));
                Response.End();
                break;

            default:
                break;
            }
        }
예제 #9
0
 /// <summary>
 /// 删除表格行数据
 /// </summary>
 /// <param name="tableName">表名</param>
 /// <param name="pk">主键字段</param>
 /// <param name="entityJons"></param>
 /// <returns></returns>
 public ActionResult DeleteDataTableRow(string tableName, string pk, string entityJons)
 {
     try
     {
         Hashtable tableField = HashtableHelper.JsonToHashtable(entityJons);
         int       isOk       = DataFactory.Database().Delete(tableName, pk.ToLower(), tableField[pk.ToLower()].ToString());
         return(Content(new JsonMessage {
             Success = true, Code = isOk.ToString(), Message = "删除成功"
         }.ToString()));
     }
     catch (Exception ex)
     {
         return(Content(new JsonMessage {
             Success = false, Code = "-1", Message = "操作失败:" + ex.Message
         }.ToString()));
     }
 }
        /// <summary>
        /// 自定义格式化
        /// </summary>
        /// <param name="CustomSwitch"></param>
        /// <returns></returns>
        public string ToFormatter(string CustomSwitch)
        {
            StringBuilder str = new StringBuilder();

            str.Append("function (cellvalue, options, rowObject) {");
            Hashtable ht = HashtableHelper.JsonToHashtable(CustomSwitch);

            if (ht != null && ht.Count > 0)
            {
                foreach (string key in ht.Keys)
                {
                    str.Append("if (cellvalue == '" + key + "')");
                    str.Append("    return \"" + ht[key] + "\";");
                }
            }
            else
            {
                str.Append("return \"<img src='../../Content/Images/\" + cellvalue + \"'/>\";");
            }
            str.Append("}");
            return(str.ToString());
        }
예제 #11
0
        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.Current.Request["action"];                                  //提交类型
            string orderField     = HttpContext.Current.Request["pqGrid_OrderField"];                       //排序字段
            string orderType      = HttpContext.Current.Request["pqGrid_OrderType"];                        //排序类型
            string pqGrid_Sort    = HttpContext.Current.Request["pqGrid_Sort"];                             //要显示字段
            string UserId         = HttpContext.Current.Request["UserId"];                                  //用户主键
            string RoleId         = HttpContext.Current.Request["RoleId"];                                  //角色主键
            string Parm_Key_Value = HttpContext.Current.Request["Parm_Key_Value"];                          //搜索条件键值

            switch (active)
            {
            case "InitRolesMember":     //加载角色成员
                Hashtable parm = HashtableHelper.String_Key_ValueToHashtable(Parm_Key_Value);
                parm["RoleId"] = RoleId;
                Response.Write(JsonHelper.PqGridJson <BPMS_User>(bpms_userroleibll.GetListMember(parm), pqGrid_Sort));
                Response.End();
                break;

            case "DeleteMember":    //删除角色成员
                string[] array = new string[0];
                if (!string.IsNullOrEmpty(UserId))
                {
                    array = UserId.Split(',');
                }
                Response.Write(bpms_userroleibll.BatchDeleteMember(RoleId, array));
                Response.End();
                break;

            default:
                break;
            }
        }