Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            if (!File.Exists(context.Request.PhysicalPath))
            {
                return;
            }
            byte[] _ImageBytes = File.ReadAllBytes(context.Request.PhysicalPath);
            if (_ImageBytes.Length >= 10000)
            {
                //文字
                if (model.watermarktype == 1)
                {
                    AddImageSignText(context, context.Request.PhysicalPath, "1", model.watermarktext, model.watermarkposition, model.watermarkimgquality, model.watermarkfont, model.watermarkfontsize);
                }//图片
                else if (model.watermarktype == 2)
                {
                    AddImageSignPic(context, context.Request.PhysicalPath, "1", model.watermarkpic, model.watermarkposition, model.watermarkimgquality, model.watermarktransparency);
                }
            }
            else
            {
                Image img = Image.FromStream(new System.IO.MemoryStream(_ImageBytes));

                ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
                ImageCodecInfo   ici    = null;
                foreach (ImageCodecInfo codec in codecs)
                {
                    if (codec.MimeType.IndexOf("jpeg") > -1)
                    {
                        ici = codec;
                    }
                }
                EncoderParameters encoderParams = new EncoderParameters();
                long[]            qualityParam  = new long[1];
                qualityParam[0] = 100;

                EncoderParameter encoderParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, qualityParam);
                encoderParams.Param[0] = encoderParam;


                context.Response.ContentType = "image/jpeg";
                //将叠加后的图片以指定的格式保存到Response的输出流中。
                if (ici != null)
                {
                    img.Save(context.Response.OutputStream, ici, encoderParams);
                }
                else
                {
                    img.Save(context.Response.OutputStream, ImageFormat.Jpeg);
                }

                img.Dispose();


                context.Response.End();
            }
        }
Пример #2
0
        //找回密碼
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            DAL.users bll   = new DAL.users();
            var       model = bll.ExistsByUsernameAndEmail(txtusername2.Value.Trim(), txtemail.Value);

            if (model.Rows.Count > 0)
            {
                var              password  = DESEncrypt.Decrypt(model.Rows[0]["password"].ToString());
                BLL.siteconfig   bllConfig = new BLL.siteconfig();
                Model.siteconfig config    = bllConfig.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));

                string body = model.Rows[0]["user_name"] + "您好,請確認您的密碼: " + password + " 請牢記您的密碼";
                // var reWrite = SendMail.Mail(site.emailfrom, site.emailusername, txtemail.Value.Trim(), "會員找回密碼操作", body, site.emailusername, site.emailpassword, site.emailstmp, "");

                var reWrite = DTMail.sendMail(config.emailstmp, config.emailfrom, config.emailpassword, config.emailusername, config.emailfrom, txtemail.Value.Trim(), "會員找回密碼操作", body);
                if (reWrite.Equals("發送失敗"))
                {
                    this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('發送郵件失敗,請重新發送');window.location.href='login.aspx?type=1'</script>");
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('發送郵件成功,請查看郵件');window.location.href='login.aspx'</script>");
                }
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('用戶名或郵箱不存在');window.location.href='login.aspx?type=1'</script>");
            }
        }
Пример #3
0
        private void setEmail(string Nom)
        {
            BLL.siteconfig   bll     = new BLL.siteconfig();
            Model.siteconfig model   = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            string           Content = "你購買的商品訂單已經生成" + "請牢記訂單號:" + Nom + "" + "!";

            DTMail.sendMail(model.emailstmp, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, UserEmail.Value, "帝光房屋", Content);
        }
Пример #4
0
        private void ShowInfo()
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            webname.Text        = model.webname;
            webcompany.Text     = model.webcompany;
            weburl.Text         = model.weburl;
            webtel.Text         = model.webtel;
            webfax.Text         = model.webfax;
            webmail.Text        = model.webmail;
            webcrod.Text        = model.webcrod;
            webtitle.Text       = model.webtitle;
            webkeyword.Text     = model.webkeyword;
            webdescription.Text = model.webdescription;
            webcopyright.Text   = model.webcopyright;
            webpath.Text        = model.webpath;
            webmanagepath.Text  = model.webmanagepath;
            webstatus.Text      = model.webstatus.ToString();
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;

            staticstatus.SelectedValue  = model.staticstatus.ToString();
            staticextension.Text        = model.staticextension;
            memberstatus.SelectedValue  = model.memberstatus.ToString();
            commentstatus.SelectedValue = model.commentstatus.ToString();
            logstatus.SelectedValue     = model.logstatus.ToString();

            emailstmp.Text     = model.emailstmp;
            emailport.Text     = model.emailport.ToString();
            emailfrom.Text     = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            attachpath.Text             = model.attachpath;
            attachextension.Text        = model.attachextension;
            attachsave.SelectedValue    = model.attachsave.ToString();
            attachfilesize.Text         = model.attachfilesize.ToString();
            attachimgsize.Text          = model.attachimgsize.ToString();
            attachimgmaxheight.Text     = model.attachimgmaxheight.ToString();
            attachimgmaxwidth.Text      = model.attachimgmaxwidth.ToString();
            Kindmaxheight.Text          = model.kindmaxheight.ToString();
            Kindmaxwidth.Text           = model.kindgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            watermarkpic.Text           = model.watermarkpic;
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.Text          = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();
        }
Пример #5
0
 private void setEmail()
 {
     if (IsUserLogin())
     {
         Model.users      modelUser = HttpContext.Current.Session[DTKeys.SESSION_USER_INFO] as Model.users;
         BLL.siteconfig   bll       = new BLL.siteconfig();
         Model.siteconfig model     = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
         DTMail.sendMail(model.emailstmp, model.emailport, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, modelUser.email, "帝光房屋精品物件購買成功通知", "恭喜您購買成功");
     }
 }
Пример #6
0
        private void ShowInfo()
        {
            BLL.siteconfig bll = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            webname.Text = model.webname;
            webcompany.Text = model.webcompany;
            weburl.Text = model.weburl;
            webtel.Text = model.webtel;
            webfax.Text = model.webfax;
            webmail.Text = model.webmail;
            webcrod.Text = model.webcrod;
            webtitle.Text = model.webtitle;
            webkeyword.Text = model.webkeyword;
            webdescription.Text = model.webdescription;
            webcopyright.Text = model.webcopyright;
            webpath.Text = model.webpath;
            webmanagepath.Text = model.webmanagepath;
            webstatus.Text = model.webstatus.ToString();
            webclosereason.Text = model.webclosereason;
            webcountcode.Text = model.webcountcode;

            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text = model.staticextension;
            memberstatus.SelectedValue = model.memberstatus.ToString();
            commentstatus.SelectedValue = model.commentstatus.ToString();
            logstatus.SelectedValue = model.logstatus.ToString();

            emailstmp.Text = model.emailstmp;
            emailport.Text = model.emailport.ToString();
            emailfrom.Text = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            attachpath.Text = model.attachpath;
            attachextension.Text = model.attachextension;
            attachsave.SelectedValue = model.attachsave.ToString();
            attachfilesize.Text = model.attachfilesize.ToString();
            attachimgsize.Text = model.attachimgsize.ToString();
            attachimgmaxheight.Text = model.attachimgmaxheight.ToString();
            attachimgmaxwidth.Text = model.attachimgmaxwidth.ToString();
            thumbnailheight.Text = model.thumbnailheight.ToString();
            thumbnailwidth.Text = model.thumbnailwidth.ToString();
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text = model.watermarkposition.ToString();
            watermarkimgquality.Text = model.watermarkimgquality.ToString();
            watermarkpic.Text = model.watermarkpic;
            watermarktransparency.Text = model.watermarktransparency.ToString();
            watermarktext.Text = model.watermarktext;
            watermarkfont.Text = model.watermarkfont;
            watermarkfontsize.Text = model.watermarkfontsize.ToString();
        }
Пример #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userPwd = TextBox1.Text.Trim();

            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));

            if (model.weburl == userPwd)
            {
                Utils.WriteCookie("UserCheckPwd", userPwd, 60);
                Response.Redirect(ReferUrl);
            }
            else
            {
                JscriptMsg("會員管理密碼錯誤!", "RePw.aspx", "Success");
            }
        }
Пример #8
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["name"]))
     {
         string           UserName = HttpContext.Current.Request.QueryString["name"];
         BLL.siteconfig   bll      = new BLL.siteconfig();
         Model.siteconfig model    = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
         if (model.weburl == DESEncrypt.Encrypt(UserName))
         {
             context.Response.Write(1);
         }
         else
         {
             context.Response.Write("0");
         }
     }
 }
Пример #9
0
        private void setEmail(int UserID)
        {
            //生成隨機碼
            string strcode = Utils.GetCheckCode(20);

            //獲得郵件內容
            Model.mail_template mailModel = new BLL.mail_template().GetModel("regverify");
            BLL.siteconfig      bll       = new BLL.siteconfig();
            Model.siteconfig    model     = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            string titletxt = mailModel.maill_title;
            string bodytxt  = mailModel.content;

            titletxt = titletxt.Replace("{webname}", model.webname);
            titletxt = titletxt.Replace("{username}", DTRequest.GetFormString("ctl00$ContentPlaceHolder1$txtusername"));
            bodytxt  = bodytxt.Replace("{webname}", model.webname);
            bodytxt  = bodytxt.Replace("{username}", DTRequest.GetFormString("ctl00$ContentPlaceHolder1$txtusername"));
            bodytxt  = bodytxt.Replace("{linkurl}", "<a href=" + "http://" + Utils.GetHomeUrl() + "/RegPay.aspx?uId=" + UserID + ">請點擊連接激活帳戶" + "</a>"); //此處需要修改
            DTMail.sendMail(model.emailstmp, model.emailport, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, DTRequest.GetFormString("ctl00$ContentPlaceHolder1$txtemall"), "帝光房屋會員註冊成功通知", bodytxt);
        }
Пример #10
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig bll = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();
            try
            {
                model.webname = webname.Text;
                model.weburl = weburl.Text;
                model.webcompany = webcompany.Text;
                model.webaddress = webaddress.Text;
                model.webtel = webtel.Text;
                model.webfax = webfax.Text;
                model.webmail = webmail.Text;
                model.webcrod = webcrod.Text;

                model.webpath = webpath.Text;
                model.webmanagepath = webmanagepath.Text;
                model.staticstatus = Utils.StrToInt(staticstatus.SelectedValue, 0);
                model.staticextension = staticextension.Text;
                if (memberstatus.Checked == true)
                {
                    model.memberstatus = 1;
                }
                else
                {
                    model.memberstatus = 0;
                }
                if (commentstatus.Checked == true)
                {
                    model.commentstatus = 1;
                }
                else
                {
                    model.commentstatus = 0;
                }
                if (logstatus.Checked == true)
                {
                    model.logstatus = 1;
                }
                else
                {
                    model.logstatus = 0;
                }
                if (webstatus.Checked == true)
                {
                    model.webstatus = 1;
                }
                else
                {
                    model.webstatus = 0;
                }
                model.webclosereason = webclosereason.Text;
                model.webcountcode = webcountcode.Text;

                model.smsapiurl = smsapiurl.Text;
                model.smsusername = smsusername.Text;
                //判断密码是否更改
                if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword)
                {
                    model.smspassword = Utils.MD5(smspassword.Text.Trim());
                }

                model.emailsmtp = emailsmtp.Text;
                if (emailssl.Checked == true)
                {
                    model.emailssl = 1;
                }
                else
                {
                    model.emailssl = 0;
                }
                model.emailport = Utils.StrToInt(emailport.Text.Trim(), 25);
                model.emailfrom = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.filepath = filepath.Text;
                model.filesave = Utils.StrToInt(filesave.SelectedValue, 2);
                model.fileremote = Utils.StrToInt(fileremote.SelectedValue, 0);
                model.fileextension = fileextension.Text;
                model.videoextension = videoextension.Text;
                model.attachsize = Utils.StrToInt(attachsize.Text.Trim(), 0);
                model.videosize = Utils.StrToInt(videosize.Text.Trim(), 0);
                model.imgsize = Utils.StrToInt(imgsize.Text.Trim(), 0);
                model.imgmaxheight = Utils.StrToInt(imgmaxheight.Text.Trim(), 0);
                model.imgmaxwidth = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0);
                model.thumbnailheight = Utils.StrToInt(thumbnailheight.Text.Trim(), 0);
                model.thumbnailwidth = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0);
                model.thumbnailmode = thumbnailmode.SelectedValue;
                model.watermarktype = Utils.StrToInt(watermarktype.SelectedValue, 0);
                model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9);
                model.watermarkimgquality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80);
                model.watermarkpic = watermarkpic.Text;
                model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5);
                model.watermarktext = watermarktext.Text;
                model.watermarkfont = watermarkfont.Text;
                model.watermarkfontsize = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12);

                bll.saveConifg(model);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志
                JscriptMsg("修改系统配置成功!", "sys_config.aspx");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查文件夹权限!", "");
            }
        }
Пример #11
0
 private void setEmail()
 {
     BLL.siteconfig   bll   = new BLL.siteconfig();
     Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
     DTMail.sendMail(model.emailstmp, model.emailport, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, DTRequest.GetFormString("ctl00$ContentPlaceHolder1$txtemall"), "帝光房屋會員註冊成功通知", "恭喜您成功註冊我們的會員");
 }
Пример #12
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();
            try
            {
                model.webname    = webname.Text;
                model.weburl     = weburl.Text;
                model.webcompany = webcompany.Text;
                model.webaddress = webaddress.Text;
                model.webtel     = webtel.Text;
                model.webfax     = webfax.Text;
                model.webmail    = webmail.Text;
                model.webcrod    = webcrod.Text;

                model.webpath = webpath.Text;
                string managepath = webmanagepath.Text;
                if (model.webmanagepath != managepath)
                {
                    new BLL.navigation().updateicon(model.webmanagepath, managepath);
                    model.webmanagepath = managepath;
                }
                model.staticstatus    = Utils.StrToInt(staticstatus.SelectedValue, 0);
                model.staticextension = staticextension.Text;
                if (memberstatus.Checked == true)
                {
                    model.memberstatus = 1;
                }
                else
                {
                    model.memberstatus = 0;
                }
                if (commentstatus.Checked == true)
                {
                    model.commentstatus = 1;
                }
                else
                {
                    model.commentstatus = 0;
                }
                if (logstatus.Checked == true)
                {
                    model.logstatus = 1;
                }
                else
                {
                    model.logstatus = 0;
                }
                if (webstatus.Checked == true)
                {
                    model.webstatus = 1;
                }
                else
                {
                    model.webstatus = 0;
                }
                model.webclosereason = webclosereason.Text;
                model.webcountcode   = webcountcode.Text;

                model.smsapiurl   = smsapiurl.Text;
                model.smsusername = smsusername.Text;
                //判断密码是否更改
                if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword)
                {
                    model.smspassword = smspassword.Text.Trim();
                }
                model.smssubmit      = smssubmit.Text;
                model.smssendpara    = smssendpara.Text.Trim();
                model.smssign        = Utils.StrToInt(smssign.SelectedValue, 0);
                model.smssigntxt     = smssigntxt.Text.Trim();
                model.smssendanswer  = Utils.StrToInt(smssendanswer.SelectedValue, 0);
                model.smssendcode    = smssendcode.Text.Trim();
                model.smssendlable   = smssendlable.Text.Trim();
                model.smsmark        = smsmark.Text.Trim();
                model.smssendcount   = Utils.StrToInt(smssendcount.Text.Trim(), 10);
                model.smsqueryapiurl = smsqueryapiurl.Text.Trim();
                model.smsquerypara   = smsquerypara.Text.Trim();
                model.smsqueryanswer = Utils.StrToInt(smsqueryanswer.SelectedValue, 0);
                model.smsquerycode   = smsquerycode.Text.Trim();
                model.smsqueryformat = smsqueryformat.Text.Trim();
                model.smserrorcode   = smserrorcode.Text.Trim();

                model.emailsmtp = emailsmtp.Text;
                if (emailssl.Checked == true)
                {
                    model.emailssl = 1;
                }
                else
                {
                    model.emailssl = 0;
                }
                model.emailport     = Utils.StrToInt(emailport.Text.Trim(), 25);
                model.emailfrom     = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.filepath          = filepath.Text;
                model.filesave          = Utils.StrToInt(filesave.SelectedValue, 2);
                model.fileremote        = Utils.StrToInt(fileremote.SelectedValue, 0);
                model.imgextension      = imgextension.Text.Trim();
                model.fileextension     = fileextension.Text;
                model.videoextension    = videoextension.Text;
                model.attachsize        = Utils.StrToInt(attachsize.Text.Trim(), 0);
                model.videosize         = Utils.StrToInt(videosize.Text.Trim(), 0);
                model.imgsize           = Utils.StrToInt(imgsize.Text.Trim(), 0);
                model.imgmaxheight      = Utils.StrToInt(imgmaxheight.Text.Trim(), 0);
                model.imgmaxwidth       = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0);
                model.thumbnailheight   = Utils.StrToInt(thumbnailheight.Text.Trim(), 0);
                model.thumbnailwidth    = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0);
                model.thumbnailmode     = thumbnailmode.SelectedValue;
                model.watermarktype     = Utils.StrToInt(watermarktype.SelectedValue, 0);
                model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9);
                int quality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80);
                if (quality < 10)
                {
                    quality = 10;
                }
                else if (quality > 100)
                {
                    quality = 100;
                }
                model.watermarkimgquality = quality;
                //判断上传图片
                if (this.imgUpload.HasFile)
                {
                    //上传前先删除原图片
                    if (!string.IsNullOrEmpty(model.watermarkpic))
                    {
                        Utils.DeleteFile(model.watermarkpic);
                    }
                    Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                    if (upfile.status > 0)
                    {
                        model.watermarkpic = upfile.path;
                    }
                }
                else
                {
                    //判断是否需要删除原图
                    if (watermarkpic.Text.Trim() == "" && !string.IsNullOrEmpty(model.watermarkpic))
                    {
                        Utils.DeleteFile(model.watermarkpic);
                    }
                    model.watermarkpic = watermarkpic.Text.Trim();
                }
                model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5);
                model.watermarktext         = watermarktext.Text;
                model.watermarkfont         = watermarkfont.Text;
                model.watermarkfontsize     = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12);
                if (chbFomatPage.Checked == true)
                {
                    model.fomatpage = 1;
                }
                else
                {
                    model.fomatpage = 0;
                }
                if (chbPageCache.Checked == true)
                {
                    model.pagecache = 1;
                }
                else
                {
                    model.pagecache = 0;
                }

                model.cachetime = Utils.StrToInt(txtCacheTime.Text.Trim(), 30);
                model.cachefix  = txtCacheFix.Text.Trim();
                model.deltable  = Utils.StrToInt(rblDelTable.SelectedValue, 0);
                model.author    = txtAuthor.Text.Trim();
                model.source    = txtSource.Text.Trim();
                bll.saveConifg(model);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志
                JscriptMsg("修改系统配置成功!", "sys_config.aspx");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查文件夹权限!", "");
            }
        }
Пример #13
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("site_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();
            try
            {
                model.webname        = webname.Text;
                model.weburl         = weburl.Text;
                model.weblogo        = weblogo.Text;
                model.webcompany     = webcompany.Text;
                model.webaddress     = webaddress.Text;
                model.webtel         = webtel.Text;
                model.webfax         = webfax.Text;
                model.webmail        = webmail.Text;
                model.webcrod        = webcrod.Text;
                model.webtitle       = webtitle.Text;
                model.webkeyword     = webkeyword.Text;
                model.webdescription = Utils.DropHTML(webdescription.Text);
                model.webcopyright   = webcopyright.Text;

                model.webpath         = webpath.Text;
                model.webmanagepath   = webmanagepath.Text;
                model.staticstatus    = Utils.StrToInt(staticstatus.SelectedValue, 0);
                model.staticextension = staticextension.Text;
                if (mobilestatus.Checked == true)
                {
                    model.mobilestatus = 1;
                }
                else
                {
                    model.mobilestatus = 0;
                }
                model.mobiledomain = mobiledomain.Text;
                if (memberstatus.Checked == true)
                {
                    model.memberstatus = 1;
                }
                else
                {
                    model.memberstatus = 0;
                }
                if (commentstatus.Checked == true)
                {
                    model.commentstatus = 1;
                }
                else
                {
                    model.commentstatus = 0;
                }
                if (logstatus.Checked == true)
                {
                    model.logstatus = 1;
                }
                else
                {
                    model.logstatus = 0;
                }
                if (webstatus.Checked == true)
                {
                    model.webstatus = 1;
                }
                else
                {
                    model.webstatus = 0;
                }
                model.webclosereason = webclosereason.Text;
                model.webcountcode   = webcountcode.Text;

                model.smsapiurl   = smsapiurl.Text;
                model.smsusername = smsusername.Text;
                //判断密码是否更改
                if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword)
                {
                    model.smspassword = Utils.MD5(smspassword.Text.Trim());
                }

                model.emailsmtp     = emailsmtp.Text;
                model.emailport     = Utils.StrToInt(emailport.Text.Trim(), 25);
                model.emailfrom     = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text);
                }
                model.emailnickname = emailnickname.Text;

                model.filepath              = filepath.Text;
                model.filesave              = Utils.StrToInt(filesave.SelectedValue, 2);
                model.fileremote            = Utils.StrToInt(fileremote.SelectedValue, 0);
                model.fileextension         = fileextension.Text;
                model.attachsize            = Utils.StrToInt(attachsize.Text.Trim(), 0);
                model.imgsize               = Utils.StrToInt(imgsize.Text.Trim(), 0);
                model.imgmaxheight          = Utils.StrToInt(imgmaxheight.Text.Trim(), 0);
                model.imgmaxwidth           = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0);
                model.thumbnailheight       = Utils.StrToInt(thumbnailheight.Text.Trim(), 0);
                model.thumbnailwidth        = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0);
                model.watermarktype         = Utils.StrToInt(watermarktype.SelectedValue, 0);
                model.watermarkposition     = Utils.StrToInt(watermarkposition.Text.Trim(), 9);
                model.watermarkimgquality   = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80);
                model.watermarkpic          = watermarkpic.Text;
                model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5);
                model.watermarktext         = watermarktext.Text;
                model.watermarkfont         = watermarkfont.Text;
                model.watermarkfontsize     = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12);

                // 自动放款设置
                ConfigLoader.CleanCache();
                model.enableAutoRepay = enableAutoRepay.Checked ? 1 : 0;
                if (!model.systemTimerTriggerTime.Equals(txtSystemTimerTriggerTime.Text))
                {
                    Global.InitDailyTimer(TimerMsg.Type.AutoRepayTimer, txtSystemTimerTriggerTime.Text);
                }
                model.systemTimerTriggerTime = txtSystemTimerTriggerTime.Text;

                if (!model.loanerRepayTime.Equals(txtLoanerRepayTime.Text))
                {
                    Global.InitDailyTimer(TimerMsg.Type.LoanerRepayTimer, txtLoanerRepayTime.Text);
                }
                model.loanerRepayTime = txtLoanerRepayTime.Text;

                model.sendShortMsgAfterRepay      = sendShortMsgAfterRepay.Checked ? 1 : 0;
                model.sendRepayAnnounceAfterRepay = sendRepayAnnounceAfterRepay.Checked ? 1 : 0;

                bll.saveConifg(model);
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);           //更新一下域名缓存
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志
                JscriptMsg("修改系统配置成功!", "sys_config.aspx", "Success");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error");
            }
        }
Пример #14
0
        private void ShowInfo()
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text    = model.webname;
            weburl.Text     = model.weburl;
            webcompany.Text = model.webcompany;
            webaddress.Text = model.webaddress;
            webtel.Text     = model.webtel;
            webfax.Text     = model.webfax;
            webmail.Text    = model.webmail;
            webcrod.Text    = model.webcrod;

            webpath.Text               = model.webpath;
            webmanagepath.Text         = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text       = model.staticextension;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;
            smsapiurl.Text      = model.smsapiurl;
            smsusername.Text    = model.smsusername;
            if (!string.IsNullOrEmpty(model.smspassword))
            {
                smspassword.Attributes["value"] = defaultpassword;
            }
            smssubmit.Text              = model.smssubmit;
            smssendpara.Text            = model.smssendpara;
            smssign.SelectedValue       = model.smssign.ToString();
            smssigntxt.Text             = model.smssigntxt;
            smssendanswer.SelectedValue = model.smssendanswer.ToString();
            smssendcode.Text            = model.smssendcode;
            smssendlable.Text           = model.smssendlable;
            smsmark.Text                 = model.smsmark;
            smssendcount.Text            = model.smssendcount.ToString();
            smsqueryapiurl.Text          = model.smsqueryapiurl;
            smsquerypara.Text            = model.smsquerypara;
            smsqueryanswer.SelectedValue = model.smsqueryanswer.ToString();
            smsquerycode.Text            = model.smsquerycode;
            smsqueryformat.Text          = model.smsqueryformat;
            smserrorcode.Text            = model.smserrorcode;

            emailsmtp.Text = model.emailsmtp;
            if (model.emailssl == 1)
            {
                emailssl.Checked = true;
            }
            else
            {
                emailssl.Checked = false;
            }
            emailport.Text     = model.emailport.ToString();
            emailfrom.Text     = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            filepath.Text               = model.filepath;
            filesave.SelectedValue      = model.filesave.ToString();
            fileremote.SelectedValue    = model.fileremote.ToString();
            imgextension.Text           = model.imgextension;
            fileextension.Text          = model.fileextension;
            videoextension.Text         = model.videoextension;
            attachsize.Text             = model.attachsize.ToString();
            videosize.Text              = model.videosize.ToString();
            imgsize.Text                = model.imgsize.ToString();
            imgmaxheight.Text           = model.imgmaxheight.ToString();
            imgmaxwidth.Text            = model.imgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            thumbnailmode.SelectedValue = model.thumbnailmode;
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            //水印图片
            watermarkpic.Text = model.watermarkpic;
            if (!string.IsNullOrEmpty(model.watermarkpic))
            {
                ImgDiv.Visible  = true;
                ImgUrl.ImageUrl = model.watermarkpic;
            }
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();
            if (model.fomatpage == 1)
            {
                chbFomatPage.Checked = true;
            }
            if (model.pagecache == 1)
            {
                chbPageCache.Checked = true;
            }
            txtCacheTime.Text         = model.cachetime.ToString();
            txtCacheFix.Text          = model.cachefix;
            rblDelTable.SelectedValue = model.deltable.ToString();
            txtAuthor.Text            = model.author;
            txtSource.Text            = model.source;
            //输出短信数量
            SetSmsCount();
        }
Пример #15
0
        string defaultpassword = "******"; //默认显示密码

        #endregion Fields

        #region Methods

        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig bll = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            try
            {
                model.webname = webname.Text;
                model.webcompany = webcompany.Text;
                model.weburl = weburl.Text;
                model.webtel = webtel.Text;
                model.webfax = webfax.Text;
                model.webmail = webmail.Text;
                model.webcrod = webcrod.Text;
                model.webtitle = webtitle.Text;
                model.webkeyword = webkeyword.Text;
                model.webdescription = Utils.DropHTML(webdescription.Text);
                model.webcopyright = webcopyright.Text;
                model.webpath = webpath.Text;
                model.webmanagepath = webmanagepath.Text;
                model.webstatus = int.Parse(webstatus.Text.Trim());
                model.webclosereason = webclosereason.Text;
                model.webcountcode = webcountcode.Text;

                model.staticstatus = int.Parse(staticstatus.SelectedValue);
                model.staticextension = staticextension.Text;
                model.memberstatus = int.Parse(memberstatus.SelectedValue);
                model.commentstatus = int.Parse(commentstatus.SelectedValue);
                model.logstatus = int.Parse(logstatus.SelectedValue);

                model.emailstmp = emailstmp.Text;
                model.emailport = int.Parse(emailport.Text.Trim());
                model.emailfrom = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.attachpath = attachpath.Text;
                model.attachextension = attachextension.Text;
                model.attachsave = int.Parse(attachsave.SelectedValue);
                model.attachfilesize = int.Parse(attachfilesize.Text.Trim());
                model.attachimgsize = int.Parse(attachimgsize.Text.Trim());
                model.attachimgmaxheight = int.Parse(attachimgmaxheight.Text.Trim());
                model.attachimgmaxwidth = int.Parse(attachimgmaxwidth.Text.Trim());
                model.thumbnailheight = int.Parse(thumbnailheight.Text.Trim());
                model.thumbnailwidth = int.Parse(thumbnailwidth.Text.Trim());
                model.watermarktype = int.Parse(watermarktype.SelectedValue);
                model.watermarkposition = int.Parse(watermarkposition.Text.Trim());
                model.watermarkimgquality = int.Parse(watermarkimgquality.Text.Trim());
                model.watermarkpic = watermarkpic.Text;
                model.watermarktransparency = int.Parse(watermarktransparency.Text.Trim());
                model.watermarktext = watermarktext.Text;
                model.watermarkfont = watermarkfont.Text;
                model.watermarkfontsize = int.Parse(watermarkfontsize.Text.Trim());

                bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
                JscriptMsg("修改系统信息成功啦!", "sys_config.aspx", "Success");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error");
            }
        }
Пример #16
0
        private void ShowInfo()
        {
            BLL.siteconfig bll = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text = model.webname;
            weburl.Text = model.weburl;
            //weblogo.Text = model.weblogo;
            webcompany.Text = model.webcompany;
            webaddress.Text = model.webaddress;
            webtel.Text = model.webtel;
            webfax.Text = model.webfax;
            //webmail.Text = model.webmail;
            //webcrod.Text = model.webcrod;
            //webtitle.Text = model.webtitle;
            //webkeyword.Text = model.webkeyword;
            //webdescription.Text = model.webdescription;
            //webcopyright.Text = model.webcopyright;

            //webpath.Text = model.webpath;
            //webmanagepath.Text = model.webmanagepath;
            //staticstatus.SelectedValue = model.staticstatus.ToString();
            //staticextension.Text = model.staticextension;
            //if (model.memberstatus == 1)
            //{
            //    memberstatus.Checked = true;
            //}
            //else
            //{
            //    memberstatus.Checked = false;
            //}
            //if (model.commentstatus == 1)
            //{
            //    commentstatus.Checked = true;
            //}
            //else
            //{
            //    commentstatus.Checked = false;
            //}
            //if (model.logstatus == 1)
            //{
            //    logstatus.Checked = true;
            //}
            //else
            //{
            //    logstatus.Checked = false;
            //}
            //if (model.webstatus == 1)
            //{
            //    webstatus.Checked = true;
            //}
            //else
            //{
            //    webstatus.Checked = false;
            //}
            //webclosereason.Text = model.webclosereason;
            //webcountcode.Text = model.webcountcode;

            //smsusername.Text = model.smsusername;
            //if (!string.IsNullOrEmpty(model.smspassword))
            //{
            //    smspassword.Attributes["value"] = defaultpassword;
            //}
            //labSmsCount.Text = GetSmsCount(); //取得短信数量

            //emailsmtp.Text = model.emailsmtp;
            //emailport.Text = model.emailport.ToString();
            //emailfrom.Text = model.emailfrom;
            //emailusername.Text = model.emailusername;
            //if (!string.IsNullOrEmpty(model.emailpassword))
            //{
            //    emailpassword.Attributes["value"] = defaultpassword;
            //}
            //emailnickname.Text = model.emailnickname;

            //filepath.Text = model.filepath;
            //filesave.SelectedValue = model.filesave.ToString();
            //fileextension.Text = model.fileextension;
            //attachsize.Text = model.attachsize.ToString();
            //imgsize.Text = model.imgsize.ToString();
            //imgmaxheight.Text = model.imgmaxheight.ToString();
            //imgmaxwidth.Text = model.imgmaxwidth.ToString();
            //thumbnailheight.Text = model.thumbnailheight.ToString();
            //thumbnailwidth.Text = model.thumbnailwidth.ToString();
            //watermarktype.SelectedValue = model.watermarktype.ToString();
            //watermarkposition.Text = model.watermarkposition.ToString();
            //watermarkimgquality.Text = model.watermarkimgquality.ToString();
            //watermarkpic.Text = model.watermarkpic;
            //watermarktransparency.Text = model.watermarktransparency.ToString();
            //watermarktext.Text = model.watermarktext;
            //watermarkfont.SelectedValue = model.watermarkfont;
            //watermarkfontsize.Text = model.watermarkfontsize.ToString();
        }
Пример #17
0
        private void ShowInfo()
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text        = model.webname;
            weburl.Text         = model.weburl;
            weblogo.Text        = model.weblogo;
            webcompany.Text     = model.webcompany;
            webaddress.Text     = model.webaddress;
            webtel.Text         = model.webtel;
            webfax.Text         = model.webfax;
            webmail.Text        = model.webmail;
            webcrod.Text        = model.webcrod;
            webtitle.Text       = model.webtitle;
            webkeyword.Text     = model.webkeyword;
            webdescription.Text = model.webdescription;
            webcopyright.Text   = model.webcopyright;

            webpath.Text               = model.webpath;
            webmanagepath.Text         = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text       = model.staticextension;
            if (model.mobilestatus == 1)
            {
                mobilestatus.Checked = true;
            }
            else
            {
                mobilestatus.Checked = false;
            }
            mobiledomain.Text = model.mobiledomain;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;

            smsapiurl.Text   = model.smsapiurl;
            smsusername.Text = model.smsusername;
            if (!string.IsNullOrEmpty(model.smspassword))
            {
                smspassword.Attributes["value"] = defaultpassword;
            }
            labSmsCount.Text = GetSmsCount(); //取得短信数量

            emailsmtp.Text     = model.emailsmtp;
            emailport.Text     = model.emailport.ToString();
            emailfrom.Text     = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            filepath.Text               = model.filepath;
            filesave.SelectedValue      = model.filesave.ToString();
            fileremote.SelectedValue    = model.fileremote.ToString();
            fileextension.Text          = model.fileextension;
            attachsize.Text             = model.attachsize.ToString();
            imgsize.Text                = model.imgsize.ToString();
            imgmaxheight.Text           = model.imgmaxheight.ToString();
            imgmaxwidth.Text            = model.imgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            watermarkpic.Text           = model.watermarkpic;
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();

            // 自动放款设置
            enableAutoRepay.Checked             = model.enableAutoRepay == 1;
            txtSystemTimerTriggerTime.Text      = model.systemTimerTriggerTime;
            txtLoanerRepayTime.Text             = model.loanerRepayTime;
            sendShortMsgAfterRepay.Checked      = model.sendShortMsgAfterRepay == 1;
            sendRepayAnnounceAfterRepay.Checked = model.sendRepayAnnounceAfterRepay == 1;
        }
Пример #18
0
        private void ShowInfo()
        {
            BLL.siteconfig bll = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text = model.webname;
            weburl.Text = model.weburl;
            webcompany.Text = model.webcompany;
            webaddress.Text = model.webaddress;
            webtel.Text = model.webtel;
            webfax.Text = model.webfax;
            webmail.Text = model.webmail;
            webcrod.Text = model.webcrod;

            webpath.Text = model.webpath;
            webmanagepath.Text = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text = model.staticextension;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text = model.webcountcode;

            smsapiurl.Text = model.smsapiurl;
            smsusername.Text = model.smsusername;
            if (!string.IsNullOrEmpty(model.smspassword))
            {
                smspassword.Attributes["value"] = defaultpassword;
            }
            labSmsCount.Text = GetSmsCount(); //取得短信数量

            emailsmtp.Text = model.emailsmtp;
            if (model.emailssl == 1)
            {
                emailssl.Checked = true;
            }
            else
            {
                emailssl.Checked = false;
            }
            emailport.Text = model.emailport.ToString();
            emailfrom.Text = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            filepath.Text = model.filepath;
            filesave.SelectedValue = model.filesave.ToString();
            fileremote.SelectedValue = model.fileremote.ToString();
            fileextension.Text = model.fileextension;
            videoextension.Text = model.videoextension;
            attachsize.Text = model.attachsize.ToString();
            videosize.Text = model.videosize.ToString();
            imgsize.Text = model.imgsize.ToString();
            imgmaxheight.Text = model.imgmaxheight.ToString();
            imgmaxwidth.Text = model.imgmaxwidth.ToString();
            thumbnailheight.Text = model.thumbnailheight.ToString();
            thumbnailwidth.Text = model.thumbnailwidth.ToString();
            thumbnailmode.Text = model.thumbnailmode;
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text = model.watermarkposition.ToString();
            watermarkimgquality.Text = model.watermarkimgquality.ToString();
            watermarkpic.Text = model.watermarkpic;
            watermarktransparency.Text = model.watermarktransparency.ToString();
            watermarktext.Text = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text = model.watermarkfontsize.ToString();
        }
Пример #19
0
        private void ShowInfo()
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text    = model.webname;
            weburl.Text     = model.weburl;
            webcompany.Text = model.webcompany;
            webaddress.Text = model.webaddress;
            webtel.Text     = model.webtel;
            webfax.Text     = model.webfax;
            webmail.Text    = model.webmail;
            webcrod.Text    = model.webcrod;

            webpath.Text               = model.webpath;
            webmanagepath.Text         = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text       = model.staticextension;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;

            smsapiurl.Text   = model.smsapiurl;
            smsusername.Text = model.smsusername;
            if (!string.IsNullOrEmpty(model.smspassword))
            {
                smspassword.Attributes["value"] = defaultpassword;
            }
            labSmsCount.Text = GetSmsCount(); //取得短信数量

            emailsmtp.Text = model.emailsmtp;
            if (model.emailssl == 1)
            {
                emailssl.Checked = true;
            }
            else
            {
                emailssl.Checked = false;
            }
            emailport.Text     = model.emailport.ToString();
            emailfrom.Text     = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            filepath.Text               = model.filepath;
            filesave.SelectedValue      = model.filesave.ToString();
            fileremote.SelectedValue    = model.fileremote.ToString();
            fileextension.Text          = model.fileextension;
            videoextension.Text         = model.videoextension;
            attachsize.Text             = model.attachsize.ToString();
            videosize.Text              = model.videosize.ToString();
            imgsize.Text                = model.imgsize.ToString();
            imgmaxheight.Text           = model.imgmaxheight.ToString();
            imgmaxwidth.Text            = model.imgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            thumbnailmode.Text          = model.thumbnailmode;
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            watermarkpic.Text           = model.watermarkpic;
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();
        }
Пример #20
0
 private void setEmail()
 {
     BLL.siteconfig   bll   = new BLL.siteconfig();
     Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
     DTMail.sendMail(model.emailstmp, model.emailport, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, "*****@*****.**", "帝光房屋會員刊登土地新物件", "帝光房屋會員刊登土地新物件");
 }
Пример #21
0
 private void setEmail()
 {
     BLL.siteconfig   bll   = new BLL.siteconfig();
     Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
     DTMail.sendMail(model.emailstmp, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, lblEmail.Text, "帝光房屋留言回覆", txtReContent.Text);
 }
Пример #22
0
        private void ShowInfo()
        {
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();

            webname.Text        = model.webname;
            weburl.Text         = model.weburl;
            weblogo.Text        = model.weblogo;
            webcompany.Text     = model.webcompany;
            webaddress.Text     = model.webaddress;
            webtel.Text         = model.webtel;
            webfax.Text         = model.webfax;
            webmail.Text        = model.webmail;
            webcrod.Text        = model.webcrod;
            webtitle.Text       = model.webtitle;
            webkeyword.Text     = model.webkeyword;
            webdescription.Text = model.webdescription;
            webcopyright.Text   = model.webcopyright;

            webpath.Text               = model.webpath;
            webmanagepath.Text         = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text       = model.staticextension;
            if (model.mobilestatus == 1)
            {
                mobilestatus.Checked = true;
            }
            else
            {
                mobilestatus.Checked = false;
            }
            mobiledomain.Text = model.mobiledomain;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;

            //smsapiurl.Text = model.smsapiurl;
            //smsusername.Text = model.smsusername;
            //if (!string.IsNullOrEmpty(model.smspassword))
            //{
            //    smspassword.Attributes["value"] = defaultpassword;
            //}
            //smsnickname.Text = model.smsnickname;

            //emailsmtp.Text = model.emailsmtp;
            //emailport.Text = model.emailport.ToString();
            //emailfrom.Text = model.emailfrom;
            //emailusername.Text = model.emailusername;
            //if (!string.IsNullOrEmpty(model.emailpassword))
            //{
            //    emailpassword.Attributes["value"] = defaultpassword;
            //}
            //emailnickname.Text = model.emailnickname;

            filepath.Text               = model.filepath;
            filesave.SelectedValue      = model.filesave.ToString();
            fileextension.Text          = model.fileextension;
            attachsize.Text             = model.attachsize.ToString();
            imgsize.Text                = model.imgsize.ToString();
            imgmaxheight.Text           = model.imgmaxheight.ToString();
            imgmaxwidth.Text            = model.imgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            watermarkpic.Text           = model.watermarkpic;
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();
        }
Пример #23
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
            try
            {
                model.webname        = webname.Text;
                model.webcompany     = webcompany.Text;
                model.weburl         = weburl.Text;
                model.webtel         = webtel.Text;
                model.webfax         = webfax.Text;
                model.webmail        = webmail.Text;
                model.webcrod        = webcrod.Text;
                model.webtitle       = webtitle.Text;
                model.webkeyword     = webkeyword.Text;
                model.webdescription = Utils.DropHTML(webdescription.Text);
                model.webcopyright   = webcopyright.Text;
                model.webpath        = webpath.Text;
                model.webmanagepath  = webmanagepath.Text;
                model.webstatus      = int.Parse(webstatus.Text.Trim());
                model.webclosereason = webclosereason.Text;
                model.webcountcode   = webcountcode.Text;

                model.staticstatus    = int.Parse(staticstatus.SelectedValue);
                model.staticextension = staticextension.Text;
                model.memberstatus    = int.Parse(memberstatus.SelectedValue);
                model.commentstatus   = int.Parse(commentstatus.SelectedValue);
                model.logstatus       = int.Parse(logstatus.SelectedValue);

                model.emailstmp     = emailstmp.Text;
                model.emailport     = int.Parse(emailport.Text.Trim());
                model.emailfrom     = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.attachpath            = attachpath.Text;
                model.attachextension       = attachextension.Text;
                model.attachsave            = int.Parse(attachsave.SelectedValue);
                model.attachfilesize        = int.Parse(attachfilesize.Text.Trim());
                model.attachimgsize         = int.Parse(attachimgsize.Text.Trim());
                model.attachimgmaxheight    = int.Parse(attachimgmaxheight.Text.Trim());
                model.attachimgmaxwidth     = int.Parse(attachimgmaxwidth.Text.Trim());
                model.thumbnailheight       = int.Parse(thumbnailheight.Text.Trim());
                model.thumbnailwidth        = int.Parse(thumbnailwidth.Text.Trim());
                model.watermarktype         = int.Parse(watermarktype.SelectedValue);
                model.watermarkposition     = int.Parse(watermarkposition.Text.Trim());
                model.watermarkimgquality   = int.Parse(watermarkimgquality.Text.Trim());
                model.watermarkpic          = watermarkpic.Text;
                model.watermarktransparency = int.Parse(watermarktransparency.Text.Trim());
                model.watermarktext         = watermarktext.Text;
                model.watermarkfont         = watermarkfont.Text;
                model.watermarkfontsize     = int.Parse(watermarkfontsize.Text.Trim());

                bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
                JscriptMsg("修改系统信息成功啦!", "sys_config.aspx", "Success");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error");
            }
        }
Пример #24
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", PLEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.siteconfig   bll   = new BLL.siteconfig();
            Model.siteconfig model = bll.loadConfig();
            try
            {
                model.webname    = webname.Text;
                model.weburl     = weburl.Text;
                model.webcompany = webcompany.Text;
                model.webaddress = webaddress.Text;
                model.webtel     = webtel.Text;
                model.webfax     = webfax.Text;
                model.webmail    = webmail.Text;
                model.webcrod    = webcrod.Text;

                model.webpath         = webpath.Text;
                model.webmanagepath   = webmanagepath.Text;
                model.staticstatus    = Utils.StrToInt(staticstatus.SelectedValue, 0);
                model.staticextension = staticextension.Text;
                if (memberstatus.Checked == true)
                {
                    model.memberstatus = 1;
                }
                else
                {
                    model.memberstatus = 0;
                }
                if (commentstatus.Checked == true)
                {
                    model.commentstatus = 1;
                }
                else
                {
                    model.commentstatus = 0;
                }
                if (logstatus.Checked == true)
                {
                    model.logstatus = 1;
                }
                else
                {
                    model.logstatus = 0;
                }
                if (webstatus.Checked == true)
                {
                    model.webstatus = 1;
                }
                else
                {
                    model.webstatus = 0;
                }
                model.webclosereason = webclosereason.Text;
                model.webcountcode   = webcountcode.Text;

                model.smsapiurl   = smsapiurl.Text;
                model.smsusername = smsusername.Text;
                //判断密码是否更改
                if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword)
                {
                    model.smspassword = Utils.MD5(smspassword.Text.Trim());
                }

                model.emailsmtp = emailsmtp.Text;
                if (emailssl.Checked == true)
                {
                    model.emailssl = 1;
                }
                else
                {
                    model.emailssl = 0;
                }
                model.emailport     = Utils.StrToInt(emailport.Text.Trim(), 25);
                model.emailfrom     = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.filepath              = filepath.Text;
                model.filesave              = Utils.StrToInt(filesave.SelectedValue, 2);
                model.fileremote            = Utils.StrToInt(fileremote.SelectedValue, 0);
                model.fileextension         = fileextension.Text;
                model.videoextension        = videoextension.Text;
                model.attachsize            = Utils.StrToInt(attachsize.Text.Trim(), 0);
                model.videosize             = Utils.StrToInt(videosize.Text.Trim(), 0);
                model.imgsize               = Utils.StrToInt(imgsize.Text.Trim(), 0);
                model.imgmaxheight          = Utils.StrToInt(imgmaxheight.Text.Trim(), 0);
                model.imgmaxwidth           = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0);
                model.thumbnailheight       = Utils.StrToInt(thumbnailheight.Text.Trim(), 0);
                model.thumbnailwidth        = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0);
                model.thumbnailmode         = thumbnailmode.SelectedValue;
                model.watermarktype         = Utils.StrToInt(watermarktype.SelectedValue, 0);
                model.watermarkposition     = Utils.StrToInt(watermarkposition.Text.Trim(), 9);
                model.watermarkimgquality   = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80);
                model.watermarkpic          = watermarkpic.Text;
                model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5);
                model.watermarktext         = watermarktext.Text;
                model.watermarkfont         = watermarkfont.Text;
                model.watermarkfontsize     = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12);

                bll.saveConifg(model);
                AddAdminLog(PLEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志
                JscriptMsg("修改系统配置成功!", "sys_config.aspx");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查文件夹权限!", "");
            }
        }
Пример #25
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            BLL.users   bll   = new BLL.users();
            Model.users model = new Model.users();

            model.group_id = Utils.StringToNum(ddlGroupId.SelectedValue);
            int point = 0;

            switch (model.group_id)
            {
            case 1:
                point = 0;
                break;

            case 2:
                point = 50;
                break;

            case 3:
                point = 100;
                break;

            case 4:
                point = 150;
                break;
            }
            //model.point = point;
            model.isVip = 0;
            if (chkVip.Checked == true)
            {
                model.isVip = 1;
            }
            model.is_lock = Utils.StringToNum(rblIsLock.SelectedValue);
            if (!string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim());
            }
            else
            {
                model.password = txtPwd.Value;
            }
            model.email     = txtEmail.Text;
            model.dianming  = llbInTroduce.Text;
            model.nick_name = txtNickName.Text;
            model.user_name = txtUserName.Text.Trim();
            model.avatar    = txtAvatar.Text;
            model.sex       = rblSex.SelectedValue;
            DateTime _birthday;

            if (DateTime.TryParse(txtBirthday.Text.Trim(), out _birthday))
            {
                model.birthday = _birthday;
            }
            model.telphone = txtTelphone.Text.Trim();
            model.mobile   = txtMobile.Text.Trim();
            model.qq       = txtQQ.Text;
            model.address  = txtAddress.Text.Trim();
            model.amount   = decimal.Parse(txtAmount.Text.Trim());

            BLL.siteconfig   bllConfig   = new BLL.siteconfig();
            Model.siteconfig modelConfig = bllConfig.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));

            #region 介紹售屋物件
            if (modelConfig.weburl == DESEncrypt.Encrypt(txtManagePwd.Text))
            {
                if (!string.IsNullOrEmpty(txtSellHoursePoint.Text))
                {
                    BLL.users BLLUser = new BLL.users();
                    if (txtSell.Value == "0")
                    {
                        point = Utils.StringToNum(txtSellHoursePoint.Text) * 5000;
                        BLLUser.UpPoint(id, point);
                        BLL.point_log   points = new BLL.point_log();
                        Model.point_log modelP = new Model.point_log();
                        modelP.user_id   = _id;
                        modelP.user_name = txtNickName.Text;
                        modelP.value     = point;
                        modelP.remark    = "介紹售屋物件回饋點數";
                        modelP.add_time  = DateTime.Now;
                        modelP.type      = 1;//2會員介紹物件已成交
                        int m = points.Add(modelP);
                    }
                    else
                    {
                        int Nums = System.Math.Abs(Utils.StringToNum(txtSellHoursePoint.Text) - Utils.StringToNum(txtSell.Value));
                        if (Nums != 0)
                        {
                            int             jianPoint = Nums * 5000;
                            BLL.point_log   points    = new BLL.point_log();
                            Model.point_log modelP    = new Model.point_log();
                            modelP.user_id   = _id;
                            modelP.user_name = txtNickName.Text;
                            modelP.value     = jianPoint;
                            modelP.add_time  = DateTime.Now;
                            if ((Utils.StringToNum(txtSellHoursePoint.Text) - Utils.StringToNum(txtSell.Value)) < 0)
                            {
                                modelP.remark = "減去介紹售屋物件回饋點數";
                                modelP.type   = 2;//2會員介紹物件已成交
                                BLLUser.UpJianPoint(id, jianPoint);
                            }
                            else
                            {
                                modelP.remark = "介紹售屋物件回饋點數";
                                modelP.type   = 1;//2會員介紹物件已成交
                                BLLUser.UpPoint(id, jianPoint);
                            }
                            int m = points.Add(modelP);
                        }
                    }
                    model.isDonePoints = Utils.StringToNum(txtSellHoursePoint.Text);
                }
            }
            else
            {
                model.isDonePoints = Utils.StringToNum(txtSell.Value);
            }
            #endregion

            #region 介紹租屋物件
            if (modelConfig.weburl == DESEncrypt.Encrypt(TextBox2.Text))
            {
                if (!string.IsNullOrEmpty(txtHireHoursePoint.Text))
                {
                    BLL.users BLLUser = new BLL.users();
                    if (txtHire.Value == "0")
                    {
                        point = Utils.StringToNum(txtHireHoursePoint.Text) * 200;
                        BLLUser.UpPoint(id, point);
                        BLL.point_log   points = new BLL.point_log();
                        Model.point_log modelP = new Model.point_log();
                        modelP.user_id   = _id;
                        modelP.user_name = txtNickName.Text;
                        modelP.value     = point;
                        modelP.remark    = "介紹租屋物件回饋點數";
                        modelP.add_time  = DateTime.Now;
                        modelP.type      = 1;//2會員介紹物件已成交
                        int m = points.Add(modelP);
                    }
                    else
                    {
                        int Nums = System.Math.Abs(Utils.StringToNum(txtHireHoursePoint.Text) - Utils.StringToNum(txtHire.Value));
                        if (Nums != 0)
                        {
                            int             jianPoint = Nums * 200;
                            BLL.point_log   points    = new BLL.point_log();
                            Model.point_log modelP    = new Model.point_log();
                            modelP.user_id   = _id;
                            modelP.user_name = txtNickName.Text;
                            modelP.value     = jianPoint;
                            modelP.add_time  = DateTime.Now;
                            if ((Utils.StringToNum(txtHireHoursePoint.Text) - Utils.StringToNum(txtHire.Value)) < 0)
                            {
                                modelP.remark = "減去介紹租屋物件回饋點數";
                                modelP.type   = 2;//2會員介紹物件已成交
                                BLLUser.UpJianPoint(id, jianPoint);
                            }
                            else
                            {
                                modelP.remark = "介紹租屋物件回饋點數";
                                modelP.type   = 1;//2會員介紹物件已成交
                                BLLUser.UpPoint(id, jianPoint);
                            }
                            int m = points.Add(modelP);
                        }
                    }
                    model.isHirePoints = Utils.StringToNum(txtHireHoursePoint.Text);
                }
            }
            else
            {
                model.isHirePoints = Utils.StringToNum(txtHire.Value);
            }
            #endregion

            #region 介紹租賃廣告
            if (modelConfig.weburl == DESEncrypt.Encrypt(TextBox4.Text))
            {
                if (!string.IsNullOrEmpty(txtHireAdPoint.Text))
                {
                    BLL.users BLLUser = new BLL.users();
                    if (txtAd.Value == "0")
                    {
                        point = Utils.StringToNum(txtHireAdPoint.Text) * 300;
                        BLLUser.UpPoint(id, point);
                        BLL.point_log   points = new BLL.point_log();
                        Model.point_log modelP = new Model.point_log();
                        modelP.user_id   = _id;
                        modelP.user_name = txtNickName.Text;
                        modelP.value     = point;
                        modelP.remark    = "介紹租賃廣告回饋點數";
                        modelP.add_time  = DateTime.Now;
                        modelP.type      = 1;//2會員介紹物件已成交
                        int m = points.Add(modelP);
                    }
                    else
                    {
                        int Nums = System.Math.Abs(Utils.StringToNum(txtHireAdPoint.Text) - Utils.StringToNum(txtAd.Value));
                        if (Nums != 0)
                        {
                            int jianPoint = Nums * 300;

                            BLL.point_log   points = new BLL.point_log();
                            Model.point_log modelP = new Model.point_log();
                            modelP.user_id   = _id;
                            modelP.user_name = txtNickName.Text;
                            modelP.value     = jianPoint;
                            modelP.add_time  = DateTime.Now;
                            if ((Utils.StringToNum(txtHireAdPoint.Text) - Utils.StringToNum(txtAd.Value)) < 0)
                            {
                                modelP.type   = 2;//2會員介紹物件已成交
                                modelP.remark = "減去介紹租賃廣告回饋點數";
                                BLLUser.UpJianPoint(id, jianPoint);
                            }
                            else
                            {
                                modelP.type   = 1;//2會員介紹物件已成交
                                modelP.remark = "介紹租賃廣告回饋點數";
                                BLLUser.UpPoint(id, jianPoint);
                            }
                            int m = points.Add(modelP);
                        }
                    }
                    model.isAd = Utils.StringToNum(txtHireAdPoint.Text);
                }
            }
            else
            {
                model.isAd = Utils.StringToNum(txtAd.Value);
            }
            #endregion

            #region 介紹精品廠商
            if (modelConfig.weburl == DESEncrypt.Encrypt(TextBox6.Text))
            {
                if (!string.IsNullOrEmpty(txtHireMacPoint.Text))
                {
                    BLL.users BLLUser = new BLL.users();
                    if (txtMac.Value == "0")
                    {
                        point = Utils.StringToNum(txtHireMacPoint.Text) * 800;
                        BLLUser.UpPoint(id, point);
                        BLL.point_log   points = new BLL.point_log();
                        Model.point_log modelP = new Model.point_log();
                        modelP.user_id   = _id;
                        modelP.user_name = txtNickName.Text;
                        modelP.value     = point;
                        modelP.remark    = "介紹精品廠商回饋點數";
                        modelP.add_time  = DateTime.Now;
                        modelP.type      = 1;//2會員介紹物件已成交
                        int m = points.Add(modelP);
                    }
                    else
                    {
                        int Nums = System.Math.Abs(Utils.StringToNum(txtHireMacPoint.Text) - Utils.StringToNum(txtMac.Value));
                        if (Nums != 0)
                        {
                            int jianPoint = Nums * 800;

                            BLL.point_log   points = new BLL.point_log();
                            Model.point_log modelP = new Model.point_log();
                            modelP.user_id   = _id;
                            modelP.user_name = txtNickName.Text;
                            modelP.value     = jianPoint;
                            modelP.add_time  = DateTime.Now;
                            if ((Utils.StringToNum(txtHireMacPoint.Text) - Utils.StringToNum(txtMac.Value)) < 0)
                            {
                                modelP.remark = "減去介紹精品廠商回饋點數";
                                modelP.type   = 2;//2會員介紹物件已成交
                                BLLUser.UpJianPoint(id, jianPoint);
                            }
                            else
                            {
                                modelP.remark = "介紹精品廠商回饋點數";
                                modelP.type   = 1;//2會員介紹物件已成交
                                BLLUser.UpPoint(id, jianPoint);
                            }

                            int m = points.Add(modelP);
                        }
                    }
                    model.isMac = Utils.StringToNum(txtHireMacPoint.Text);
                }
            }
            else
            {
                model.isMac = Utils.StringToNum(txtMac.Value);
            }
            #endregion


            //model.exp = Utils.StringToNum(txtExp.Text.Trim());
            model.id = _id;
            if (!bll.Update(model))
            {
                result = false;
            }
            return(result);
        }
Пример #26
0
 private void setEmail(string UserEmail, string Content)
 {
     BLL.siteconfig   bll   = new BLL.siteconfig();
     Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
     DTMail.sendMail(model.emailstmp, model.emailport, model.emailfrom, model.emailpassword, model.emailusername, model.emailfrom, UserEmail, "帝光房屋留言回覆", Content);
 }
Пример #27
0
        private string CreateDatabase()
        {
            try
            {
                string error      = string.Empty;
                string str3       = Server.MapPath("/Install/db.sql");
                string ServerName = txtServerName.Text.Trim();
                string DbUserName = txtDbUserName.Text.Trim();
                string DbUserPass = txtDbUserPass.Text.Trim();
                string DbName     = txtDbName.Text.Trim();
                if ((ServerName == string.Empty) || (DbUserName == string.Empty) || (DbName == string.Empty))
                {
                    return("您输入的信息不完整,请重试");
                }
                else if (!Save())
                {
                    return("数据库连接失败");
                }
                else
                {
                    bool   flag             = true;
                    string connectionString = string.Format("server={0};database={1};uid={2};pwd={3}", new object[] { ServerName, DbName, DbUserName, DbUserPass });
                    using (SqlConnection connection = new SqlConnection(connectionString))
                    {
                        try
                        {
                            error = "数据库连接失败";
                            try
                            {
                                connection.Open();
                            }
                            catch
                            {
                                return(DbName + "数据库不存在!请先创建" + DbName);
                            }
                            error = "当前数据库用户没有权限创建表";
                            SqlCommand command = new SqlCommand("IF EXISTS (SELECT name FROM sysobjects WHERE name = 'a' AND type = 'U')DROP table a;create table a(id int not null default 0);drop table a;", connection);
                            command.ExecuteNonQuery();

                            string   str12     = File.ReadAllText(str3, Encoding.Default);
                            string[] separator = new string[] { "[go]" };
                            string[] strArray2 = str12.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                            error = "数据库安装失败";
                            for (int i = 0; i < strArray2.Length; i++)
                            {
                                command = new SqlCommand(strArray2[i].Replace("{前缀}", txtDbPrefix.Text.Trim()), connection);
                                // str12 = strArray2[i];
                                command.ExecuteNonQuery();
                            }

                            BLL.siteconfig   bll   = new BLL.siteconfig();
                            Model.siteconfig model = bll.loadConfig();
                            model.webpath = txtSiteUrl.Text.Trim();
                            model.webname = txtSiteName.Text.Trim();

                            Dictionary <string, string> dic = new Dictionary <string, string>();
                            //写配置文件
                            ConfigSave("ConnectionString", connectionString, dic);
                            //保存成功
                            ConfigSaveAll(dic);

                            string Okpath = Server.MapPath("~/Install/installok.ok");
                            File.WriteAllText(Okpath, "ok");
                            return("");
                        }
                        catch (Exception ex)
                        {
                            return("安装出现错误:" + ex.ToString());
                        }
                        finally
                        {
                            connection.Close();
                        }
                    }
                }
                return("");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }