123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- using LYFZ.Software.MainBusiness.DoorCityProcess;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.StudioDataSet
- {
- public partial class ShopMessageSetFormMain : LYFZ.Software.UI.StudioDataSet.ShopMessageSetFormMain
- {
- public ShopMessageSetFormMain()
- {
- this.btnDownloadDimCode.Click += btnDownloadDimCode_Click;
- this.btnDownloadChildLOG.Click += btnDownloadChildLOG_Click;
- this.btnDownloadPortraitLOG.Click += btnDownloadPortraitLOG_Click;
- this.btnDownloadWeddingLOG.Click += btnDownloadWeddingLOG_Click;
- this.txtPhone.KeyPress += txtPhone_KeyPress;
- }
- LYFZ.BLL.BLL_ErpCompanyInfo bll = new BLL.BLL_ErpCompanyInfo();
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- /// <summary>
- /// 影楼ID
- /// </summary>
- private string StrID = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- private bool IsSaveed = false;
- private bool IsFirstRun = true;
- public delegate void UpdateControl();
- string strGetFileName = "ID,Company_DividedShop,Company_Name,Company_Manager,Company_Telephone,Company_Fax,Company_URL,Company_DianQingDate,Company_Address,Company_SingleTitle,Company_SingleExplanation,Company_ReservationExplanation,Company_ChildReserveExplain,Company_PortraitReserveExplain,Company_ProductionNotes,Company_DressDescription,Company_About,Company_PhotoThumbnail,Company_PhotoAlbum,Company_Detail,Company_MicroShareAccount,Company_MicroSharePassword,Company_CreateDatetime,Company_CreateName,Company_UpdateDatetime,Company_UpdateName";
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void ShopMessageSetFormMain_Load(object sender, EventArgs e)
- {
- this.tabPage2.Parent = null;
- this.tbPage1.Parent = null;
- this.tbPage2.Parent = null;
- this.tbPage3.Parent = null;
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.婚纱版)
- { this.tbPage1.Parent = this.tabControl2; }
- else if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.儿童版)
- { this.tbPage2.Parent = this.tabControl2; }
- else if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.旗舰版)
- {
- this.tbPage1.Parent = this.tabControl2;
- this.tbPage2.Parent = this.tabControl2;
- }
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition)
- { this.tbPage3.Parent = this.tabControl2; }
- string CompanyNameID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetCompanyInfoID();
- this.GetPhoto(CompanyNameID);
- DataTable tbl = orbll.GetView_Custom("tb_ErpCompanyInfo", ShowColumnName: strGetFileName).Tables[0];
- if (tbl.Rows.Count <= 1)
- { this.panelEx2.Visible = false; }
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- this.cmbStoreName.Items.Add(new ListItem(tbl.Rows[i]["Company_Name"].ToString().Trim(), tbl.Rows[i]["Company_DividedShop"].ToString().Trim()));
- if (tbl.Rows[i]["Company_DividedShop"].ToString().Trim() == CompanyNameID.Trim())
- { this.cmbStoreName.SelectedIndex = i; }
- }
- DataRow[] dtRow = tbl.Select("Company_DividedShop = '" + CompanyNameID + "'");
- if (dtRow.Length > 0)
- {
- this.txtStoreName.Text = dtRow[0]["Company_Name"].ToString().Trim();
- this.txtPhone.Text = dtRow[0]["Company_Telephone"].ToString().Trim();
- this.txtMicroShareAccount.Text = dtRow[0]["Company_MicroShareAccount"].ToString().Trim();
- this.txtMicroSharePassword.Text = dtRow[0]["Company_MicroSharePassword"].ToString().Trim();
- this.txtAddress.Text = dtRow[0]["Company_Address"].ToString().Trim();
- this.txtURL.Text = dtRow[0]["Company_URL"].ToString().Trim();
- this.txtStoreManager.Text = dtRow[0]["Company_Manager"].ToString().Trim();
- if (!string.IsNullOrEmpty(dtRow[0]["Company_DianQingDate"].ToString()))
- { this.dtpDianQingDate.DateValue = dtRow[0]["Company_DianQingDate"].ToString().Trim(); }
- this.StrID = dtRow[0]["ID"].ToString().Trim();
- if (dtRow[0]["Company_SingleTitle"].ToString().Trim() != "∝")
- {
- this.tabPage2.Parent = this.tabControl;
- this.txtIncomeMoneyTitle.Text = dtRow[0]["Company_SingleTitle"].ToString().Trim();
- this.txtIncomeMoneyExplain.Text = dtRow[0]["Company_SingleExplanation"].ToString().Trim();
- if (this.tabControl2.TabPages["tbPage1"] != null)
- { this.txtWeddingReserveExplain.Text = dtRow[0]["Company_ReservationExplanation"].ToString().Trim(); }
- if (this.tabControl2.TabPages["tbPage2"] != null)
- {
- if (dtRow[0]["Company_ChildReserveExplain"].ToString().Trim() != "")
- { this.txtChildReserveExplain.Text = dtRow[0]["Company_ChildReserveExplain"].ToString().Trim(); }
- else
- { this.txtChildReserveExplain.Text = dtRow[0]["Company_ReservationExplanation"].ToString().Trim(); }
- }
- if (this.tabControl2.TabPages["tbPage3"] != null)
- {
- if (dtRow[0]["Company_PortraitReserveExplain"].ToString().Trim() != "")
- { this.txtPortraitReserveExplain.Text = dtRow[0]["Company_PortraitReserveExplain"].ToString().Trim(); }
- else
- {
- if (dtRow[0]["Company_ReservationExplanation"].ToString().Trim() != "")
- { this.txtPortraitReserveExplain.Text = dtRow[0]["Company_ReservationExplanation"].ToString().Trim(); }
- else
- { this.txtPortraitReserveExplain.Text = dtRow[0]["Company_ChildReserveExplain"].ToString().Trim(); }
- }
- }
- this.txtMakingExplain.Text = dtRow[0]["Company_ProductionNotes"].ToString().Trim();
- this.txtDressExplain.Text = dtRow[0]["Company_DressDescription"].ToString().Trim();
- }
- }
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PhotoStudioInfo, LYFZ.CustomAttributes.OperatingAuthority.Setting))
- { this.btnSave.Enabled = false; }
- #endregion
- this.IsFirstRun = false;
- //this.tabPage2.Parent = null;
- }
- /// <summary>
- /// 获取影楼预约单Log图片
- /// </summary>
- /// <param name="ShopName"></param>
- private void GetPhoto(string ShopName)
- {
- this.cmbStoreName.Enabled = false;
- System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate()
- {
- DataTable tblPhoto = orbll.GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + ShopName + "'", ShowColumnName: "Company_DimensionalCode,Company_WeddingSingleLOG,Company_ChildSingleLOG,Company_PortraitLOG").Tables[0];
- try
- {
- this.Invoke(new UpdateControl(delegate()
- {
- if (tblPhoto.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPhoto.Rows[0]["Company_DimensionalCode"].ToString()))
- { this.pictDimCode.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(tblPhoto.Rows[0]["Company_DimensionalCode"].ToString())); }
- if (!string.IsNullOrEmpty(tblPhoto.Rows[0]["Company_WeddingSingleLOG"].ToString()))
- { this.pictWeddingLOG.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(tblPhoto.Rows[0]["Company_WeddingSingleLOG"].ToString())); }
- if (!string.IsNullOrEmpty(tblPhoto.Rows[0]["Company_ChildSingleLOG"].ToString()))
- { this.pictChildLOG.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(tblPhoto.Rows[0]["Company_ChildSingleLOG"].ToString())); }
- if (!string.IsNullOrEmpty(tblPhoto.Rows[0]["Company_PortraitLOG"].ToString()))
- { this.pictPortraitLOG.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(tblPhoto.Rows[0]["Company_PortraitLOG"].ToString())); }
- }
- }));
- }
- catch { }
- try
- {
- this.Invoke(new UpdateControl(delegate()
- { this.cmbStoreName.Enabled = true; }));
- }
- catch { }
- }));
- t.Start();
- }
- /// <summary>
- /// 二维码上传事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnDimCodeUpdate_Click(object sender, EventArgs e)
- {
- openFileDialog1.ShowDialog(this);
- if (openFileDialog1.FileName.Length > 0)
- {
- if (openFileDialog1.FileName != "openFileDialog1")
- {
- FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
- pictDimCode.Image = System.Drawing.Image.FromStream(fs);
- fs.Close();
- }
- }
- }
- /// <summary>
- /// 删除二维码图片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCodeDelete_Click(object sender, EventArgs e)
- { this.pictDimCode.Image = null; }
- /// <summary>
- /// 婚纱预约单LOG上传事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnWeddingSelectLOG_Click(object sender, EventArgs e)
- { this.SeleteLog(pictWeddingLOG); }
- /// <summary>
- /// 婚纱预约单LOG删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnWeddingDelete_Click(object sender, EventArgs e)
- { this.pictWeddingLOG.Image = null; }
- /// <summary>
- /// 儿童预约单LOG上传事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnChildSelectLOG_Click(object sender, EventArgs e)
- { this.SeleteLog(this.pictChildLOG); }
- private void SeleteLog(LYFZ.ComponentLibrary.PictureBoxEx pict)
- {
- openFileDialog1.ShowDialog(this);
- if (openFileDialog1.FileName.Length > 0)
- {
- if (openFileDialog1.FileName != "openFileDialog1")
- {
- Image img = Image.FromFile(openFileDialog1.FileName);
- FileInfo f = new FileInfo(openFileDialog1.FileName);
- if (f.Length > 2100000)
- { MessageBoxCustom.Show("图片过大,建议使用大小在800K以内的图片"); return; }
- if (img.Width > 2500)
- { MessageBoxCustom.Show("图片长度过长,建议使用大小在 2000*280(像素)以内的图片"); return; }
- if (img.Height > 300)
- { MessageBoxCustom.Show("图片过大,建议使用大小在 2000*280(像素)以内的图片"); return; }
- FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
- pict.Image = System.Drawing.Image.FromStream(fs);
- fs.Close();
- }
- }
- }
- /// <summary>
- /// 儿童预约单LOG删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnChildDelete_Click(object sender, EventArgs e)
- { this.pictChildLOG.Image = null; }
- /// <summary>
- /// 写真预约单LOG删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnPortraitSelectLOG_Click(object sender, EventArgs e)
- { this.SeleteLog(this.pictPortraitLOG); }
- /// <summary>
- /// 写真预约单LOG删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnPortraitDelete_Click(object sender, EventArgs e)
- { this.pictPortraitLOG.Image = null; }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnSave_Click(object sender, EventArgs e)
- {
- if (this.dtpDianQingDate.DateValue.Trim() == "")
- { MessageBoxCustom.Show("店庆日期不能为空!"); return; }
- if (this.txtAddress.Text.Trim().Length > 200)
- { MessageBoxCustom.Show("地址字数不得超过200字(含符号),当前字数" + this.txtAddress.Text.Trim().Length); return; }
- if (this.txtDressExplain.Text.Trim().Length > 2000)
- { MessageBoxCustom.Show("礼服单说明字数不得超过2000字(含符号),当前字数" + this.txtDressExplain.Text.Trim().Length); return; }
- if (this.txtIncomeMoneyExplain.Text.Trim().Length > 2000)
- { MessageBoxCustom.Show("收款单说明字数不得超过2000字(含符号),当前字数" + this.txtIncomeMoneyExplain.Text.Trim().Length); return; }
- if (this.txtIncomeMoneyTitle.Text.Trim().Length > 500)
- { MessageBoxCustom.Show("收款单标题字数不得超过500字(含符号),当前字数" + this.txtIncomeMoneyTitle.Text.Trim().Length); return; }
- if (this.txtMakingExplain.Text.Trim().Length > 2000)
- { MessageBoxCustom.Show("制作单说明字数不得超过2000字(含符号),当前字数" + this.txtMakingExplain.Text.Trim().Length); return; }
- if (this.txtWeddingReserveExplain.Text.Trim().Length > 2000)
- { MessageBoxCustom.Show("预约单说明字数不得超过2000字(含符号),当前字数" + this.txtWeddingReserveExplain.Text.Trim().Length); return; }
- if (this.txtStoreManager.Text.Trim().Length > 20)
- { MessageBoxCustom.Show("店长字数不得超过20字(含符号),当前字数" + this.txtStoreManager.Text.Trim().Length); return; }
- if (this.txtStoreName.Text.Trim().Length > 100)
- { MessageBoxCustom.Show("店名字数不得超过100字(含符号),当前字数" + this.txtStoreName.Text.Trim().Length); return; }
- if (this.txtURL.Text.Trim().Length > 200)
- { MessageBoxCustom.Show("网址字数不得超过200字(含符号),当前字数" + this.txtURL.Text.Trim().Length); return; }
- if (this.txtMicroShareAccount.Text.Trim().Length > 200)
- { MessageBoxCustom.Show("微分享帐号字数不得超过200字(含符号),当前字数" + this.txtURL.Text.Trim().Length); return; }
- if (this.txtMicroSharePassword.Text.Trim().Length > 200)
- { MessageBoxCustom.Show("微分享密码字数不得超过200字(含符号),当前字数" + this.txtURL.Text.Trim().Length); return; }
- DateTime StrTime = SDateTime.Now;
- if (this.StrID != "")
- {
- if (MessageBoxCustom.Show("保存后将覆盖原来的数据,你确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) != DialogResult.Yes)
- { return; }
- LYFZ.Model.Model_ErpCompanyInfo model = (LYFZ.Model.Model_ErpCompanyInfo)bll.GetModelObject("ID", StrID);
- model.Company_Name = this.txtStoreName.Text.Trim();
- model.Company_Telephone = this.txtPhone.Text.Trim();
- model.Company_Address = this.txtAddress.Text.Trim();
- model.Company_URL = this.txtURL.Text.Trim();
- model.Company_Manager = this.txtStoreManager.Text.Trim();
- model.Company_SingleTitle = this.txtIncomeMoneyTitle.Text.Trim();
- model.Company_SingleExplanation = this.txtIncomeMoneyExplain.Text.Trim();
- if (this.tabControl2.TabPages["tbPage1"] != null)
- { model.Company_ReservationExplanation = this.txtWeddingReserveExplain.Text.Trim(); }
- if (this.tabControl2.TabPages["tbPage2"] != null)
- { model.Company_ChildReserveExplain = this.txtChildReserveExplain.Text.Trim(); }
- if (this.tabControl2.TabPages["tbPage3"] != null)
- { model.Company_PortraitReserveExplain = this.txtPortraitReserveExplain.Text.Trim(); }
- model.Company_ProductionNotes = this.txtMakingExplain.Text.Trim();
- model.Company_DressDescription = this.txtDressExplain.Text.Trim();
- model.Company_MicroShareAccount = this.txtMicroShareAccount.Text.Trim();
- model.Company_MicroSharePassword = this.txtMicroSharePassword.Text.Trim();
- if (this.pictDimCode.Image != null)
- { model.Company_DimensionalCode = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictDimCode)); }
- else
- { model.Company_DimensionalCode = ""; }
- if (this.pictWeddingLOG.Image != null)
- { model.Company_WeddingSingleLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictWeddingLOG)); }
- else
- { model.Company_WeddingSingleLOG = ""; }
- if (this.pictChildLOG.Image != null)
- { model.Company_ChildSingleLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictChildLOG)); }
- else
- { model.Company_ChildSingleLOG = ""; }
- if (this.pictPortraitLOG.Image != null)
- { model.Company_PortraitLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictPortraitLOG)); }
- else
- { model.Company_PortraitLOG = ""; }
- model.Company_DianQingDate = Convert.ToDateTime(this.dtpDianQingDate.DateValue);
- model.Company_UpdateDatetime = StrTime;
- if (!bll.Update(model))
- { MessageBoxCustom.Show("保存失败"); return; }
- }
- else
- {
- LYFZ.Model.Model_ErpCompanyInfo model = new Model.Model_ErpCompanyInfo();
- model.Company_DividedShop = ((ListItem)this.cmbStoreName.SelectedItem).StrValue.ToString();
- model.Company_Name = this.txtStoreName.Text.Trim();
- model.Company_Manager = this.txtStoreManager.Text.Trim();
- model.Company_Telephone = this.txtPhone.Text.Trim();
- model.Company_URL = this.txtURL.Text.Trim();
- model.Company_Address = this.txtAddress.Text.Trim();
- model.Company_SingleTitle = this.txtIncomeMoneyTitle.Text.Trim();
- model.Company_SingleExplanation = this.txtIncomeMoneyExplain.Text.Trim();
- if (this.tabControl2.TabPages["tbPage1"] != null)
- { model.Company_ReservationExplanation = this.txtWeddingReserveExplain.Text.Trim(); }
- else
- { model.Company_ReservationExplanation = ""; }
- if (this.tabControl2.TabPages["tbPage2"] != null)
- { model.Company_ChildReserveExplain = this.txtChildReserveExplain.Text.Trim(); }
- else
- { model.Company_ChildReserveExplain = ""; }
- if (this.tabControl2.TabPages["tbPage3"] != null)
- { model.Company_PortraitReserveExplain = this.txtPortraitReserveExplain.Text.Trim(); }
- else
- { model.Company_PortraitReserveExplain = ""; }
- model.Company_ProductionNotes = this.txtMakingExplain.Text.Trim();
- model.Company_DressDescription = this.txtDressExplain.Text.Trim();
- model.Company_MicroShareAccount = this.txtMicroShareAccount.Text.Trim();
- model.Company_MicroSharePassword = this.txtMicroSharePassword.Text.Trim();
- if (this.pictDimCode.Image != null)
- { model.Company_DimensionalCode = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictDimCode)); }
- else
- { model.Company_DimensionalCode = ""; }
- if (this.pictWeddingLOG.Image != null)
- { model.Company_WeddingSingleLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictWeddingLOG)); }
- else
- { model.Company_WeddingSingleLOG = ""; }
- if (this.pictChildLOG.Image != null)
- { model.Company_ChildSingleLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictChildLOG)); }
- else
- { model.Company_ChildSingleLOG = ""; }
- if (this.pictPortraitLOG.Image != null)
- { model.Company_PortraitLOG = PublicCodeClasses.ToHexString(PublicCodeClasses.ImageDatabytes(this.pictPortraitLOG)); }
- else
- { model.Company_PortraitLOG = ""; }
- model.Company_DianQingDate = Convert.ToDateTime(this.dtpDianQingDate.DateValue);
- model.Company_CreateDatetime = StrTime;
- if (!bll.Add(model))
- { MessageBoxCustom.Show("保存失败"); return; }
- }
- this.IsSaveed = true;
- MessageBoxCustom.Show("保存成功");
- }
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCancel_Click(object sender, EventArgs e)
- { this.Close(); }
- /// <summary>
- /// 影楼店名
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void cmbStoreName_TextChanged(object sender, EventArgs e)
- {
- if (!IsFirstRun)
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + ((ListItem)this.cmbStoreName.SelectedItem).StrValue + "'", ShowColumnName: strGetFileName).Tables[0];
- if (tbl.Rows.Count > 0)
- {
- this.txtStoreName.Text = tbl.Rows[0]["Company_Name"].ToString().Trim();
- this.txtPhone.Text = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- this.txtAddress.Text = tbl.Rows[0]["Company_Address"].ToString().Trim();
- this.txtURL.Text = tbl.Rows[0]["Company_URL"].ToString().Trim();
- this.txtStoreManager.Text = tbl.Rows[0]["Company_Manager"].ToString().Trim();
- this.txtIncomeMoneyTitle.Text = tbl.Rows[0]["Company_SingleTitle"].ToString().Trim();
- this.txtIncomeMoneyExplain.Text = tbl.Rows[0]["Company_SingleExplanation"].ToString().Trim();
- this.txtWeddingReserveExplain.Text = tbl.Rows[0]["Company_ReservationExplanation"].ToString().Trim();
- this.txtChildReserveExplain.Text = tbl.Rows[0]["Company_ChildReserveExplain"].ToString().Trim();
- this.txtPortraitReserveExplain.Text = tbl.Rows[0]["Company_PortraitReserveExplain"].ToString().Trim();
- this.txtMakingExplain.Text = tbl.Rows[0]["Company_ProductionNotes"].ToString().Trim();
- this.txtDressExplain.Text = tbl.Rows[0]["Company_DressDescription"].ToString().Trim();
- this.StrID = tbl.Rows[0]["ID"].ToString().Trim();
- }
- this.GetPhoto(((ListItem)this.cmbStoreName.SelectedItem).StrValue.ToString());
- }
- }
- /// <summary>
- /// 关闭窗体之后发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void ShopMessageSetFormMain_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (!this.IsSaveed)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { e.Cancel = true; }
- }
- }
- /// <summary>
- /// 窗体大小变化事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void ShopMessageSetFormMain_Resize(object sender, EventArgs e)
- {
- //if (this.WindowState == FormWindowState.Maximized)
- //{ this.tabControl.Size = new Size(this.Width - 15, this.Height - 75); }
- //else
- //{ this.tabControl.Size = new Size(this.Width - 27, 700); }
- }
- /// <summary>
- /// 二维码下载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDownloadDimCode_Click(object sender, EventArgs e)
- { this.DownloadLog(this.pictDimCode, this.lblDimCode); }
- /// <summary>
- /// 儿童LOG下载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDownloadChildLOG_Click(object sender, EventArgs e)
- { this.DownloadLog(this.pictChildLOG, this.lblChildLOG); }
- /// <summary>
- /// 写真LOG下载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDownloadPortraitLOG_Click(object sender, EventArgs e)
- { this.DownloadLog(this.pictPortraitLOG, this.lblPortraitLOG); }
- /// <summary>
- /// 婚纱LOG下载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDownloadWeddingLOG_Click(object sender, EventArgs e)
- { this.DownloadLog(this.pictWeddingLOG, this.lblWeddingLOG); }
- /// <summary>
- /// 下载图片
- /// </summary>
- /// <param name="pict"></param>
- private void DownloadLog(LYFZ.ComponentLibrary.PictureBoxEx pict, Label lblName)
- {
- if (pict.Image != null)
- {
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
- Bitmap bmp = new Bitmap(pict.Image);
- bmp.Save(dir + "\\" + lblName.Text + ".jpg");
- MessageBoxCustom.Show("下载成功!\r\n下载储存于桌面");
- }
- else
- { MessageBoxCustom.Show("图片未上传!"); }
- }
- /// <summary>
- /// 电话号码限制输入
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPhone_KeyPress(object sender, KeyPressEventArgs e)
- {
- //if (this.txtPhone.Text.Trim().Length > 12)
- //{
- // if (Convert.ToInt32(e.KeyChar) == 8)
- // { }
- // else
- // { e.Handled = true; }
- //}
- if (Convert.ToString(e.KeyChar) == "-")
- {
- //if (this.txtPhone.Text.Trim().IndexOf('-') != -1)
- //{ e.Handled = true; }
- }
- else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- }
- }
|