Exemple #1
0
 public UserModel Login(string struser)
 {
     UserModel model;
     UserModel model2 = new UserDal();
     DB_OPT dbo = new DB_OPT();
     try
     {
         dbo.Open();
         model2.UserName = struser;
         model2.Login(dbo);
         ConfigurationModel model3 = new ConfigurationDal().GetModel(dbo);
         if (model3 != null)
         {
             HttpContext.Current.Response.Cookies["ischangelist"].Value = model3.ISCHANGELIST;
             HttpContext.Current.Session["common"] = model3;
             if (model3.ErrMessPath != "")
             {
                 ExceptionLog.ExceptionLog log = new ExceptionLog.ExceptionLog {
                     LogFilePath = model3.ErrMessPath
                 };
             }
         }
         model = model2;
     }
     catch (Exception exception)
     {
         throw exception;
     }
     finally
     {
         dbo.Close();
     }
     return model;
 }
 public void getPageSize()
 {
     try
     {
         this.dbo = new DB_OPT();
         this.cfd = new ConfigurationDal();
         this.dbo.Open();
         DataSet list = this.cfd.GetList("", this.dbo);
         if ((list != null) && (list.Tables[0].Rows.Count > 0))
         {
             this.PageNavigator1.PageSize = int.Parse(list.Tables[0].Rows[0]["PageSizeOne"].ToString());
             this.PageSize = int.Parse(list.Tables[0].Rows[0]["PageSizeOne"].ToString());
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "getPageSize()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage(" 获取数据失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Master.LBTitle = "乡镇财政资金监管信息系统 - 系统配置";
     if (base.Request["strTitle"] != null)
     {
         this.txttitle.Value = base.Server.UrlDecode(base.Request["strTitle"].ToString().Trim());
     }
     this.Master.strTitle = this.txttitle.Value;
     this.Master.ButtonsPushDown = new ButtonsHandler(this.Buttons);
     if (!this.Page.IsPostBack)
     {
         if (this.Session["User"] == null)
         {
             Const.GoLoginPath_Open(this.Page);
         }
         else
         {
             string userName = ((UserModel)this.Session["User"]).UserName;
             string power = ((UserModel)this.Session["User"]).Power;
             string companyPower = ((UserModel)this.Session["User"]).CompanyPower;
             ButtonsModel model = new ButtonsModel(userName);
             if (PowerClass.IfHasPower(userName, power, PowerNum.SystemSet))
             {
                 model.IfSave = true;
                 model.IfAdd = false;
                 model.IfUpdate = false;
                 model.IfDelete = false;
                 model.IfLook = false;
                 model.IfSearch = false;
                 model.IfRefresh = true;
                 model.IfHuiZong = false;
                 model.IfPutOut = false;
                 model.IfSet = false;
                 model.IfExit = true;
                 this.Master.btModel = model;
                 try
                 {
                     try
                     {
                         this.dbo = new DB_OPT();
                         this.dbo.Open();
                         this.cfd = new ConfigurationDal();
                         ConfigurationModel model2 = this.cfd.GetModel(this.dbo);
                         if (model2 != null)
                         {
                             this.txtMenuNodeName.Text = model2.MENUNODENAME.ToString();
                             this.txtMenuNodeValue.Text = model2.MENUNODEVALUE.ToString();
                             this.txtPageSizeOne.Text = model2.PAGESIZEONE.ToString();
                             this.txtPageSizeTwo.Text = model2.PAGESIZETWO.ToString();
                             this.txtServiceName.Text = model2.SERVICENAME.ToString();
                             this.txtUserName.Text = model2.USERNAME.ToString();
                             this.txtServiceIP.Text = model2.SERVICEIP.ToString();
                             this.FileErrMessPath.Text = model2.ErrMessPath.ToString();
                             this.rbtifOpenExceptionLog.SelectedValue = model2.IFOPENEXCEPTIONLOG.ToString();
                             this.rbtifOpenOpLog.SelectedValue = model2.IFOPENOPLOG.ToString();
                             TB_QUOTA_Bll bll = new TB_QUOTA_Bll();
                             this.db_quota_fileIsShow.SelectedValue = bll.tFileIsShow("ZBOper.aspx", "tr_wjzl").ToString();
                         }
                     }
                     catch (Exception exception)
                     {
                         this.el = new ExceptionLog.ExceptionLog();
                         this.el.ErrClassName = base.GetType().ToString();
                         this.el.ErrMessage = exception.Message.ToString();
                         this.el.ErrMethod = "Page_Load()";
                         this.el.WriteExceptionLog(true);
                         Const.OpenErrorPage(" 获取数据失败,请联系管理员!", this.Page);
                     }
                     return;
                 }
                 finally
                 {
                     if (this.dbo != null)
                     {
                         this.dbo.Close();
                     }
                 }
             }
             Const.SorryForPower(this.Page);
         }
     }
 }
 private void AddConfing()
 {
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         if (((this.txtUserName.Text.Trim() == "") || (this.txtServiceName.Text.Trim() == "")) || ((this.txtPassWord.Text.Trim() == "") || (this.txtAginPD.Text.Trim() == "")))
         {
             Const.ShowMessage("带*的数据必须填写!", this.Page);
         }
         else
         {
             this.cfd = new ConfigurationDal();
             this.model = new ConfigurationModel();
             this.model.SERVICEIP = this.txtServiceIP.Text.Trim();
             this.model.IFOPENEXCEPTIONLOG = this.rbtifOpenExceptionLog.SelectedItem.Value;
             this.model.IFOPENOPLOG = this.rbtifOpenOpLog.SelectedItem.Value;
             this.model.MENUNODENAME = this.txtMenuNodeName.Text.Trim();
             this.model.MENUNODEVALUE = this.txtMenuNodeValue.Text.Trim();
             if (this.txtPageSizeOne.Text.Trim() != "")
             {
                 this.model.PAGESIZEONE = new int?(int.Parse(this.txtPageSizeOne.Text.Trim()));
             }
             if (this.txtPageSizeTwo.Text.Trim() != "")
             {
                 this.model.PAGESIZETWO = new int?(int.Parse(this.txtPageSizeTwo.Text.Trim()));
             }
             if (this.txtPassWord.Text.Trim() != "")
             {
                 this.model.PASSWORD = QxRoom.QxConst.QxConst.Encrypt(this.txtPassWord.Text.Trim(), "powerich");
             }
             this.model.SERVICENAME = this.txtServiceName.Text.Trim();
             this.model.USERNAME = this.txtUserName.Text.Trim();
             this.model.ErrMessPath = this.FileErrMessPath.Text;
             new TB_QUOTA_Bll().SaveSetting("ZBOper.aspx", "tr_wjzl", this.db_quota_fileIsShow.SelectedItem.Value);
             DataSet list = new DataSet();
             list = this.cfd.GetList("", this.dbo);
             if ((list.Tables[0].Rows.Count > 0) && (list != null))
             {
                 this.cfd.Update(this.model, this.dbo);
                 if (this.cfd.Update(this.model, this.dbo) > 0)
                 {
                     PageShowText.ShowMessage("信息保存成功!", this.Page);
                 }
             }
             else if (this.cfd.Add(this.model, this.dbo) > 0)
             {
                 PageShowText.ShowMessage("信息保存成功!", this.Page);
             }
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "AddConfing()";
         this.el.WriteExceptionLog(true);
         PageShowText.OpenErrorPage(" 操作失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
Exemple #5
0
 public static TreeNode getConfigurationList()
 {
     dbo = new DB_OPT();
     cfd = new ConfigurationDal();
     DataSet list = new DataSet();
     list = cfd.GetList("", dbo);
     string text = "";
     string str2 = "";
     if ((list != null) && (list.Tables[0].Rows.Count > 0))
     {
         text = list.Tables[0].Rows[0]["MenuNodeName"].ToString();
         str2 = list.Tables[0].Rows[0]["MenuNodeValue"].ToString();
         HttpContext.Current.Response.Cookies["NodeName"].Value = text;
     }
     return new TreeNode(text, str2) { SelectAction = TreeNodeSelectAction.Expand };
 }
Exemple #6
0
        public static string CreateNum(string tacheNo, out string num1, DB_OPT dbo)
        {
            cfd = new ConfigurationDal();
            DataSet list = new DataSet();
            list = cfd.GetList("", dbo);
            string str = "";
            string str2 = DateTime.Now.Month.ToString();
            string num = "";
            num1 = "";
            if ((list != null) && (list.Tables[0].Rows.Count > 0))
            {
                str = list.Tables[0].Rows[0]["STARTYEAR"].ToString();
                switch (tacheNo)
                {
                    case "01":
                        num = (int.Parse(list.Tables[0].Rows[0]["SOILGETNUM"].ToString()) + 1).ToString();
                        break;

                    case "02":
                        num = (int.Parse(list.Tables[0].Rows[0]["SOILOUTNUM"].ToString()) + 1).ToString();
                        break;

                    case "03":
                        num = (int.Parse(list.Tables[0].Rows[0]["SOILZHUANNUM"].ToString()) + 1).ToString();
                        break;

                    case "04":
                        num = (int.Parse(list.Tables[0].Rows[0]["PLANNUM"].ToString()) + 1).ToString();
                        break;

                    case "05":
                        num = (int.Parse(list.Tables[0].Rows[0]["BUILDINGNUM"].ToString()) + 1).ToString();
                        break;

                    case "06":
                        num = (int.Parse(list.Tables[0].Rows[0]["FINISHNUM"].ToString()) + 1).ToString();
                        break;

                    case "07":
                        num = (int.Parse(list.Tables[0].Rows[0]["HOUSENEWNUM"].ToString()) + 1).ToString();
                        break;

                    case "08":
                        num = (int.Parse(list.Tables[0].Rows[0]["HOUSESENNUM"].ToString()) + 1).ToString();
                        break;

                    case "09":
                        num = (int.Parse(list.Tables[0].Rows[0]["TQNUM"].ToString()) + 1).ToString();
                        break;
                }
                num1 = num;
            }
            if (DateTime.Now.Year.ToString() != str)
            {
                num = "0";
                cfd.Update(tacheNo, DateTime.Now.Year.ToString(), num, dbo);
                num = "1";
            }
            if (num.Length < 4)
            {
                num = Public.AddZero(num, 4);
            }
            if (str2.Length < 2)
            {
                str2 = Public.AddZero(str2, 2);
            }
            return (DateTime.Now.Year.ToString() + str2 + tacheNo + num);
        }
Exemple #7
0
 public static string CreateNum(out string num1, DB_OPT dbo)
 {
     cfd = new ConfigurationDal();
     DataSet list = new DataSet();
     list = cfd.GetList("", dbo);
     string str = "";
     string str2 = DateTime.Now.Month.ToString();
     string num = "";
     num1 = "";
     if ((list != null) && (list.Tables[0].Rows.Count > 0))
     {
         str = list.Tables[0].Rows[0]["STARTYEAR"].ToString();
         num1 = (int.Parse(list.Tables[0].Rows[0]["STARTNUM"].ToString()) + 1).ToString();
         num = (int.Parse(list.Tables[0].Rows[0]["STARTNUM"].ToString()) + 1).ToString();
     }
     if (DateTime.Now.Year.ToString() != str)
     {
         num = "0";
         cfd.Update(DateTime.Now.Year.ToString(), num, dbo);
         num = "1";
     }
     if (num.Length < 4)
     {
         num = Public.AddZero(num, 4);
     }
     if (str2.Length < 2)
     {
         str2 = Public.AddZero(str2, 2);
     }
     return (DateTime.Now.Year.ToString() + str2 + num);
 }