1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using LYFZ.Model.API;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls
- {
- public class SetCustomControls_SightsColumnHeaderModel
- {
- private string _PgmID = "";
- private string _SightsLevel;
- private string _SightsType;
- private string _SightsOrderID;
- private string _SightsCostPrice;
- private string _SightsRemark;
- /// <summary>
- /// 套系赠送商品ID(用于检查是否修改过套系商品)
- /// </summary>
- public string PgmID
- {
- get { return _PgmID; }
- set { _PgmID = value; }
- }
- /// <summary>
- /// 景点级别
- /// </summary>
- public string SightsLevel
- {
- get { return _SightsLevel; }
- set { _SightsLevel = value; }
- }
- /// <summary>
- /// 景点类别
- /// </summary>
- public string SightsType
- {
- get { return _SightsType; }
- set { _SightsType = value; }
- }
- /// <summary>
- /// 订单景点ID
- /// </summary>
- public string SightsOrderID
- {
- get { return _SightsOrderID; }
- set { _SightsOrderID = value; }
- }
- /// <summary>
- /// 成本价
- /// </summary>
- public string SightsCostPrice
- {
- get { return _SightsCostPrice; }
- set { _SightsCostPrice = value; }
- }
- /// <summary>
- /// 景点备注
- /// </summary>
- public string SightsRemark
- {
- get { return _SightsRemark; }
- set { _SightsRemark = value; }
- }
- }
- public partial class OrderSightsControlsEx : LYFZ.Software.UI.DoorCityProcess.SetCustomControls.OrderSightsControlsEx
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
- LYFZ.BLL.BLL_ErpSystemCategory scbll = new BLL.BLL_ErpSystemCategory();
- LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
- LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
- public int OrdType = -1;
- public bool bUpgrade = false;
- public OrderSightsControlsEx()
- {
- this.btnSightsAdd.Click += btnSightsAdd_Click;
- this.btnSightsDelete.Click += btnSightsDelete_Click;
- this.btnSightsSet.Click += btnSightsSet_Click;
- this.btnReplace.Click += btnReplace_Click;
- this.listViewData_Sights.Click += listViewData_Sights_Click;
- this.listViewData_Sights.MouseDoubleClick += listViewData_Sights_MouseDoubleClick;
- this.txtText.KeyPress += txtText_KeyPress;
- this.txtText.Leave += txtText_Leave;
- this.cmbtreevText.Leave += cmbtreevText_Leave;
- this.dtpText.Leave += dtpText_Leave;
- this.lblBrowseSelect.Click += lblBrowseSelect_Click;
- this.IsClickToolbox = false;
- this.listViewData_Sights.View = View.Details;
- this.listViewData_Sights.GridLines = true;
- ImageList imgList = new ImageList();
- imgList.ImageSize = new Size(1, 25);
- this.listViewData_Sights.SmallImageList = imgList;
- string[] StrColumns = "景点名称,景点价格,来源,景点类别,拍摄级别,服装套数,预拍时间,备注".Split(',');
- int SurplusCount = 230 + 80 * 3 + 80 + 70 + 5 + 90;
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- switch (StrColumns[i].Trim())
- {
- case "景点名称": ch.Width = 230; break;
- case "服装套数": ch.Width = 80; break;
- case "来源": ch.Width = 70; break;
- case "预拍时间": ch.Width = 90; break;
- case "备注": ch.Width = this.listViewData_Sights.Width - SurplusCount; break;
- default: ch.Width = 80; break;
- }
- switch (StrColumns[i].Trim())
- {
- case "景点名称": ch.TextAlign = HorizontalAlignment.Left; break;
- case "服装套数":
- case "拍摄级别":
- case "来源":
- case "景点类别": ch.TextAlign = HorizontalAlignment.Center; break;
- case "景点价格": ch.TextAlign = HorizontalAlignment.Right; break;
- }
- this.listViewData_Sights.Columns.Add(ch);
- }
- DataTable tbl = scbll.GetCategory("Sc_ClassCode,Sc_ClassName", "Sc_ClassParentID ='" + scbll.GetCategory("ID", "Sc_ClassCode = 'BEBBBCADFEBEJBGD'").Tables[0].Rows[0]["ID"].ToString().Trim() + "'").Tables[0];
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- TreeNode root = new TreeNode();
- root.Text = tbl.Rows[i]["Sc_ClassName"].ToString().Trim();
- root.Tag = tbl.Rows[i]["Sc_ClassCode"].ToString().Trim();
- this.cmbtreevText.Nodes.Add(root);
- }
- }
- void dtpText_Leave(object sender, EventArgs e)
- {
- this.listViewData_Sights.SelectedItems[0].SubItems["预拍时间"].Text = this.dtpText.DateValue;
- this.dtpText.Visible = false;
- }
- /// <summary>
- /// 登录者员工ID
- /// </summary>
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- #region 点击列显示下拉框
- /// <summary>
- /// 列表点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Sights_Click(object sender, EventArgs e)
- {
- this.txtText.Visible = false;
- this.cmbtreevText.Visible = false;
- }
- /// <summary>
- /// 列表双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Sights_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- this.listViewData_Sights_Click(this, null);
- ListViewHitTestInfo info = this.listViewData_Sights.HitTest(e.X, e.Y);
- if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
- {
- Rectangle rect = info.SubItem.Bounds;
- switch (info.SubItem.Name.Trim())
- {
- case "备注":
- case "服装套数":
- if (info.SubItem.Name.Trim() == "备注")
- { this.txtText.MaxLength = 400; }
- else
- {
- if (!string.IsNullOrEmpty(this.listViewData_Sights.SelectedItems[0].SubItems["来源"].Text.Trim()))
- { return; }
- else
- { this.txtText.MaxLength = 3; }
- }
- this.txtText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 2);
- this.txtText.Size = rect.Size;
- this.txtText.Visible = true;
- this.txtText.Tag = info.SubItem.Name.Trim();
- this.txtText.Text = info.SubItem.Text.Trim();
- this.txtText.Focus();
- break;
- case "拍摄级别":
- this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 4);
- this.cmbtreevText.Size = rect.Size;
- this.cmbtreevText.Visible = true;
- this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
- this.cmbtreevText.Focus();
- break;
- case "预拍时间":
- this.dtpText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 4);
- this.dtpText.Size = rect.Size;
- this.dtpText.Visible = true;
- this.dtpText.DateValue = (info.SubItem.Text.Trim());
- this.dtpText.Focus();
- break;
- }
- }
- }
- /// <summary>
- /// 服装套数输入限制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtText_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (this.txtText.Tag != null)
- {
- if (this.txtText.Tag.ToString().Trim() == "服装套数")
- {
- //if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- //{ e.Handled = true; }
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
- { e.Handled = true; }
- }
- }
- }
- /// <summary>
- /// 服装套数离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtText_Leave(object sender, EventArgs e)
- {
- if (this.txtText.Tag != null)
- {
- if (this.txtText.Tag.ToString().Trim() == "服装套数")
- {
- if (!string.IsNullOrEmpty(this.txtText.Text.Trim()))
- {
- try
- {
- if (!LYFZ.Command.Command_Validate.IsNumeric(this.txtText.Text.Trim()))
- { this.txtText.Text = ""; }
- }
- catch
- { this.txtText.Text = ""; }
- }
- try
- { this.listViewData_Sights.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text; }
- catch
- { }
- }
- else
- { this.listViewData_Sights.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = this.txtText.Text.Trim(); }
- }
- this.listViewData_Sights_Click(this, null);
- }
- /// <summary>
- /// 拍摄级别离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevText_Leave(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
- ColumnModel.SightsLevel = this.cmbtreevText.Tag.ToString().Trim();
- this.listViewData_Sights.SelectedItems[0].SubItems["拍摄级别"].Text = this.cmbtreevText.Text.Trim();
- this.listViewData_Sights_Click(this, null);
- }
- #endregion
- /// <summary>
- /// 景点添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSightsAdd_Click(object sender, EventArgs e)
- {
- if (!this.IsClickToolbox)
- { MessageBoxCustom.Show("请先选择套系名称!"); return; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.SightsAddSmallForm frm = new SetSmallForm.SightsAddSmallForm();
- frm.LoadType = "景点设置";
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.SetOrderSightsValue(frm.mlist, frm.tbl); }
- }
- /// <summary>
- /// 景点删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSightsDelete_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Sights.SelectedItems.Count > 0)
- {
- if (string.IsNullOrEmpty(this.listViewData_Sights.SelectedItems[0].SubItems["来源"].Text.Trim()))
- {
- bool isDelete = true;
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() != "0")
- { MessageBoxCustom.Show("此景点拍照已OK,不能删除"); isDelete = false; }
- else
- {
- LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel("Ord_Number", this.StrOrdNumber);
- LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", tbl.Rows[0]["Ordpg_ViceNumber"].ToString().Trim());
- LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(ord_model, vmodel);
- List<string> sPhotoList = sPh.GetSpecifyTypePhotoList(Model.Model_ErpOrder.DirectoryType.PrimitivePicture, BLL.SelectPhotoHandling.PhotoType.Small, this.listViewData_Sights.SelectedItems[0].Text.Trim());
- if (sPhotoList.Count == 0)
- {
- if (MessageBoxCustom.Show("您确定要删除此拍摄景点吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- this.listViewData_Sights.Items.Remove(this.listViewData_Sights.SelectedItems[0]);
- isDelete = false;
- }
- else
- { MessageBoxCustom.Show("此景点已导片,不能删除"); isDelete = false; }
- }
- }
- }
- }
- if (isDelete)
- { this.listViewData_Sights.Items.Remove(this.listViewData_Sights.SelectedItems[0]); }
- }
- }
- if ((this.listViewData_Sights.Items.Count - 1)<0)
- {
- return;
- }
- this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
- this.listViewData_Sights.Focus();
- }
- public void DeleteSightByNotAction()
- {
- foreach (ListViewItem sightItem in this.listViewData_Sights.Items)
- {
- if (string.IsNullOrEmpty(sightItem.SubItems["来源"].Text.Trim()))
- {
- bool isDelete = true;
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)sightItem.Tag;
- if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() != "0")
- { isDelete = false; }
- else
- {
- LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel("Ord_Number", this.StrOrdNumber);
- LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", tbl.Rows[0]["Ordpg_ViceNumber"].ToString().Trim());
- LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(ord_model, vmodel);
- List<string> sPhotoList = sPh.GetSpecifyTypePhotoList(Model.Model_ErpOrder.DirectoryType.PrimitivePicture, BLL.SelectPhotoHandling.PhotoType.Small, sightItem.Text.Trim());
- if (sPhotoList.Count == 0)
- {
- this.listViewData_Sights.Items.Remove(sightItem);
- isDelete = false;
- }
- else
- { isDelete = false; }
- }
- }
- }
- }
- if (isDelete)
- { this.listViewData_Sights.Items.Remove(sightItem); }
- }
- }
- if ((this.listViewData_Sights.Items.Count - 1) < 0)
- {
- return;
- }
- this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
- this.listViewData_Sights.Focus();
- this.bUpgrade = true;
- }
- /// <summary>
- /// 景点设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSightsSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmAttractionsSet frm = new InitialSet.FrmAttractionsSet("0");
- frm.StrSightsType = "0";
- frm.ShowDialog();
- this.listViewData_Sights.Focus();
- }
- /// <summary>
- /// 更换
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnReplace_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- if (this.listViewData_Sights.SelectedItems.Count <= 0)
- {
- MessageBoxCustom.Show("请选择你要更换的景点"); return;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() == "1")
- {
- MessageBoxCustom.Show("此景点已拍照OK,不能更换");
- this.listViewData_Sights.Focus();
- return;
- }
- }
- }
- }
- if (!this.IsClickToolbox)
- { MessageBoxCustom.Show("请先选择套系名称!"); return; }
- if (this.listViewData_Sights.SelectedItems.Count != 1)
- { MessageBoxCustom.Show("请选择要更换的景点!"); return; }
- List<string> SightsList = new List<string>();
- foreach (ListViewItem item in this.listViewData_Sights.Items)
- { SightsList.Add(item.Text.Trim()); }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.SightsAddSmallForm frm = new SetSmallForm.SightsAddSmallForm();
- frm.GetType = "更换";
- frm.LoadType = "景点设置";
- frm.RemovedSightsList = SightsList;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- string StrOldSightsName = this.listViewData_Sights.SelectedItems[0].Text;
- LYFZ.Model.Model_ErpTheScenery modelss = frm.mlist[0];
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
- ColumnModel.SightsLevel = modelss.Tsc_Rating.Trim();
- ColumnModel.SightsType = modelss.Tcs_Category.ToString().Trim();
- ColumnModel.SightsCostPrice = modelss.Tsc_CostPrice.ToString().Trim();
- ColumnModel.SightsRemark = modelss.Tsc_Remark;
- this.listViewData_Sights.SelectedItems[0].Text = modelss.Tsc_Name;
- this.listViewData_Sights.SelectedItems[0].SubItems["景点价格"].Text = modelss.Tsc_SalesPrice.ToString().Trim();
- this.listViewData_Sights.SelectedItems[0].SubItems["景点类别"].Text = modelss.Tcs_Category == 0 ? "内景" : "外景";
- this.listViewData_Sights.SelectedItems[0].SubItems["服装套数"].Text = "1";
- string StrClassName = "";
- DataRow dtRow = frm.tbl.Rows.Find(modelss.Tsc_Rating.Trim());
- if (dtRow == null)
- { StrClassName = ""; }
- else
- { StrClassName = dtRow["Sc_ClassName"].ToString().Trim(); }
- this.listViewData_Sights.SelectedItems[0].SubItems["拍摄级别"].Text = StrClassName;
- this.listViewData_Sights.SelectedItems[0].SubItems["备注"].Text = "景点由'" + StrOldSightsName + "'更换为'" + this.listViewData_Sights.SelectedItems[0].Text + "'";
- }
- this.listViewData_Sights.Focus();
- }
- /// <summary>
- /// 浏览选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void lblBrowseSelect_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
- frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.景点浏览;
- List<string> OldSelectStyleList = new List<string>();
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- OldSelectStyleList.Add(this.listViewData_Sights.Items[i].Text.Trim());
- }
- frm.OldSelectStyleList = OldSelectStyleList;
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<string> strList = frm.SelectStyleList;
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- for (int j = 0; j < strList.Count; j++)
- {
- if (this.listViewData_Sights.Items[i].Text.Trim() == strList[j].Trim())
- {
- strList.RemoveAt(j);
- break;
- }
- }
- }
- string StrWhere = "";
- for (int i = 0; i < strList.Count; i++)
- {
- StrWhere += "'" + strList[i].Trim() + "',";
- }
- if (!string.IsNullOrEmpty(StrWhere))
- {
- LYFZ.BLL.BLL_ErpTheScenery tsybll = new BLL.BLL_ErpTheScenery();
- List<LYFZ.Model.Model_ErpTheScenery> mlist = tsybll.GetModelList("Tsc_Name in (" + StrWhere.TrimEnd(',') + ") And Tsc_Type = '0'");
- //DataTable tbl = orbll.GetView_Custom("tb_ErpTheScenery", StrWhere: "ID in (" + StrWhere.TrimEnd(',') + ")", ShowColumnName: "").Tables[0];
- DataTable tbl = new LYFZ.BLL.BLL_ErpSystemCategory().GetAllList().Tables[0];
- tbl.PrimaryKey = new DataColumn[] { tbl.Columns["Sc_ClassCode"] };
- this.SetOrderSightsValue(mlist, tbl);
- }
- }
- }
- #region 属性
- private bool _isClickToolbox;
- /// <summary>
- /// 是否能点击工具箱
- /// </summary>
- public bool IsClickToolbox
- {
- get { return _isClickToolbox; }
- set { _isClickToolbox = value; }
- }
- private string _strOrdNumber;
- /// <summary>
- /// 订单号
- /// </summary>
- public string StrOrdNumber
- {
- get { return _strOrdNumber; }
- set { _strOrdNumber = value; }
- }
- private bool _isShowSightsSet;
- /// <summary>
- /// 是否显示景点设置
- /// </summary>
- public bool IsShowSightsSet
- {
- get { return _isShowSightsSet; }
- set
- {
- _isShowSightsSet = value;
- this.btnSightsSet.Enabled = _isShowSightsSet;
- }
- }
- /// <summary>
- /// 获取商品的总价
- /// </summary>
- /// <returns></returns>
- public decimal GetSightsAoumnt()
- {
- decimal dec_Aoumnt = 0;
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
- dec_Aoumnt += Convert.ToDecimal(ColumnModel.SightsCostPrice);
- }
- return dec_Aoumnt;
- }
- /// <summary>
- /// 获取列表详情数据
- /// </summary>
- /// <returns></returns>
- public string GetOrderSightsContentDetails()
- {
- string StrContentDetails = "";
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- { StrContentDetails += "名称:" + this.listViewData_Sights.Items[i].Text.Trim() + " 套数:" + this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim() + " ;"; }
- return StrContentDetails;
- }
- /// <summary>
- /// 获取当前列表
- /// </summary>
- /// <returns></returns>
- public DataTable GetListViewData()
- {
- DataTable NewTable = new DataTable();
- NewTable.Columns.Add("PgmID", typeof(string));
- for (int i = 0; i < this.listViewData_Sights.Columns.Count; i++)
- {
- NewTable.Columns.Add(this.listViewData_Sights.Columns[i].Text.Trim(), typeof(string));
- }
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- if (string.IsNullOrEmpty(this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim()))
- {
- DataRow newRow = NewTable.NewRow();
- for (int j = 0; j < this.listViewData_Sights.Columns.Count; j++)
- {
- if (j == 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
- newRow["PgmID"] = ColumnModel.PgmID;
- newRow[this.listViewData_Sights.Columns[j].Text.Trim()] = this.listViewData_Sights.Items[i].Text.Trim();
- }
- else
- { newRow[this.listViewData_Sights.Columns[j].Text.Trim()] = this.listViewData_Sights.Items[i].SubItems[this.listViewData_Sights.Columns[j].Text.Trim()].Text.Trim(); }
- }
- NewTable.Rows.Add(newRow);
- }
- }
- return NewTable;
- }
- #endregion
- /// <summary>
- /// 绑定景点的数据信息
- /// </summary>
- /// <param name="erpModel"></param>
- public void GetOrderSightsValueData(Api_ErpOrderModel erpModel)
- {
- erpModel.OrderSightData = new List<Api_StagesModel>();
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
- string strReservationPhotographyTime = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim();
- if (this.listViewData_Sights.Items[i].SubItems["预拍时间"].Tag != null)
- {
- string[] dateTimeList = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Tag.ToString().Split(' ');
- if (dateTimeList.Length > 1)
- {
- strReservationPhotographyTime = strReservationPhotographyTime + " " + dateTimeList[1].Trim();
- }
- }
- Api_StagesModel model = new Api_StagesModel()
- {
- SightsOrderName = this.listViewData_Sights.Items[i].Text,
- PgmID = ColumnModel.PgmID,
- SightsLevel = ColumnModel.SightsLevel,
- SightsOrderID = ColumnModel.SightsOrderID,
- SightsCostPrice = ColumnModel.SightsCostPrice,
- SightsType = ColumnModel.SightsType,
- SightsRemark = this.listViewData_Sights.Items[i].SubItems["备注"].Text.Trim(),
- SightsPrice = this.listViewData_Sights.Items[i].SubItems["景点价格"].Text.Trim(),
- Source = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim(),
- WearCount = Convert.ToInt32(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim()),
- StagesReservationPhotographyTime = strReservationPhotographyTime.Trim()
- };
- erpModel.OrderSightData.Add(model);
- }
- }
- /// <summary>
- /// 获取订单景点数据
- /// </summary>
- /// <param name="IsMagess">是否检测无数据提示:true为提示(如用于保存订单);false为不提示(如用于保存意向订单)</param>
- /// <returns></returns>
- public List<Helper.CommandInfo> GetOrderSightsValue(Hashtable htData_RegisterAndBottom, string StrNumber, DateTime strTime, ref bool IsContinue, bool IsMagess = true)
- {
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- LYFZ.Model.Model_ErpOrderDigital ViceModel = orvbll.GetModel("Ordv_ViceNumber", StrNumber + "_001");
- if (this.listViewData_Sights.Items.Count > 0)
- {
- int WeddingCount = 0;
- int PhotoCount = 0;
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.Model.Model_ErpSystemConfigure systemModel = sgbll.GetModel("Sconfig_Code", "DayRemind");
- if (systemModel.ID > 0 && !string.IsNullOrEmpty(systemModel.Sconfig_Value))
- {
- string[] StrArray = systemModel.Sconfig_Value.Trim().Split('|');
- string[] StrArray2 = StrArray[0].Trim().Split(',');
- if (StrArray2.Length >= 1 && StrArray2[0].Trim().Length > 0)
- { WeddingCount = Convert.ToInt32(StrArray2[0].Trim()); }
- if (StrArray2.Length >= 3 && StrArray2[2].Trim().Length > 0)
- { PhotoCount = Convert.ToInt32(StrArray2[2].Trim()); }
- }
- if (ViceModel.ID <= 0)
- {
- ViceModel = new Model.Model_ErpOrderDigital();
- ViceModel.Ordv_Number = StrNumber;
- ViceModel.Ordv_ViceNumber = StrNumber + "_001";
- ViceModel.Ordv_DigitalNumber = 1;
- ViceModel.Ordv_IntoBottomAddPickQuantity = 0;
- ViceModel.Ordv_IntoRegisterAddPickQuantity = 0;
- ViceModel.Ordv_ClothingDispatcher = "";
- ViceModel.Ordv_ClothingName = "";
- ViceModel.Ordv_ClothingRemark = "";
- ViceModel.Ordv_ClothingStatus = "0";
- ViceModel.Ordv_CreateDatetime = strTime;
- ViceModel.Ordv_CreateName = strUserID;
- ViceModel.Ordv_DesignerDispatcher = "";
- ViceModel.Ordv_DesignerName = "";
- ViceModel.Ordv_DesignerStatus = "0";
- ViceModel.Ordv_DesignValidation = "";
- ViceModel.Ordv_EarlyRepairDispatcher = "";
- ViceModel.Ordv_EarlyRepairName = "";
- ViceModel.Ordv_EarlyRepairStatus = "0";
- ViceModel.Ordv_FilmSelectionDispatcher = "";
- ViceModel.Ordv_FilmSelectionName = "";
- ViceModel.Ordv_FilmSelectionStatus = "0";
- ViceModel.Ordv_LookDesignClaim = "";
- ViceModel.Ordv_LookDesignDispatcher = "";
- ViceModel.Ordv_LookDesignName = "";
- ViceModel.Ordv_LookDesignStatus = "0";
- ViceModel.Ordv_RefinementDispatcher = "";
- ViceModel.Ordv_RefinementName = "";
- ViceModel.Ordv_RefinementStatus = "0";
- ViceModel.Ordv_ReservationClothingName = "";
- ViceModel.Ordv_ReservationDesignerName = "";
- ViceModel.Ordv_ReservationEarlyRepairName = "";
- ViceModel.Ordv_ReservationFilmSelectionName = "";
- ViceModel.Ordv_ReservationLookDesignName = "";
- ViceModel.Ordv_ReservationRefinementName = "";
- ViceModel.Ordv_ReservationSendPhotoName = "";
- ViceModel.Ordv_ReservationSendPhotoStatus = "0";
- ViceModel.Ordv_SelectionDesign = "";
- ViceModel.Ordv_SelectionFilm = "";
- ViceModel.Ordv_UpdateName = "";
- ViceModel.Ordv_IntoRegisterQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantity"].ToString().Trim());
- ViceModel.Ordv_IntoBottomQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantity"].ToString().Trim());
- ViceModel.Ordv_IntoRegisterQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantityPackage"].ToString().Trim());
- ViceModel.Ordv_IntoBottomQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantityPackage"].ToString().Trim());
- ViceModel.Ordv_IntoRegisterQuantity += ViceModel.Ordv_IntoRegisterQuantityPackage;
- if (ViceModel.Ordv_IntoBottomQuantity != -1 && ViceModel.Ordv_IntoBottomQuantityPackage != -1)
- { ViceModel.Ordv_IntoBottomQuantity += ViceModel.Ordv_IntoBottomQuantityPackage; }
- clist.Add(orvbll.GetAddCommandInfo(ViceModel));
- LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = new Model.Model_ErpOrderDigitalStatus();
- modelStatus.Ords_Number = "ORDS_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelStatus.Ords_OrdNumber = ViceModel.Ordv_Number;
- modelStatus.Ords_ViceNumber = ViceModel.Ordv_ViceNumber;
- modelStatus.Ords_DigitalNumber = ViceModel.Ordv_DigitalNumber;
- modelStatus.Ords_OutSendEarlyRepairName = "";
- modelStatus.Ords_OutSendEarlyRepairQuantity = 0;
- modelStatus.Ords_OutSendEarlyRepairStatus = "未发";
- modelStatus.Ords_OutSendEarlyRepairVendor = "";
- modelStatus.Ords_OutSendEarlyRepairVendorQQ = "";
- modelStatus.Ords_PhotographStatus = "未拍";
- modelStatus.Ords_PhotographIntStatus = 0;
- modelStatus.Ords_SightsName = "";
- modelStatus.Ords_Photographer = "";
- modelStatus.Ords_PhotographyAssistant = "";
- modelStatus.Ords_MakeupArtist = "";
- modelStatus.Ords_MakeupAssistant = "";
- modelStatus.Ords_BootDivision = "";
- modelStatus.Ords_BootDivisionAssistant = "";
- modelStatus.Ords_ProductSendStatus = "未发";
- modelStatus.Ords_ProductCompletedStatus = "未完";
- modelStatus.Ords_ProductPickupStatus = "未取";
- modelStatus.Ords_ProductPickupIntStatus = 0;
- modelStatus.Ords_ProductIsExpedited = "否";
- modelStatus.Ords_ServiceStatus = "未进行";
- modelStatus.Ords_ServiceIntStatus = 0;
- clist.Add(orsbll.GetAddCommandInfo(modelStatus));
- }
- else
- {
- ViceModel.Ordv_IntoRegisterQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantity"].ToString().Trim());
- ViceModel.Ordv_IntoBottomQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantity"].ToString().Trim());
- ViceModel.Ordv_IntoRegisterQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantityPackage"].ToString().Trim());
- ViceModel.Ordv_IntoBottomQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantityPackage"].ToString().Trim());
- ViceModel.Ordv_IntoRegisterQuantity += ViceModel.Ordv_IntoRegisterQuantityPackage;
- if (ViceModel.Ordv_IntoBottomQuantity != -1 && ViceModel.Ordv_IntoBottomQuantityPackage != -1)
- { ViceModel.Ordv_IntoBottomQuantity += ViceModel.Ordv_IntoBottomQuantityPackage; }
- clist.Add(orvbll.GetUpdateCommandInfo(ViceModel));
- }
- LYFZ.Model.Model_ErpOrdersPhotography model = null;
- DataTable dt = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
- dt.PrimaryKey = new DataColumn[] { dt.Columns["Ordpg_Sights"] };
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
-
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
- if (ColumnModel.SightsOrderID.Trim().Length > 0)
- {
- DataRow[] dtRows = dt.Select("ID = '" + ColumnModel.SightsOrderID.Trim() + "'");
- if (dtRows.Length <= 0)
- {
- model = new Model.Model_ErpOrdersPhotography();
- model.Ordpg_IDNumber = "JD_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- model.Ordpg_Number = StrNumber;
- model.Ordpg_ViceNumber = StrNumber + "_001";
- model.Ordpg_BootDivision = "";
- model.Ordpg_BootDivisionAssistant = "";
- model.Ordpg_Dispatcher = "";
- model.Ordpg_ImportPhotoer = "";
- model.Ordpg_MakeupArtist = "";
- model.Ordpg_MakeupAssistant = "";
- model.Ordpg_Photographer = "";
- model.Ordpg_PhotographyAssistant = "";
- model.Ordpg_PhotographyStatus = "0";
- model.Ordpg_Remark = "";
- model.Ordpg_ReservationBootDivision = "";
- model.Ordpg_ReservationBootDivisionAssistant = "";
- model.Ordpg_ReservationMakeupArtist = "";
- model.Ordpg_ReservationMakeupAssistant = "";
- model.Ordpg_ReservationPhotographyAssistant = "";
- model.Ordpg_ReservationPhotographyName = "";
- model.Ordpg_CreateName = this.strUserID;
- model.Ordpg_CreateDateTime = strTime;
- model.Ordpg_UpdateName = "";
- model.Ordpg_OpenOrderSource = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim();
- }
- else
- {
- model = opbll.DataRowToModel(dtRows[0]);
- model.Ordpg_UpdateDateTime = strTime;
- model.Ordpg_UpdateName = this.strUserID;
- dt.Rows.Remove(dtRows[0]);
- }
- }
- else
- {
- DataRow dtRow = dt.Rows.Find(this.listViewData_Sights.Items[i].Text.Trim());
- if (dtRow != null)
- {
- model = opbll.DataRowToModel(dtRow);
- model.Ordpg_UpdateDateTime = strTime;
- model.Ordpg_UpdateName = this.strUserID;
- dt.Rows.Remove(dtRow);
- }
- else
- {
- model = new Model.Model_ErpOrdersPhotography();
- model.Ordpg_IDNumber = "JD_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- model.Ordpg_Number = StrNumber;
- model.Ordpg_ViceNumber = StrNumber + "_001";
- model.Ordpg_BootDivision = "";
- model.Ordpg_BootDivisionAssistant = "";
- model.Ordpg_Dispatcher = "";
- model.Ordpg_ImportPhotoer = "";
- model.Ordpg_MakeupArtist = "";
- model.Ordpg_MakeupAssistant = "";
- model.Ordpg_Photographer = "";
- model.Ordpg_PhotographyAssistant = "";
- model.Ordpg_PhotographyStatus = "0";
- model.Ordpg_Remark = "";
- model.Ordpg_ReservationBootDivision = "";
- model.Ordpg_ReservationBootDivisionAssistant = "";
- model.Ordpg_ReservationMakeupArtist = "";
- model.Ordpg_ReservationMakeupAssistant = "";
- model.Ordpg_ReservationPhotographyAssistant = "";
- model.Ordpg_ReservationPhotographyName = "";
- model.Ordpg_CreateName = this.strUserID;
- model.Ordpg_CreateDateTime = strTime;
- model.Ordpg_UpdateName = "";
- model.Ordpg_OpenOrderSource = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim();
- }
- }
- if (this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim() != "")
- {
- string StrPreShotDateTime = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim();
- #region 判断预约日期是否满档或需要授权
- if (!string.IsNullOrEmpty(StrPreShotDateTime))
- {
- bool IsShowPrompt = true;
- if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(model.Ordpg_ReservationPhotographyTime)))
- {
- if (Convert.ToDateTime(StrPreShotDateTime).ToString("yyyy-MM-dd") == LYFZ.Command.Command_Validate.DateTimeToString(model.Ordpg_ReservationPhotographyTime))
- { IsShowPrompt = false; }
- }
- if (IsShowPrompt && OrdType>-1)
- {
- string StrWhere = " Ord_Type in ('" + OrdType + "') And Ordpg_ViceNumber != '" + model.Ordpg_ViceNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_ReservationPhotographyTime", StrPreShotDateTime, StrPreShotDateTime);
- string StrTableName = "tb_ErpOrdersPhotography Left Join tb_ErpOrderDigital on Ordv_ViceNumber = Ordpg_ViceNumber Left Join tb_ErpOrder on Ord_Number = Ordpg_Number";
- string StrColumnName = " distinct Ordv_ViceNumber";
- DataTable photographyDt = orbll.GetView_Custom(StrTableName, StrWhere: StrWhere, ShowColumnName: StrColumnName, GroupBy: StrColumnName).Tables[0];
- if (dt.Rows.Count >= (OrdType==0?WeddingCount:PhotoCount))
- {
- if (MessageBoxCustom.Show("拍摄名称‘" + model.Ordpg_Sights + "’\r\n预拍日期‘" + StrPreShotDateTime + "’\r\n可安排的‘" + (OrdType == 0 ? "婚纱单" : "写真单") + ":" + (OrdType == 0 ? WeddingCount : PhotoCount) + "单’已满。\r\n是否要继续安排?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { IsContinue = true; return null; }
- if (!LYFZ.Software.MainBusiness.CameraControlBook.PublicClass.GetMagess(IsShowPrompt: false))
- { IsContinue = true; return null; }
- }
- }
- }
- #endregion
- model.Ordpg_ReservationPhotographyTime = Convert.ToDateTime(StrPreShotDateTime);
- model.Ordpg_ReservationPhotographyDividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- }
- else
- { model.Ordpg_ReservationPhotographyTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); }
- model.Ordpg_Sights = this.listViewData_Sights.Items[i].Text.Trim();
- model.Ordpg_SightsRemark = ColumnModel.SightsRemark;
- model.Ordpg_CostPrice = Convert.ToDecimal(ColumnModel.SightsCostPrice);
- model.Ordpg_SalesPrice = Convert.ToDecimal(this.listViewData_Sights.Items[i].SubItems["景点价格"].Text.Trim());
- model.Ordpg_ApparelQuantity = Convert.ToInt32(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim());
- model.Ordpg_OpenOrderRemark = this.listViewData_Sights.Items[i].SubItems["备注"].Text.Trim();
- model.Ordpg_SightsLevel = ColumnModel.SightsLevel.Trim();
- model.Ordpg_SightsType = ColumnModel.SightsType.Trim();
- if (model.ID > 0)
- { clist.Add(opbll.GetUpdateCommandInfo(model)); }
- else
- { clist.Add(opbll.GetAddCommandInfo(model)); }
- }
- //for (int i = 0; i < RemoveList.Count; i++)
- //{ dt.Rows.Remove(RemoveList[i]); }
- for (int i = 0; i < dt.Rows.Count; i++)
- { clist.Add(opbll.GetDeleteCommandInfo("ID", "=", dt.Rows[i]["ID"])); }
- }
- else
- {
- if (IsMagess)
- { MessageBoxCustom.Show("拍摄次数至少要有一项!"); IsContinue = true; return null; }
- else
- {
- if (ViceModel.ID > 0)
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- clist.Add(opbll.GetDeleteCommandInfo("ID", "=", dt.Rows[i]["ID"]));
- }
- }
- }
- }
- return clist;
- }
- /// <summary>
- /// 设置绑定订单景点数据
- /// </summary>
- /// <param name="mlist"></param>
- public void SetOrderSightsValue(List<LYFZ.Model.Model_ErpTheScenery> mlist, DataTable tbl)
- {
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- for (int j = 0; j < mlist.Count; j++)
- {
- if (this.listViewData_Sights.Items[i].Text.Trim() == mlist[j].Tsc_Name.Trim())
- {
- mlist.RemoveAt(j);
- break;
- }
- }
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
- for (int i = 0; i < mlist.Count; i++)
- {
- ListViewItem lvItem = new ListViewItem();
- ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
- ColumnModel.SightsLevel = mlist[i].Tsc_Rating.Trim();
- ColumnModel.SightsType = mlist[i].Tcs_Category.ToString().Trim();
- ColumnModel.SightsOrderID = "";
- ColumnModel.SightsCostPrice = mlist[i].Tsc_CostPrice.ToString().Trim();
- ColumnModel.SightsRemark = mlist[i].Tsc_Remark;
- lvItem.Tag = ColumnModel;
- lvItem.Text = mlist[i].Tsc_Name.Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点价格";
- ListSubItem.Text = mlist[i].Tsc_SalesPrice.ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "来源";
- ListSubItem.Text = "";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点类别";
- ListSubItem.Text = mlist[i].Tcs_Category == 0 ? "内景" : "外景";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "拍摄级别";
- DataRow dtRow = tbl.Rows.Find(mlist[i].Tsc_Rating.Trim());
- if (dtRow == null)
- { ListSubItem.Text = ""; }
- else
- { ListSubItem.Text = dtRow["Sc_ClassName"].ToString().Trim(); }
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "服装套数";
- ListSubItem.Text = "1";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "预拍时间";
- ListSubItem.Text = "";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "备注";
- ListSubItem.Text = "";
- lvItem.SubItems.Add(ListSubItem);
- if ((this.listViewData_Sights.Items.Count % 2) > 0)
- { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
- else
- { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
- this.listViewData_Sights.Items.Add(lvItem);
- }
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- { this.listViewData_Sights.Items[i].Selected = false; }
- this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
- this.listViewData_Sights.Focus();
- }
- /// <summary>
- /// 加载时订单拍摄景点数据
- /// </summary>
- /// <param name="mlist"></param>
- public void SetOrderSightsValue(string StrNumber, string StrSeriesName)
- {
- this.btnReplace.Visible = true;
- if(bUpgrade)
- {
- this.DeleteSightByNotAction();
- }
- else
- {
- this.listViewData_Sights.Items.Clear();
- }
-
- if (!string.IsNullOrEmpty(StrSeriesName))
- { this.IsClickToolbox = true; }
- string StrTableName = "(SELECT Ordpg_Number,Ordpg_ViceNumber,tb_ErpOrdersPhotography.ID,Ordpg_Sights,Ordpg_ApparelQuantity,Ordpg_SightsLevel,Sc_ClassName,Ordpg_SightsType,Ordpg_OpenOrderRemark,Ordpg_OpenOrderSource," +
- "case when Ordpg_SightsType = '0' then '内景' else '外景' end AS Ordpg_SightsTypeText,case when Ordpg_CostPrice is not null then Ordpg_CostPrice else Tsc_CostPrice end as Ordpg_CostPrice,Ordpg_SalesPrice," +
- "case when Ordpg_SightsRemark is not null then Ordpg_SightsRemark else Tsc_Remark end AS Ordpg_SightsRemark,Ordpg_ReservationPhotographyTime FROM tb_ErpOrdersPhotography Left Join tb_ErpTheScenery on Tsc_Name = Ordpg_Sights And Tsc_Type = '0' " +
- "Left Join tb_ErpSystemCategory on Sc_ClassCode = Ordpg_SightsLevel) AS tb";
- DataTable tbl = orbll.GetView_Custom(StrTableName, StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- ListViewItem lvItem = new ListViewItem();
- ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
- ColumnModel.SightsLevel = tbl.Rows[i]["Ordpg_SightsLevel"].ToString().Trim();
- ColumnModel.SightsType = tbl.Rows[i]["Ordpg_SightsType"].ToString().Trim();
- ColumnModel.SightsOrderID = tbl.Rows[i]["ID"].ToString().Trim();
- ColumnModel.SightsCostPrice = tbl.Rows[i]["Ordpg_CostPrice"].ToString().Trim();
- ColumnModel.SightsRemark = tbl.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = tbl.Rows[i]["Ordpg_Sights"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点价格";
- ListSubItem.Text = tbl.Rows[i]["Ordpg_SalesPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "来源";
- ListSubItem.Text = tbl.Rows[i]["Ordpg_OpenOrderSource"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点类别";
- ListSubItem.Text = tbl.Rows[i]["Ordpg_SightsTypeText"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "拍摄级别";
- ListSubItem.Text = tbl.Rows[i]["Sc_ClassName"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "服装套数";
- ListSubItem.Text = tbl.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "预拍时间";
- if (tbl.Rows[i]["Ordpg_ReservationPhotographyTime"] != null)
- {
- ListSubItem.Text = tbl.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim().Split(' ')[0];
- }
- ListSubItem.Tag = tbl.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "备注";
- ListSubItem.Text = tbl.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- if ((this.listViewData_Sights.Items.Count % 2) > 0)
- { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
- else
- { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
- this.listViewData_Sights.Items.Add(lvItem);
- }
- }
- /// <summary>
- /// 加载时订单拍摄景点数据
- /// </summary>
- /// <param name="listStages"></param>
- /// <param name="dtSet"></param>
- public string SetOrderSightsValue(DataRow[] dtRows, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType)
- {
- string StrDeleteSights = "";
- if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
- {
- if (!bUpgrade)
- {
- this.listViewData_Sights.Items.Clear();
- }
- else
- {
- DeleteSightByNotAction();
- }
- this.btnReplace.Visible = false;
- }
- else
- { this.RemovePackageItem(); }
- this.IsClickToolbox = true;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
- string StrRepeatSightsName = "";
- for (int i = 0; i < dtRows.Length; i++)
- {
- bool IsFind = false;
- if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
- {
- for (int j = 0; j < this.listViewData_Sights.Items.Count; j++)
- {
- if (this.listViewData_Sights.Items[j].Text.Trim() == dtRows[i]["Pgm_ProductName"].ToString().Trim())
- {
- StrRepeatSightsName += "[" + dtRows[i]["Pgm_ProductName"].ToString().Trim() + "],";
- IsFind = true;
- break;
- }
- }
- }
- if (!IsFind)
- {
- if (!string.IsNullOrEmpty(dtRows[i]["ID"].ToString().Trim()))
- {
- if (BindSightExist(dtRows[i]["Pgm_ProductName"].ToString().Trim()))
- {
- continue;
- }
- ListViewItem lvItem = new ListViewItem();
- ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
- ColumnModel.PgmID = dtRows[i]["PgmID"].ToString().Trim();
- ColumnModel.SightsLevel = dtRows[i]["Tsc_Rating"].ToString().Trim();
- ColumnModel.SightsType = dtRows[i]["Tcs_Category"].ToString().Trim();
- ColumnModel.SightsOrderID = "";
- ColumnModel.SightsCostPrice = dtRows[i]["Tsc_CostPrice"].ToString().Trim();
- ColumnModel.SightsRemark = dtRows[i]["Tsc_Remark"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = dtRows[i]["Pgm_ProductName"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点价格";
- ListSubItem.Text = dtRows[i]["Tsc_SalesPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "来源";
- ListSubItem.Text = dtRows[i]["TaoXiNameSource"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "景点类别";
- ListSubItem.Text = dtRows[i]["Tcs_CategoryText"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "拍摄级别";
- ListSubItem.Text = dtRows[i]["Sc_ClassName"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "服装套数";
- ListSubItem.Text = dtRows[i]["Pgm_Quantity"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "预拍时间";
- ListSubItem.Text = "";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "备注";
- ListSubItem.Text = "";
- lvItem.SubItems.Add(ListSubItem);
- if ((this.listViewData_Sights.Items.Count % 2) > 0)
- { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
- else
- { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
- this.listViewData_Sights.Items.Add(lvItem);
- }
- else
- { StrDeleteSights += dtRows[i]["Pgm_ProductName"].ToString().Trim() + ","; }
- }
- }
- if (StrDeleteSights.Trim() != "")
- { StrDeleteSights = "有景点已删除,已删除景点为:" + StrDeleteSights.TrimEnd(',') + ";"; }
- if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
- { this.GetIsActivity(IsActivity); }
- if (!string.IsNullOrEmpty(StrRepeatSightsName))
- { MessageBoxCustom.Show("订单套系景点有包含礼包景点:\r\n" + StrRepeatSightsName.TrimEnd(',')); }
- return StrDeleteSights;
- }
- bool BindSightExist(string sightText)
- {
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- if (this.listViewData_Sights.Items[i].Text.ToLower().Equals(sightText.ToLower()))
- {
- return true;
- }
- }
- return false;
- }
- /// <summary>
- /// 移除礼包的项目
- /// </summary>
- public void RemovePackageItem()
- {
- if (this.listViewData_Sights.Items.Count > 0)
- {
- List<ListViewItem> listItem = new List<ListViewItem>();
- for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
- {
- if (!string.IsNullOrEmpty(this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim()))
- { listItem.Add(this.listViewData_Sights.Items[i]); }
- }
- for (int i = 0; i < listItem.Count; i++)
- { this.listViewData_Sights.Items.Remove(listItem[i]); }
- }
- }
- /// <summary>
- /// 是否能操作
- /// </summary>
- /// <param name="IsActivity"></param>
- void GetIsActivity(bool IsActivity)
- {
- this.btnSightsAdd.Enabled = !IsActivity;
- this.btnSightsDelete.Enabled = !IsActivity;
- this.btnSightsSet.Enabled = !IsActivity;
- if (IsActivity && LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ChangeActiveContent)
- {
- this.btnSightsAdd.Enabled = IsActivity;
- this.btnSightsDelete.Enabled = IsActivity;
- this.btnSightsSet.Enabled = IsActivity;
- }
- }
- }
- }
|