Beispiel #1
0
        public void GetRoleRightListByUserID()
        {
            int UserID = base.GetInt("UserID", 0);

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@UserID", UserID, TypeCode.Int32)
            };
            string querySqlCode = "QueryRoleRightListByUserID_Param";

            try
            {
                DataSet dataSet = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                dataSet = this.MergeUserRoleRightState(dataSet);
                DataSet dataSet2 = new DataSet();
                dataSet2.Merge(dataSet.Tables[0]);
                dataSet2.Merge(dataSet.Tables[1]);
                dataSet2.Merge(dataSet.Tables[2]);
                string msg = JsonHelperFont.Instance.DataSetToJSON(dataSet2);
                this.OutPutMessage(msg);
            }
            catch (Exception ex)
            {
                this.OutPutMessage(ex.Message);
            }
        }
Beispiel #2
0
        public virtual DataSet ExcuteQuerySqlX(string AppSettingKey, string QuerySqlCode, params SqlConditionInfo[] conditions)
        {
            string  connectionString = PEIS.DBUtility.PubConstant.GetConnectionString(AppSettingKey);
            DataSet result;

            if (string.IsNullOrEmpty(connectionString))
            {
                result = null;
            }
            else
            {
                string text = string.Empty;
                try
                {
                    string[] sqlSentence = this.GetSqlSentence(QuerySqlCode);
                    if (sqlSentence.Length > 0)
                    {
                        text = sqlSentence[0].ToString();
                    }
                    if (!string.IsNullOrEmpty(text) && conditions != null)
                    {
                        for (int i = 0; i < conditions.Length; i++)
                        {
                            SqlConditionInfo sqlConditionInfo = conditions[i];
                            if (sqlConditionInfo != null)
                            {
                                string text2 = sqlConditionInfo.ParamValue.ToString();
                                if (!string.IsNullOrEmpty(text2))
                                {
                                    string text3 = sqlConditionInfo.ParamName;
                                    if (text3.IndexOf("@") == -1)
                                    {
                                        text3 = "@" + text3;
                                    }
                                    if (text3 == "@CustomerExamState")
                                    {
                                        try
                                        {
                                            int num = int.Parse(text2);
                                        }
                                        catch (Exception var_7_FE)
                                        {
                                        }
                                    }
                                    text = text.Replace(text3, Util.GetStr(sqlConditionInfo));
                                }
                            }
                        }
                    }
                    result = DbHelperSQL.Query(connectionString, text);
                    return(result);
                }
                catch (Exception ex)
                {
                    Log4J.Instance.Error("通用查询语句(不分页) Exception:" + ex.Message + " Sql:" + Secret.AES.Encrypt(text));
                }
                result = null;
            }
            return(result);
        }
Beispiel #3
0
        public void DeleteRightNodeItem()
        {
            int @int = base.GetInt("txtRightID", 0);
            int num  = 0;
            int num2 = 0;

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@RightID", @int, TypeCode.Int32)
            };
            string querySqlCode = "QueryRightUsedCount_Param";

            try
            {
                DataSet dataSet = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                num  = int.Parse(dataSet.Tables[0].Rows[0][0].ToString());
                num += int.Parse(dataSet.Tables[1].Rows[0][0].ToString());
                num2 = int.Parse(dataSet.Tables[2].Rows[0][0].ToString());
            }
            catch (Exception ex)
            {
            }
            int num3;

            if (num > 0)
            {
                num3 = -1;
            }
            else if (num2 > 0)
            {
                num3 = -2;
            }
            else
            {
                num3 = (PEIS.BLL.SYSRight.Instance.Delete(@int) ? 1 : 0);
                if (num3 > 0)
                {
                    Log4J.Instance.Info(string.Concat(new object[]
                    {
                        Public.GetClientIP(),
                        ",",
                        this.LoginUserModel.UserName,
                        ",删除权限 ID:",
                        @int
                    }));
                }
                else
                {
                    Log4J.Instance.Error(string.Concat(new object[]
                    {
                        Public.GetClientIP(),
                        ",",
                        this.LoginUserModel.UserName,
                        ",删除权限失败 ID:",
                        @int
                    }));
                }
            }
            this.OutPutMessage(num3.ToString());
        }
Beispiel #4
0
        public void GetUserMenuRightSectionList()
        {
            int num = 1;

            try
            {
                num = int.Parse(BaseConfig.MenuModuleType);
            }
            catch (Exception ex)
            {
                num = 1;
            }
            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@UserID", this.LoginUserModel.UserID, TypeCode.Int32),
                new SqlConditionInfo("@MenuLevel", num, TypeCode.Int16)
            };
            string querySqlCode = "QueryUserMenuRightSectionList_Param";

            try
            {
                DataSet ds  = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                string  msg = JsonHelperFont.Instance.DataSetToJSON(ds);
                this.OutPutMessage(msg);
            }
            catch (Exception ex)
            {
                this.OutPutMessage(ex.Message);
            }
        }
Beispiel #5
0
        public void GetSingleSectionUserInfo()
        {
            int @int = base.GetInt("ID_User", 0);

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_User", @int, TypeCode.Int32)
            };
            string querySqlCode = "QuerySingleSectionUserInfo_Param";

            try
            {
                DataSet dataSet = CommonUser.Instance.ExcuteQuerySql(querySqlCode, conditions);
                if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
                {
                    dataSet.Tables[0].Columns.Add("SignatureCodeBase64");
                    foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                    {
                        if (!Convert.IsDBNull(dataRow["Signature"]))
                        {
                            dataRow["SignatureCodeBase64"] = Convert.ToBase64String((byte[])dataRow["Signature"]);
                            dataRow["Signature"]           = null;
                        }
                    }
                    dataSet.Tables[0].AcceptChanges();
                }
                string msg = JsonHelperFont.Instance.DataSetToJSON(dataSet);
                this.OutPutMessage(msg);
            }
            catch (Exception ex)
            {
                this.OutPutMessage(ex.Message);
            }
        }
Beispiel #6
0
        public void GetSectionUserList()
        {
            int    @int       = base.GetInt("pageIndex", 0);
            int    int2       = base.GetInt("pageSize", 10);
            int    int3       = base.GetInt("SelectedSectionID", 0);
            int    totalCount = 0;
            int    num        = 0;
            string text       = base.GetString("SearchUserKeyword").Trim();

            SqlConditionInfo[] array    = null;
            string             pageCode = "QueryPagesSectionUserListParam";

            if (!string.IsNullOrEmpty(text) && int3 <= 0)
            {
                array          = new SqlConditionInfo[1];
                pageCode       = "QueryPagesSectionUserListParamByName";
                array[0]       = new SqlConditionInfo("@UserName", text, TypeCode.String);
                array[0].Blur  = 3;
                array[0].Place = 2;
            }
            if (int3 > 0 && string.IsNullOrEmpty(text))
            {
                array          = new SqlConditionInfo[1];
                pageCode       = "QueryPagesUserListParamBySection";
                array[0]       = new SqlConditionInfo("@ID_Section", int3, TypeCode.Int32);
                array[0].Place = 2;
            }
            if (int3 > 0 && !string.IsNullOrEmpty(text))
            {
                array          = new SqlConditionInfo[2];
                pageCode       = "QueryPagesUserListParamByNameAndSection";
                array[0]       = new SqlConditionInfo("@UserName", text, TypeCode.String);
                array[0].Blur  = 3;
                array[0].Place = 2;
                array[1]       = new SqlConditionInfo("@ID_Section", int3, TypeCode.Int32);
                array[1].Place = 2;
            }
            DataTable page = CommonUser.Instance.GetPage(pageCode, @int, int2, out totalCount, out num, array);

            if (page != null && page.Rows.Count > 0)
            {
                page.Columns.Add("SignatureCodeBase64");
                foreach (DataRow dataRow in page.Rows)
                {
                    if (!Convert.IsDBNull(dataRow["Signature"]))
                    {
                        dataRow["SignatureCodeBase64"] = Convert.ToBase64String((byte[])dataRow["Signature"]);
                        dataRow["Signature"]           = null;
                    }
                }
                page.AcceptChanges();
            }
            string msg = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
        public override void ReplaceContent(ref VelocityContext vltContext)
        {
            vltContext.Put("pageTitle", "修改[" + base.GetString("CustomerName").ToLower() + "]客户档案");
            int @int = base.GetInt("ID_ArcCustomer", -1);

            if (@int > -1)
            {
                string             pageCode = "QueryCustomerManageListInfoPagesParam";
                SqlConditionInfo[] array    = new SqlConditionInfo[]
                {
                    new SqlConditionInfo("@ID_ArcCustomer", @int, TypeCode.Int16)
                };
                array[0].Place = 3;
                int       num       = 0;
                int       pageIndex = 0;
                int       pageSize  = 10;
                int       num2      = 1;
                DataTable page      = CommonRegiste.Instance.GetPage(pageCode, pageIndex, pageSize, out num, out num2, array);
                if (page.Rows.Count > 0)
                {
                    int count = page.Columns.Count;
                    if (page.Columns.Contains("Photo"))
                    {
                        page.Columns.Add("Base64Photo");
                        page.Columns.Add("FilePath");
                        foreach (DataRow dataRow in page.Rows)
                        {
                            if (!Convert.IsDBNull(dataRow["Photo"]))
                            {
                                dataRow["Base64Photo"] = Convert.ToBase64String((byte[])dataRow["Photo"]);
                            }
                            vltContext.Put("ID_ArcCustomer", dataRow["ID_ArcCustomer"].ToString());
                            vltContext.Put("CustomerName", dataRow["CustomerName"].ToString());
                            vltContext.Put("Gender", dataRow["ID_Gender"].ToString());
                            vltContext.Put("GenderName", dataRow["GenderName"].ToString());
                            vltContext.Put("IDCard", dataRow["IDCard"].ToString());
                            vltContext.Put("BirthDay", dataRow["BirthDay"].ToString());
                            vltContext.Put("MobileNo", dataRow["MobileNo"].ToString());
                            vltContext.Put("Base64Photo", dataRow["Base64Photo"].ToString());
                            vltContext.Put("ID_Marriage", dataRow["ID_Marriage"].ToString());
                            vltContext.Put("MarriageName", dataRow["MarriageName"].ToString());
                            vltContext.Put("NationID", dataRow["NationID"].ToString());
                            vltContext.Put("NationName", dataRow["NationName"].ToString());
                        }
                    }
                    this.Session["CustomerManage"] = page;
                }
            }
        }
        public void PrintCoverReport()
        {
            string text         = base.GetString("ID_Customer").Trim();
            string querySqlCode = "CustomerReportPrintCoverInfoPagesParam";

            SqlConditionInfo[] array = new SqlConditionInfo[1];
            if (!string.IsNullOrEmpty(text))
            {
                array[0]      = new SqlConditionInfo("@ID_Customer", text, TypeCode.Int32);
                array[0].Blur = 4;
            }
            DataTable dataTable = CommonReport.Instance.ExcuteQuerySql(querySqlCode, array).Tables[0];
            string    msg       = JsonHelperFont.Instance.DataTableToJSON(dataTable, dataTable.Rows.Count);

            this.OutPutMessage(msg);
        }
Beispiel #9
0
        DataTable ICommonSubScribe.GetPage(string pageCode, int pageIndex, int pageSize, out int recordCount, out int pageCount, params SqlConditionInfo[] conditions)
        {
            DataTable result;

            try
            {
                string[] sqlSentence = this.GetSqlSentence(pageCode);
                string   indexField  = sqlSentence[0];
                string   text        = sqlSentence[1];
                string   text2       = sqlSentence[2];
                string   text3       = sqlSentence[3];
                if (conditions != null)
                {
                    for (int i = 0; i < conditions.Length; i++)
                    {
                        SqlConditionInfo sqlConditionInfo = conditions[i];
                        if (sqlConditionInfo != null)
                        {
                            string text4 = sqlConditionInfo.ParamValue.ToString();
                            if (!string.IsNullOrEmpty(text4) && !(text4 == "-1"))
                            {
                                string text5 = sqlConditionInfo.ParamName;
                                if (text5.IndexOf("@") == -1)
                                {
                                    text5 = "@" + text5;
                                }
                                text2 += Util.GetConvertParam2Where(sqlConditionInfo);
                                text2  = text2.Replace(text5, Util.GetStr(sqlConditionInfo));
                                text3  = text3.Replace(sqlConditionInfo.ParamName, sqlConditionInfo.ParamValue.ToString());
                                text   = text.Replace(text5, Util.GetStr(sqlConditionInfo));
                            }
                        }
                    }
                }
                result = Pagination.ProcPage(text, text2, indexField, text3, pageIndex, pageSize, out recordCount, out pageCount);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex2)
            {
                throw new Exception("用于分页的SQL语句无效," + ex2.Message);
            }
            return(result);
        }
Beispiel #10
0
        public DataSet GetCustomerManageReport(string ID_Customer)
        {
            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_Customer", ID_Customer, System.TypeCode.String)
            };
            DataSet result       = null;
            string  querySqlCode = "QueryCustomerReportManage_Param";

            try
            {
                result = CommonReport.Instance.ExcuteQuerySql(querySqlCode, conditions);
            }
            catch (System.Exception var_3_33)
            {
            }
            return(result);
        }
Beispiel #11
0
        public void GetCustomerDiseaseLevelInform()
        {
            long   @int         = base.GetInt64("CustomerID", 0L);
            string querySqlCode = "QueryCust_DiseaseLevelInform_Param";

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_Customer", @int, TypeCode.Int64)
            };
            if (@int > 0L)
            {
                DataSet ds  = CommonCustExam.Instance.ExcuteQuerySql(querySqlCode, conditions);
                string  msg = JsonHelperFont.Instance.DataSetToJSON(ds);
                this.OutPutMessage(msg);
            }
            else
            {
                this.OutPutMessage("");
            }
        }
Beispiel #12
0
        public void GetUserAssignedRoleRightItemList()
        {
            int @int = base.GetInt("UserID", 0);

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_User", @int, TypeCode.Int32)
            };
            string querySqlCode = "QueryUserAssignedRoleRightItemList_Param";

            try
            {
                DataSet ds  = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                string  msg = JsonHelperFont.Instance.DataSetToJSON(ds);
                this.OutPutMessage(msg);
            }
            catch (Exception e)
            {
                this.OutPutMessage("");
            }
        }
Beispiel #13
0
        public void GetSingleNatRoleInfo()
        {
            int @int = base.GetInt("ID_Role", 0);

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_Role", @int, TypeCode.Int32)
            };
            string querySqlCode = "QuerySingleNatRole_Param";

            try
            {
                DataSet ds  = CommonConfig.Instance.ExcuteQuerySql(querySqlCode, conditions);
                string  msg = JsonHelperFont.Instance.DataSetToJSON(ds);
                this.OutPutMessage(msg);
            }
            catch (Exception e)
            {
                this.OutPutMessage("");
            }
        }
Beispiel #14
0
        public void GetUserList()
        {
            int    @int       = base.GetInt("pageIndex", 0);
            int    int2       = base.GetInt("pageSize", 10);
            int    totalCount = 0;
            int    num        = 0;
            string text       = base.GetString("SearchUserKeyword").Trim();
            string pageCode   = "QueryPagesUserListParam";

            SqlConditionInfo[] array = new SqlConditionInfo[1];
            if (!string.IsNullOrEmpty(text))
            {
                pageCode       = "QueryPagesUserListParamByName";
                array[0]       = new SqlConditionInfo("@UserName", text, TypeCode.String);
                array[0].Blur  = 3;
                array[0].Place = 2;
            }
            DataTable page = CommonUser.Instance.GetPage(pageCode, @int, int2, out totalCount, out num, array);
            string    msg  = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
Beispiel #15
0
        public static string GetStrByType(SqlConditionInfo info)
        {
            TypeCode paramType = info.ParamType;
            string   result;

            if (paramType != TypeCode.Char)
            {
                switch (paramType)
                {
                case TypeCode.DateTime:
                    result = "'" + info.ParamValue + "'";
                    return(result);

                case TypeCode.String:
                    goto IL_3B;
                }
                result = info.ParamValue.ToString();
                return(result);
            }
IL_3B:
            result = "'" + Input.Filter((string)info.ParamValue) + "'";
            return(result);
        }
Beispiel #16
0
        public int ISCanReadReport(string ID_Customer)
        {
            int result = 0;

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_Customer", ID_Customer, System.TypeCode.String)
            };
            DataSet dataSet      = null;
            string  querySqlCode = "QueryISCanReadReport_Param";

            try
            {
                dataSet = CommonReport.Instance.ExcuteQuerySql(querySqlCode, conditions);
            }
            catch (System.Exception var_4_35)
            {
            }
            if (dataSet.Tables[0].Rows.Count > 0)
            {
                result = int.Parse(dataSet.Tables[0].Rows[0]["SecurityLevel"].ToString());
            }
            return(result);
        }
Beispiel #17
0
        public static string GetStr(SqlConditionInfo info)
        {
            string result;

            switch (info.Blur)
            {
            case 1:
                result = "'%" + info.ParamValue + "'";
                break;

            case 2:
                result = "'" + info.ParamValue + "%'";
                break;

            case 3:
                result = "'%" + info.ParamValue + "%'";
                break;

            default:
                result = Util.GetStrByType(info);
                break;
            }
            return(result);
        }
        public void ViewReport()
        {
            string text       = base.GetString("ID_Customer").Trim();
            string text2      = base.GetString("modelName").Trim().ToLower();
            int    @int       = base.GetInt("pageIndex", 1);
            int    int2       = base.GetInt("pageSize", 10);
            int    totalCount = 0;
            int    num        = 0;
            string pageCode   = "CustomerReportPriViewInfoPagesParam";

            SqlConditionInfo[] array = null;
            if (text != string.Empty)
            {
                array = new SqlConditionInfo[]
                {
                    new SqlConditionInfo("@ID_Customer", text, TypeCode.Int32)
                };
                array[0].Blur = 4;
            }
            DataTable page = CommonReport.Instance.GetPage(pageCode, @int, int2, out totalCount, out num, array);
            string    msg  = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
Beispiel #19
0
        public void SaveRoleNodeItem()
        {
            int    num     = 0;
            int    @int    = base.GetInt("type", 0);
            int    int2    = base.GetInt("txtRoleID", 0);
            string @string = base.GetString("txtRoleName");
            int    int3    = base.GetInt("txtDispOrder", 0);
            int    int4    = base.GetInt("IsLockedRole", 0);
            string string2 = base.GetString("currRightIDsStr");

            switch (@int)
            {
            case 1:
            case 2:
                break;

            default:
                num = -2;
                break;
            }
            if (num >= 0)
            {
                PEIS.Model.SysRole sysRole = new PEIS.Model.SysRole();
                if (@int == 2)
                {
                    if (int2 > 0)
                    {
                        sysRole = PEIS.BLL.SysRole.Instance.GetModel(int2);
                    }
                    sysRole.RoleID = int2;
                }
                sysRole.RoleName   = Input.URLDecode(@string);
                sysRole.DispOrder  = int3;
                sysRole.Is_Locked  = int4;
                sysRole.OperatorID = new int?(this.LoginUserModel.UserID);
                sysRole.CreateDate = new DateTime?(DateTime.Now);
                SqlConditionInfo[] conditions = new SqlConditionInfo[]
                {
                    new SqlConditionInfo("@RoleName", sysRole.RoleName, TypeCode.String)
                };
                string querySqlCode = "QueryRoleNameInfo_Param";
                try
                {
                    DataSet dataSet = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                    int     count   = dataSet.Tables[0].Rows.Count;
                    switch (@int)
                    {
                    case 1:
                        if (count > 0)
                        {
                            num = -1;
                        }
                        else
                        {
                            sysRole.Is_DefaultRole = new int?(0);
                            num = PEIS.BLL.SysRole.Instance.Add(sysRole);
                            if (num > 0)
                            {
                                Log4J.Instance.Info(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",新增角色 角色名称:",
                                    sysRole.RoleName,
                                    ",ID_Role:",
                                    num
                                }));
                            }
                            else
                            {
                                Log4J.Instance.Error(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",新增角色失败 角色名称:",
                                    sysRole.RoleName,
                                    ",ID_Role:",
                                    num
                                }));
                            }
                        }
                        break;

                    case 2:
                        if (count > 0 && int.Parse(dataSet.Tables[0].Rows[0][0].ToString()) != sysRole.RoleID)
                        {
                            num = -1;
                        }
                        else
                        {
                            num = (PEIS.BLL.SysRole.Instance.Update(sysRole) ? 1 : 0);
                            if (num > 0)
                            {
                                Log4J.Instance.Info(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",修改角色 角色名称:",
                                    sysRole.RoleName,
                                    ",ID_Role:",
                                    sysRole.RoleID
                                }));
                            }
                            else
                            {
                                Log4J.Instance.Error(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",修改角色失败 角色名称:",
                                    sysRole.RoleName,
                                    ",ID_Role:",
                                    sysRole.RoleID
                                }));
                            }
                        }
                        break;

                    default:
                        num = -2;
                        break;
                    }
                    if (num > 0)
                    {
                        int iD_Role;
                        if (@int == 2)
                        {
                            iD_Role = int2;
                        }
                        else
                        {
                            iD_Role = num;
                        }
                        num = 1 + CommonRight.Instance.OperateRoleRight(iD_Role, string2, this.LoginUserModel.UserID, sysRole.CreateDate.Value);
                    }
                }
                catch (Exception ex)
                {
                    Log4J.Instance.Error(string.Concat(new string[]
                    {
                        Public.GetClientIP(),
                        ",",
                        this.LoginUserModel.UserName,
                        ",角色 错误信息:",
                        ex.Message
                    }));
                    num = 0;
                }
            }
            this.OutPutMessage(num.ToString());
        }
Beispiel #20
0
        public void QueryCustDiseaseLevelList()
        {
            string @string = base.GetString("CustomerID");
            int    @int    = base.GetInt("flag", -1);
            int    int2    = base.GetInt("IsInformed", -1);
            int    int3    = base.GetInt("MinLevel", -1);
            int    int4    = base.GetInt("MaxLevel", -1);
            string text    = base.Server.HtmlDecode(base.GetString("BeginExamDate"));
            string text2   = base.Server.HtmlDecode(base.GetString("EndExamDate"));
            string text3   = text.Replace("-", string.Empty);
            string text4   = text2.Replace("-", string.Empty);

            if (!string.IsNullOrEmpty(text))
            {
                text += " 00:00:00";
            }
            if (!string.IsNullOrEmpty(text2))
            {
                text2 += " 23:59:59";
            }
            int    int5       = base.GetInt("pageIndex", 0);
            int    int6       = base.GetInt("pageSize", 10);
            int    totalCount = 0;
            int    num        = 0;
            string pageCode   = "QueryCustDiseaseLevelPagesParam";

            SqlConditionInfo[] array = new SqlConditionInfo[8];
            if (!string.IsNullOrEmpty(@string))
            {
                array[0]       = new SqlConditionInfo("@ID_Customer", @string, TypeCode.Int32);
                array[0].Place = 3;
            }
            else
            {
                if (int2 >= 0)
                {
                    array[1]       = new SqlConditionInfo("@Is_DiseaseLevelInformed", int2, TypeCode.Int32);
                    array[1].Place = 3;
                }
                if (int3 >= 0)
                {
                    array[2]           = new SqlConditionInfo("@DiseaseLevel", int3, TypeCode.Int32);
                    array[2].ParamOper = ">=";
                    array[2].Place     = 3;
                }
                if (int4 >= 0)
                {
                    array[3]           = new SqlConditionInfo("@DiseaseLevel", int4, TypeCode.Int32);
                    array[3].ParamOper = "<=";
                    array[3].Place     = 3;
                }
                if (!string.IsNullOrEmpty(text) && Input.IsDate(text))
                {
                    array[4]           = new SqlConditionInfo("@OperateDate", text, TypeCode.DateTime);
                    array[4].ParamOper = ">=";
                    array[4].Place     = 3;
                }
                if (!string.IsNullOrEmpty(text2) && Input.IsDate(text2))
                {
                    array[5]           = new SqlConditionInfo("@OperateDate", text2, TypeCode.DateTime);
                    array[5].ParamOper = "<=";
                    array[5].Place     = 3;
                }
            }
            DataTable page = CommonCustExam.Instance.GetPage(pageCode, int5, int6, out totalCount, out num, array);

            foreach (DataRow dataRow in page.Rows)
            {
                if (dataRow["OperateDate"] != null && !string.IsNullOrEmpty(dataRow["OperateDate"].ToString()))
                {
                    dataRow["OperateDate"] = Convert.ToDateTime(dataRow["OperateDate"].ToString()).ToString("yyyy-MM-dd HH:mm");
                }
                if (dataRow["DiseaseLevelInformedDate"] != null && !string.IsNullOrEmpty(dataRow["DiseaseLevelInformedDate"].ToString()))
                {
                    dataRow["DiseaseLevelInformedDate"] = Convert.ToDateTime(dataRow["DiseaseLevelInformedDate"].ToString()).ToString("yyyy-MM-dd HH:mm");
                }
                if (dataRow["CheckedDate"] != null && !string.IsNullOrEmpty(dataRow["CheckedDate"].ToString()))
                {
                    dataRow["CheckedDate"] = Convert.ToDateTime(dataRow["CheckedDate"].ToString()).ToString("yyyy-MM-dd HH:mm");
                }
            }
            page.AcceptChanges();
            string msg = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
Beispiel #21
0
        public void SaveRoleInfo()
        {
            int    RoleID = base.GetInt("RoleID", 0);
            string text   = base.GetString("RoleName");

            text = Input.URLDecode(text);
            int    int2     = base.GetInt("DispOrder", 500);
            int    arg_47_0 = (base.GetInt("Is_DefaultRole", 0) == 1) ? 1 : 0;
            string text2    = base.GetString("Remark");

            text2 = Input.URLDecode(text2);
            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@RoleName", text, TypeCode.String)
            };
            string querySqlCode = "QueryRoleNameIsExis_Param";

            try
            {
                DataSet dataSet = CommonConfig.Instance.ExcuteQuerySql(querySqlCode, conditions);
                if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
                {
                    if (RoleID <= 0 || dataSet.Tables[0].Rows.Count != 1 || int.Parse(dataSet.Tables[0].Rows[0][0].ToString()) != RoleID)
                    {
                        this.OutPutMessage("-1".ToString());
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                return;
            }
            PEIS.Model.SysRole sysRole;
            if (RoleID <= 0)
            {
                sysRole = new PEIS.Model.SysRole();
            }
            else
            {
                sysRole = PEIS.BLL.SysRole.Instance.GetModel(RoleID);
            }
            sysRole.RoleID = RoleID;
            if (RoleID <= 0)
            {
                sysRole.CreateDate = new DateTime?(DateTime.Now);
            }
            sysRole.RoleName   = text;
            sysRole.DispOrder  = int2;
            sysRole.Remark     = text2;
            sysRole.OperatorID = new int?(this.LoginUserModel.UserID);
            int    num   = CommonConfig.Instance.SaveRole(sysRole);
            int    num2  = (RoleID > 0) ? RoleID : num;
            string text3 = (RoleID > 0) ? "修改" : "新增";

            if (num > 0)
            {
                Log4J.Instance.Info(string.Concat(new object[]
                {
                    Public.GetClientIP(),
                    ",",
                    this.LoginUserModel.UserName,
                    ",",
                    text3,
                    "角色 名称:",
                    text,
                    ",编号:",
                    num2
                }));
            }
            else
            {
                Log4J.Instance.Error(string.Concat(new object[]
                {
                    Public.GetClientIP(),
                    ",",
                    this.LoginUserModel.UserName,
                    ",",
                    text3,
                    "角色失败 名称:",
                    text,
                    ",编号:",
                    num2
                }));
            }
            this.OutPutMessage(num.ToString());
        }
        public void GetInformerOrReceiptReport()
        {
            string text       = base.GetString("ID_Team").Trim().ToLower();
            string a          = base.GetString("SearchType").Trim().ToLower();
            string text2      = base.GetString("IDCard").Trim();
            string text3      = base.GetString("ID_Customer").Trim();
            string a2         = base.GetString("modelName").Trim().ToLower();
            int    @int       = base.GetInt("pageIndex", 1);
            int    int2       = base.GetInt("pageSize", 10);
            int    totalCount = 0;
            int    num        = 0;
            int    num2       = 7;
            string pageCode   = string.Empty;

            if (a2 == "informer")
            {
                int.TryParse(UiConfig.ReportOutDays, out num2);
                pageCode = "CustomerInformerPagesParam";
            }
            else if (a2 == "receipt")
            {
                pageCode = "CustomerReceiptPagesParam";
            }
            SqlConditionInfo[] array = new SqlConditionInfo[6];
            if (!string.IsNullOrEmpty(text3))
            {
                array[0]      = new SqlConditionInfo("@ID_Customer", text3, TypeCode.Int32);
                array[0].Blur = 4;
            }
            array[1]       = new SqlConditionInfo("@SecurityLevel", this.SecurityLevel, TypeCode.Int32);
            array[1].Place = 2;
            array[2]       = new SqlConditionInfo("@ReportOutDays", num2, TypeCode.Int32);
            array[2].Place = 2;
            if (!string.IsNullOrEmpty(text2))
            {
                array[3]      = new SqlConditionInfo("@IDCard", text2, TypeCode.String);
                array[3].Blur = 4;
            }
            if (!(a == "0"))
            {
                if (a == "1")
                {
                    array[4]      = new SqlConditionInfo("@Is_Team", 0, TypeCode.Int32);
                    array[4].Blur = 4;
                }
                else if (a == "2")
                {
                    array[4]      = new SqlConditionInfo("@Is_Team", 1, TypeCode.Int32);
                    array[4].Blur = 4;
                    if (text != "-1")
                    {
                        array[5]      = new SqlConditionInfo("@ID_Team", text, TypeCode.Int32);
                        array[5].Blur = 4;
                    }
                }
            }
            DataTable page = CommonReport.Instance.GetPage(pageCode, @int, int2, out totalCount, out num, array);
            string    msg  = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
        public void GetCustomerManageList()
        {
            int    @int       = base.GetInt("ID_ArcCustomer", -1);
            int    int2       = base.GetInt("pageIndex", 1);
            int    int3       = base.GetInt("pageSize", 10);
            string text       = Input.URLDecode(base.GetString("CustomerName").Trim().ToLower());
            string text2      = base.GetString("Gender").Trim().ToLower();
            string text3      = base.GetString("IDCard").Trim().ToLower();
            string text4      = base.GetString("Birthday").Trim().ToLower();
            int    totalCount = 0;
            int    num        = 0;
            string pageCode   = "QueryCustomerManageListInfoPagesParam";

            SqlConditionInfo[] array = new SqlConditionInfo[5];
            if (@int > -1)
            {
                array[4]       = new SqlConditionInfo("@ID_ArcCustomer", @int, TypeCode.Int16);
                array[4].Place = 3;
            }
            else
            {
                if (!string.IsNullOrEmpty(text))
                {
                    array[0]       = new SqlConditionInfo("@CustomerName", text, TypeCode.String);
                    array[0].Blur  = 3;
                    array[0].Place = 3;
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    if (text2 != "-1")
                    {
                        array[1]       = new SqlConditionInfo("@ID_Gender", text2, TypeCode.String);
                        array[1].Place = 3;
                    }
                }
                if (!string.IsNullOrEmpty(text3))
                {
                    array[2]       = new SqlConditionInfo("@IDCard", text3, TypeCode.String);
                    array[2].Blur  = 3;
                    array[2].Place = 3;
                }
                if (!string.IsNullOrEmpty(text4))
                {
                    array[3]       = new SqlConditionInfo("@BirthDay", text4, TypeCode.String);
                    array[3].Place = 3;
                }
            }
            DataTable page = CommonRegiste.Instance.GetPage(pageCode, int2, int3, out totalCount, out num, array);

            if (page.Rows.Count > 0)
            {
                int count = page.Columns.Count;
                if (page.Columns.Contains("Photo"))
                {
                    page.Columns.Add("Base64Photo");
                    page.Columns.Add("FilePath");
                    foreach (DataRow dataRow in page.Rows)
                    {
                        if (!Convert.IsDBNull(dataRow["Photo"]))
                        {
                            dataRow["Base64Photo"] = Convert.ToBase64String((byte[])dataRow["Photo"]);
                        }
                    }
                }
            }
            string msg = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
Beispiel #24
0
        public void SaveRightNodeItem()
        {
            int    num     = 0;
            int    @int    = base.GetInt("type", 0);
            int    num2    = base.GetInt("txtRightID", 0);
            int    num3    = base.GetInt("txtCurrentLevel", 0);
            string @string = base.GetString("txtRightName");
            string string2 = base.GetString("txtRightCode");
            int    value   = base.GetInt("txtParentRightID", 0);
            int    int2    = base.GetInt("txtDispOrder", 0);
            int    int3    = base.GetInt("IsLockedRight", 0);

            switch (@int)
            {
            case 1:
                num3  = 1;
                value = 0;
                num2  = 0;
                break;

            case 2:
                num3++;
                value = num2;
                num2  = 0;
                break;

            case 3:
                break;

            default:
                num = -2;
                break;
            }
            if (num >= 0)
            {
                PEIS.Model.SYSRight sysRight = new PEIS.Model.SYSRight();
                sysRight.RightID    = num2;
                sysRight.RightLevel = new int?(num3);
                sysRight.RightName  = Input.URLDecode(@string);
                sysRight.RightCode  = Input.URLDecode(string2);
                sysRight.DispOrder  = int2;
                sysRight.Is_Locked  = int3;
                sysRight.OperatorID = new int?(this.LoginUserModel.UserID);
                sysRight.CreateDate = DateTime.Now;
                sysRight.ParentID   = new int?(value);
                SqlConditionInfo[] conditions = new SqlConditionInfo[]
                {
                    new SqlConditionInfo("@RightCode", sysRight.RightCode, TypeCode.String)
                };
                string querySqlCode = "QueryRightCodeInfo_Param";
                try
                {
                    DataSet dataSet = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                    int     count   = dataSet.Tables[0].Rows.Count;
                    switch (@int)
                    {
                    case 1:
                    case 2:
                        if (count > 0)
                        {
                            num = -1;
                        }
                        else
                        {
                            num = PEIS.BLL.SYSRight.Instance.Add(sysRight);
                            if (num > 0)
                            {
                                Log4J.Instance.Info(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",新增权限 权限名称:",
                                    sysRight.RightName,
                                    ",ID:",
                                    num,
                                    ",权限值:",
                                    sysRight.RightCode
                                }));
                            }
                            else
                            {
                                Log4J.Instance.Error(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",新增权限失败 权限名称:",
                                    sysRight.RightName,
                                    ",ID:",
                                    num,
                                    ",权限值:",
                                    sysRight.RightCode
                                }));
                            }
                        }
                        break;

                    case 3:
                        if (count > 0 && int.Parse(dataSet.Tables[0].Rows[0][0].ToString()) != sysRight.RightID)
                        {
                            num = -1;
                        }
                        else
                        {
                            num = (PEIS.BLL.SYSRight.Instance.Update(sysRight) ? 1 : 0);
                            if (num > 0)
                            {
                                Log4J.Instance.Info(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",修改权限 权限名称:",
                                    sysRight.RightName,
                                    ",ID:",
                                    sysRight.RightID,
                                    ",权限值:",
                                    sysRight.RightCode
                                }));
                            }
                            else
                            {
                                Log4J.Instance.Error(string.Concat(new object[]
                                {
                                    Public.GetClientIP(),
                                    ",",
                                    this.LoginUserModel.UserName,
                                    ",修改权限失败 权限名称:",
                                    sysRight.RightName,
                                    ",ID:",
                                    sysRight.RightID,
                                    ",权限值:",
                                    sysRight.RightCode
                                }));
                            }
                        }
                        break;

                    default:
                        num = -2;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    num = 0;
                }
            }
            this.OutPutMessage(num.ToString());
        }
Beispiel #25
0
        public virtual DataTable GetPage(string pageCode, int pageIndex, int pageSize, out int recordCount, out int pageCount, params SqlConditionInfo[] conditions)
        {
            string    text  = string.Empty;
            string    text2 = string.Empty;
            string    text3 = string.Empty;
            string    text4 = string.Empty;
            DataTable result;

            try
            {
                string[] sqlSentence = this.GetSqlSentence(pageCode);
                text   = sqlSentence[0];
                text2  = sqlSentence[1];
                text3  = sqlSentence[2];
                text4  = sqlSentence[3];
                text3 += " as A where 1=1 ";
                if (conditions != null)
                {
                    for (int i = 0; i < conditions.Length; i++)
                    {
                        SqlConditionInfo sqlConditionInfo = conditions[i];
                        if (sqlConditionInfo != null)
                        {
                            string text5 = sqlConditionInfo.ParamValue.ToString();
                            string text6 = sqlConditionInfo.ParamName;
                            if (sqlConditionInfo.IsSelf)
                            {
                                text3 = text3.Replace(text6, sqlConditionInfo.ParamName.Replace("@", string.Empty));
                            }
                            if (!string.IsNullOrEmpty(text5) && !(text5 == "-1"))
                            {
                                if (text6.IndexOf("@") == -1)
                                {
                                    text6 = "@" + text6;
                                }
                                if (sqlConditionInfo.Place != 2)
                                {
                                    text3 += Util.GetConvertParam2Where(sqlConditionInfo);
                                }
                                text3 = text3.Replace(text6, Util.GetStr(sqlConditionInfo));
                                text4 = text4.Replace(sqlConditionInfo.ParamName, sqlConditionInfo.ParamValue.ToString());
                                text2 = text2.Replace(text6, Util.GetStr(sqlConditionInfo));
                            }
                        }
                    }
                }
                result = Pagination.ProcPage(text2, text3, text, text4, pageIndex, pageSize, out recordCount, out pageCount);
            }
            catch (SqlException ex)
            {
                Log4J.Instance.Error(string.Concat(new object[]
                {
                    "通用查询语句(分页) Exception:",
                    ex.Message,
                    " AllFields:",
                    Secret.AES.Encrypt(text2),
                    ", TablesAndWhere:",
                    Secret.AES.Encrypt(text3),
                    ", IndexField:",
                    text,
                    ", pageIndex:",
                    pageIndex,
                    ", pageSize:",
                    pageSize
                }));
                throw ex;
            }
            catch (Exception ex2)
            {
                Log4J.Instance.Error(string.Concat(new object[]
                {
                    "通用查询语句(分页) Exception:",
                    ex2.Message,
                    " AllFields:",
                    Secret.AES.Encrypt(text2),
                    ", TablesAndWhere:",
                    Secret.AES.Encrypt(text3),
                    ", IndexField:",
                    text,
                    ", pageIndex:",
                    pageIndex,
                    ", pageSize:",
                    pageSize
                }));
                throw new Exception("用于分页的SQL语句无效," + ex2.Message);
            }
            return(result);
        }
Beispiel #26
0
        public static string GetConvertParam2Where(SqlConditionInfo con)
        {
            string text = string.Empty;

            if (con.Blur == 1 || con.Blur == 2 || con.Blur == 3)
            {
                text = string.Concat(new string[]
                {
                    text,
                    " and ",
                    con.ParamName.Replace("@", ""),
                    " like ",
                    con.ParamName
                });
            }
            else if (!string.IsNullOrEmpty(con.ParamOper))
            {
                if (con.ParamType == TypeCode.DateTime)
                {
                    text = string.Concat(new string[]
                    {
                        text,
                        " and datediff( day,'",
                        con.ParamValue.ToString().Replace("上午", "").Replace("下午", ""),
                        "',",
                        con.ParamName.Replace("@", ""),
                        " ) ",
                        con.ParamOper,
                        " 0 "
                    });
                }
                else if (con.ParamType == TypeCode.Decimal || con.ParamType == TypeCode.Double || con.ParamType == TypeCode.Int16 || con.ParamType == TypeCode.Int32 || con.ParamType == TypeCode.Int64 || con.ParamType == TypeCode.UInt16 || con.ParamType == TypeCode.UInt32 || con.ParamType == TypeCode.UInt64)
                {
                    text = string.Concat(new string[]
                    {
                        text,
                        " and ",
                        con.ParamName.Replace("@", ""),
                        con.ParamOper,
                        con.ParamName
                    });
                }
                else
                {
                    text = string.Concat(new string[]
                    {
                        text,
                        " and ",
                        con.ParamName.Replace("@", ""),
                        " = ",
                        con.ParamName
                    });
                }
            }
            else
            {
                text = string.Concat(new string[]
                {
                    text,
                    " and ",
                    con.ParamName.Replace("@", ""),
                    " = ",
                    con.ParamName
                });
            }
            return(text);
        }
        public void PrintReport()
        {
            int       @int       = base.GetInt("containCheck", 0);
            string    text       = base.GetString("ID_Team").Trim().ToLower();
            string    a          = base.GetString("SearchType").Trim().ToLower();
            string    text2      = base.GetString("ID_Customer").Trim();
            string    text3      = base.GetString("modelName").Trim().ToLower();
            int       int2       = base.GetInt("pageIndex", 1);
            int       int3       = base.GetInt("pageSize", 10);
            int       totalCount = 0;
            int       num        = 0;
            string    paramvalue = DateTime.Now.AddDays(-15.0).ToString("yyyy-MM-dd 00:00:01");
            DataTable dt         = null;

            if (a == "0")
            {
                SqlConditionInfo[] array = new SqlConditionInfo[3];
                string             pageCode;
                if (@int == 1)
                {
                    pageCode = "CustomerReportPrintInfoPagesParamNoCheck";
                }
                else
                {
                    pageCode = "CustomerReportPrintInfoPagesParam";
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    array[0]      = new SqlConditionInfo("@ID_Customer", text2, TypeCode.Int32);
                    array[0].Blur = 4;
                }
                else
                {
                    array[2]           = new SqlConditionInfo("@CheckedDate", paramvalue, TypeCode.DateTime);
                    array[2].ParamOper = ">=";
                }
                array[1]       = new SqlConditionInfo("@SecurityLevel", this.SecurityLevel, TypeCode.Int32);
                array[1].Place = 2;
                dt             = CommonReport.Instance.GetPage(pageCode, int2, int3, out totalCount, out num, array);
            }
            else if (a == "1")
            {
                string             pageCode = "CustomerReportPrintSelfInfoPagesParam";
                SqlConditionInfo[] array    = new SqlConditionInfo[3];
                if (!string.IsNullOrEmpty(text2))
                {
                    array[0]      = new SqlConditionInfo("@ID_Customer", text2, TypeCode.Int32);
                    array[0].Blur = 4;
                }
                else
                {
                    array[2]           = new SqlConditionInfo("@CheckedDate", paramvalue, TypeCode.DateTime);
                    array[2].ParamOper = ">=";
                }
                array[1]       = new SqlConditionInfo("@SecurityLevel", this.SecurityLevel, TypeCode.Int32);
                array[1].Place = 2;
                dt             = CommonReport.Instance.GetPage(pageCode, int2, int3, out totalCount, out num, array);
            }
            else if (a == "2")
            {
                string             pageCode = "CustomerReportPrintTeamInfoPagesParam";
                SqlConditionInfo[] array    = new SqlConditionInfo[3];
                if (!string.IsNullOrEmpty(text2))
                {
                    array[0]      = new SqlConditionInfo("@ID_Customer", text2, TypeCode.Int32);
                    array[0].Blur = 4;
                }
                else
                {
                    if (text != "-1")
                    {
                        array[0]      = new SqlConditionInfo("@ID_Team", text, TypeCode.Int32);
                        array[0].Blur = 4;
                    }
                    array[2]           = new SqlConditionInfo("@CheckedDate", paramvalue, TypeCode.DateTime);
                    array[2].ParamOper = ">=";
                }
                array[1]       = new SqlConditionInfo("@SecurityLevel", this.SecurityLevel, TypeCode.Int32);
                array[1].Place = 2;
                dt             = CommonReport.Instance.GetPage(pageCode, int2, int3, out totalCount, out num, array);
            }
            string msg = JsonHelperFont.Instance.DataTableToJSON(dt, totalCount);

            this.OutPutMessage(msg);
        }
        public void GetCustomerSecurityLevelList()
        {
            int    @int       = base.GetInt("OperateLevel", -1);
            int    int2       = base.GetInt("TeamID", -1);
            int    int3       = base.GetInt("TeamTaskID", -1);
            int    int4       = base.GetInt("SecurityLevel", -1);
            string text       = base.GetString("ID_Customer").Trim().ToLower();
            string text2      = Input.URLDecode(base.GetString("CustomerName").Trim().ToLower());
            string text3      = base.GetString("modelName").Trim().ToLower();
            int    int5       = base.GetInt("pageIndex", 1);
            int    int6       = base.GetInt("pageSize", 10);
            string text4      = base.Server.HtmlDecode(base.GetString("BeginExamDate"));
            string text5      = base.Server.HtmlDecode(base.GetString("EndExamDate"));
            int    totalCount = 0;
            int    num        = 0;

            if (!string.IsNullOrEmpty(text4))
            {
                text4 += " 00:00:00";
            }
            if (!string.IsNullOrEmpty(text5))
            {
                text5 += " 23:59:59";
            }
            string pageCode = "QueryCustomerSecurityLevelListInfoPagesParam";

            SqlConditionInfo[] array = new SqlConditionInfo[6];
            if (!string.IsNullOrEmpty(text))
            {
                array[2] = new SqlConditionInfo("@ID_Customer", text, TypeCode.Int64);
            }
            else
            {
                if (int2 != -1)
                {
                    array[0] = new SqlConditionInfo("@ID_Team", int2, TypeCode.Int32);
                }
                if (int3 != -1)
                {
                    array[1] = new SqlConditionInfo("@ID_TeamTask", int3, TypeCode.Int32);
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    array[3]       = new SqlConditionInfo("@CustomerName", text2, TypeCode.String);
                    array[3].Blur  = 3;
                    array[3].Place = 3;
                }
                if (int4 != -1)
                {
                    array[4] = new SqlConditionInfo("@SecurityLevel", int4, TypeCode.Int64);
                }
                else
                {
                    array[4]           = new SqlConditionInfo("@SecurityLevel", @int, TypeCode.Int64);
                    array[4].ParamOper = "<=";
                }
            }
            DataTable page = CommonRegiste.Instance.GetPage(pageCode, int5, int6, out totalCount, out num, array);
            string    msg  = JsonHelperFont.Instance.DataTableToJSON(page, totalCount);

            this.OutPutMessage(msg);
        }
Beispiel #29
0
        public void DeleteRoleNodeItem()
        {
            int @int = base.GetInt("txtRoleID", 0);
            int num  = 0;

            SqlConditionInfo[] conditions = new SqlConditionInfo[]
            {
                new SqlConditionInfo("@ID_Role", @int, TypeCode.Int32)
            };
            string querySqlCode = "QueryRoleUsedCount_Param";

            try
            {
                DataSet dataSet = CommonRight.Instance.ExcuteQuerySql(querySqlCode, conditions);
                num = int.Parse(dataSet.Tables[0].Rows[0][0].ToString());
            }
            catch (Exception ex)
            {
                Log4J.Instance.Error(string.Concat(new string[]
                {
                    Public.GetClientIP(),
                    ",",
                    this.LoginUserModel.UserName,
                    ",删除角色 错误信息:",
                    ex.Message
                }));
            }
            int num2;

            if (num > 0)
            {
                num2 = -1;
            }
            else
            {
                PEIS.Model.SysRole model = PEIS.BLL.SysRole.Instance.GetModel(@int);
                if (model.Is_DefaultRole == 1)
                {
                    num2 = -2;
                }
                else
                {
                    num2 = CommonRight.Instance.DeleteRole(@int);
                    if (num2 > 0)
                    {
                        Log4J.Instance.Info(string.Concat(new object[]
                        {
                            Public.GetClientIP(),
                            ",",
                            this.LoginUserModel.UserName,
                            ",删除角色 ID_Role:",
                            model.RoleID
                        }));
                    }
                    else
                    {
                        Log4J.Instance.Error(string.Concat(new object[]
                        {
                            Public.GetClientIP(),
                            ",",
                            this.LoginUserModel.UserName,
                            ",删除角色失败 ID_Role:",
                            model.RoleID
                        }));
                    }
                }
            }
            this.OutPutMessage(num2.ToString());
        }
Beispiel #30
0
        public virtual DataSet ExcuteQuerySql(string QuerySqlCode, params SqlConditionInfo[] conditions)
        {
            int     num  = 0;
            string  text = string.Empty;
            DataSet result;

            try
            {
                string[] sqlSentence = this.GetSqlSentence(QuerySqlCode);
                if (sqlSentence.Length > 0)
                {
                    text = sqlSentence[0].ToString();
                }
                if (!string.IsNullOrEmpty(text) && conditions != null)
                {
                    for (int i = 0; i < conditions.Length; i++)
                    {
                        SqlConditionInfo sqlConditionInfo = conditions[i];
                        if (sqlConditionInfo != null)
                        {
                            string text2 = sqlConditionInfo.ParamValue.ToString();
                            if (!string.IsNullOrEmpty(text2))
                            {
                                string text3 = sqlConditionInfo.ParamName;
                                if (text3.IndexOf("@") == -1)
                                {
                                    text3 = "@" + text3;
                                }
                                if (text3 == "@CustomerExamState")
                                {
                                    try
                                    {
                                        num = int.Parse(text2);
                                    }
                                    catch (Exception var_6_DB)
                                    {
                                        num = 0;
                                    }
                                }
                                text = text.Replace(text3, Util.GetStr(sqlConditionInfo));
                            }
                        }
                    }
                }
                if (num > 0)
                {
                    string connectionString;
                    if (num == 1)
                    {
                        connectionString = PubConstant.GetConnectionString("ToOffLineConnectionString");
                    }
                    else
                    {
                        connectionString = PubConstant.GetConnectionString("FYH_HisFile" + (num - 1).ToString().PadLeft(3, '0'));
                    }
                    result = DbHelperSQL.Query(connectionString, text);
                    return(result);
                }
                result = DbHelperSQL.Query(text);
                return(result);
            }
            catch (Exception ex)
            {
                Log4J.Instance.Error("通用查询语句(不分页) Exception:" + ex.Message + " Sql:" + Secret.AES.Encrypt(text));
            }
            result = null;
            return(result);
        }