示例#1
0
        protected void InitSave()
        {
            cominit();
            cModel.PersonInfo.ContactTel    = Utils.GetFormValue("CompanyTEl");
            cModel.PersonInfo.ContactMobile = Utils.GetFormValue("CompanyPhone");

            //页头
            if (Request.Files["PrintTop"] != null)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["PrintTop"], "zutuanFile", out filepath, out oldfilename);
                if (result)
                {
                    cptModel.PageHeadFile = filepath;
                }
            }
            //模板页
            if (Request.Files["PrintTemplate"] != null)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["PrintTemplate"], "zutuanFile", out filepath, out oldfilename);
                if (result)
                {
                    cptModel.TemplateFile = filepath;
                }
            }
            //页脚
            if (Request.Files["PrintFooter"] != null)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["PrintFooter"], "zutuanFile", out filepath, out oldfilename);
                if (result)
                {
                    cptModel.PageFootFile = filepath;
                }
            }
            //公章
            if (Request.Files["PrintCachet"] != null)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["PrintCachet"], "zutuanFile", out filepath, out oldfilename);
                if (result)
                {
                    cptModel.CustomerStamp = filepath;
                }
            }

            bool res = cBll.UpDateSampleCompanyUserInfo(cModel);

            res = cBll.UpdateSampleCustomerConfig(cptModel);
            if (res)
            {
                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();window.parent.location.reload();", "保存成功", Utils.GetQueryStringValue("iframeId")));
            }
        }
示例#2
0
        protected string PageLogo   = string.Empty; //公司logo

        protected void Page_Load(object sender, EventArgs e)
        {
            string method = Utils.GetFormValue("hidMethod");

            EyouSoft.BLL.CompanyStructure.Customer         Customer       = new EyouSoft.BLL.CompanyStructure.Customer();
            EyouSoft.Model.CompanyStructure.CustomerConfig CustomerConfig = null;
            if (method == "save")
            {
                //保存
                Customer       = new EyouSoft.BLL.CompanyStructure.Customer();
                CustomerConfig = new EyouSoft.Model.CompanyStructure.CustomerConfig();
                string fileName    = string.Empty;
                string oldName     = string.Empty;
                bool   result      = true;
                string OldFilePath = "";

                HttpPostedFile fHeader = Request.Files["fileHeader"];
                HttpPostedFile fFooter = Request.Files["fileFooter"];
                HttpPostedFile fSeal   = Request.Files["fileSeal"];
                HttpPostedFile fModel  = Request.Files["fileModel"];
                HttpPostedFile flogo   = Request.Files["fileLogo"];

                //公司logo
                if (flogo != null && !string.IsNullOrEmpty(flogo.FileName) && flogo.ContentLength > 0)
                {
                    result = UploadFile.FileUpLoad(flogo, "systemset", out fileName, out oldName);
                    CustomerConfig.FilePathLogo = fileName;
                }
                else
                {
                    OldFilePath = Utils.GetFormValue(hidfileLogo.UniqueID);
                    CustomerConfig.FilePathLogo = OldFilePath;
                }
                //上传页眉
                if (fHeader != null && !string.IsNullOrEmpty(fHeader.FileName) && fHeader.ContentLength > 0)
                {
                    result = UploadFile.FileUpLoad(fHeader, "systemset", out fileName, out oldName);
                    CustomerConfig.PageHeadFile = fileName;
                }
                else
                {
                    OldFilePath = Utils.GetFormValue(hidFileHeader.UniqueID);
                    CustomerConfig.PageHeadFile = OldFilePath;
                }
                //上传页脚
                if (result && (fFooter != null && !string.IsNullOrEmpty(fFooter.FileName)) && fFooter.ContentLength > 0)
                {
                    result = UploadFile.FileUpLoad(fFooter, "systemset", out fileName, out oldName);
                    CustomerConfig.PageFootFile = fileName;
                }
                else
                {
                    OldFilePath = Utils.GetFormValue(hidFileFooter.UniqueID);
                    CustomerConfig.PageFootFile = OldFilePath;
                }
                //上传模板
                if (result && (fModel != null && !string.IsNullOrEmpty(fModel.FileName)) && fModel.ContentLength > 0)
                {
                    result = UploadFile.FileUpLoad(fModel, "systemset", out fileName, out oldName);
                    CustomerConfig.TemplateFile = fileName;
                }
                else
                {
                    OldFilePath = Utils.GetFormValue(hidFileModel.UniqueID);
                    CustomerConfig.TemplateFile = OldFilePath;
                }
                //上传公章
                if (result && (fSeal != null && !string.IsNullOrEmpty(fSeal.FileName)) && fSeal.ContentLength > 0)
                {
                    result = UploadFile.FileUpLoad(fSeal, "systemset", out fileName, out oldName);
                    CustomerConfig.CustomerStamp = fileName;
                }
                else
                {
                    OldFilePath = Utils.GetFormValue(hidfileSeal.UniqueID);
                    CustomerConfig.CustomerStamp = OldFilePath;
                }

                //获得配置信息
                if (result)
                {
                    CustomerConfig.Id = SiteUserInfo.TourCompany.TourCompanyId;
                    result            = Customer.UpdateSampleCustomerConfig(CustomerConfig);
                }
                if (CustomerConfig != null)
                {
                    SetPrintPic(CustomerConfig);
                }
                MessageBox.ShowAndRedirect(this, result ? "设置成功!" : "设置失败!", "/GroupEnd/SystemSetting/DeployManager.aspx");
                return;
            }

            CustomerConfig = Customer.GetCustomerConfigModel(SiteUserInfo.TourCompany.TourCompanyId);
            if (CustomerConfig != null)
            {
                SetPrintPic(CustomerConfig);
            }
        }