OrderSightsControlsEx.cs 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using LYFZ.Model.API;
  11. namespace LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls
  12. {
  13. public class SetCustomControls_SightsColumnHeaderModel
  14. {
  15. private string _PgmID = "";
  16. private string _SightsLevel;
  17. private string _SightsType;
  18. private string _SightsOrderID;
  19. private string _SightsCostPrice;
  20. private string _SightsRemark;
  21. /// <summary>
  22. /// 套系赠送商品ID(用于检查是否修改过套系商品)
  23. /// </summary>
  24. public string PgmID
  25. {
  26. get { return _PgmID; }
  27. set { _PgmID = value; }
  28. }
  29. /// <summary>
  30. /// 景点级别
  31. /// </summary>
  32. public string SightsLevel
  33. {
  34. get { return _SightsLevel; }
  35. set { _SightsLevel = value; }
  36. }
  37. /// <summary>
  38. /// 景点类别
  39. /// </summary>
  40. public string SightsType
  41. {
  42. get { return _SightsType; }
  43. set { _SightsType = value; }
  44. }
  45. /// <summary>
  46. /// 订单景点ID
  47. /// </summary>
  48. public string SightsOrderID
  49. {
  50. get { return _SightsOrderID; }
  51. set { _SightsOrderID = value; }
  52. }
  53. /// <summary>
  54. /// 成本价
  55. /// </summary>
  56. public string SightsCostPrice
  57. {
  58. get { return _SightsCostPrice; }
  59. set { _SightsCostPrice = value; }
  60. }
  61. /// <summary>
  62. /// 景点备注
  63. /// </summary>
  64. public string SightsRemark
  65. {
  66. get { return _SightsRemark; }
  67. set { _SightsRemark = value; }
  68. }
  69. }
  70. public partial class OrderSightsControlsEx : LYFZ.Software.UI.DoorCityProcess.SetCustomControls.OrderSightsControlsEx
  71. {
  72. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  73. LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
  74. LYFZ.BLL.BLL_ErpSystemCategory scbll = new BLL.BLL_ErpSystemCategory();
  75. LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
  76. LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
  77. public int OrdType = -1;
  78. public bool bUpgrade = false;
  79. public OrderSightsControlsEx()
  80. {
  81. this.btnSightsAdd.Click += btnSightsAdd_Click;
  82. this.btnSightsDelete.Click += btnSightsDelete_Click;
  83. this.btnSightsSet.Click += btnSightsSet_Click;
  84. this.btnReplace.Click += btnReplace_Click;
  85. this.listViewData_Sights.Click += listViewData_Sights_Click;
  86. this.listViewData_Sights.MouseDoubleClick += listViewData_Sights_MouseDoubleClick;
  87. this.txtText.KeyPress += txtText_KeyPress;
  88. this.txtText.Leave += txtText_Leave;
  89. this.cmbtreevText.Leave += cmbtreevText_Leave;
  90. this.dtpText.Leave += dtpText_Leave;
  91. this.lblBrowseSelect.Click += lblBrowseSelect_Click;
  92. this.IsClickToolbox = false;
  93. this.listViewData_Sights.View = View.Details;
  94. this.listViewData_Sights.GridLines = true;
  95. ImageList imgList = new ImageList();
  96. imgList.ImageSize = new Size(1, 25);
  97. this.listViewData_Sights.SmallImageList = imgList;
  98. string[] StrColumns = "景点名称,景点价格,来源,景点类别,拍摄级别,服装套数,预拍时间,备注".Split(',');
  99. int SurplusCount = 230 + 80 * 3 + 80 + 70 + 5 + 90;
  100. for (int i = 0; i < StrColumns.Length; i++)
  101. {
  102. ColumnHeader ch = new ColumnHeader();
  103. ch.Text = StrColumns[i].Trim();
  104. switch (StrColumns[i].Trim())
  105. {
  106. case "景点名称": ch.Width = 230; break;
  107. case "服装套数": ch.Width = 80; break;
  108. case "来源": ch.Width = 70; break;
  109. case "预拍时间": ch.Width = 90; break;
  110. case "备注": ch.Width = this.listViewData_Sights.Width - SurplusCount; break;
  111. default: ch.Width = 80; break;
  112. }
  113. switch (StrColumns[i].Trim())
  114. {
  115. case "景点名称": ch.TextAlign = HorizontalAlignment.Left; break;
  116. case "服装套数":
  117. case "拍摄级别":
  118. case "来源":
  119. case "景点类别": ch.TextAlign = HorizontalAlignment.Center; break;
  120. case "景点价格": ch.TextAlign = HorizontalAlignment.Right; break;
  121. }
  122. this.listViewData_Sights.Columns.Add(ch);
  123. }
  124. 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];
  125. for (int i = 0; i < tbl.Rows.Count; i++)
  126. {
  127. TreeNode root = new TreeNode();
  128. root.Text = tbl.Rows[i]["Sc_ClassName"].ToString().Trim();
  129. root.Tag = tbl.Rows[i]["Sc_ClassCode"].ToString().Trim();
  130. this.cmbtreevText.Nodes.Add(root);
  131. }
  132. }
  133. void dtpText_Leave(object sender, EventArgs e)
  134. {
  135. this.listViewData_Sights.SelectedItems[0].SubItems["预拍时间"].Text = this.dtpText.DateValue;
  136. this.dtpText.Visible = false;
  137. }
  138. /// <summary>
  139. /// 登录者员工ID
  140. /// </summary>
  141. string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  142. #region 点击列显示下拉框
  143. /// <summary>
  144. /// 列表点击事件
  145. /// </summary>
  146. /// <param name="sender"></param>
  147. /// <param name="e"></param>
  148. void listViewData_Sights_Click(object sender, EventArgs e)
  149. {
  150. this.txtText.Visible = false;
  151. this.cmbtreevText.Visible = false;
  152. }
  153. /// <summary>
  154. /// 列表双击事件
  155. /// </summary>
  156. /// <param name="sender"></param>
  157. /// <param name="e"></param>
  158. void listViewData_Sights_MouseDoubleClick(object sender, MouseEventArgs e)
  159. {
  160. this.listViewData_Sights_Click(this, null);
  161. ListViewHitTestInfo info = this.listViewData_Sights.HitTest(e.X, e.Y);
  162. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  163. {
  164. Rectangle rect = info.SubItem.Bounds;
  165. switch (info.SubItem.Name.Trim())
  166. {
  167. case "备注":
  168. case "服装套数":
  169. if (info.SubItem.Name.Trim() == "备注")
  170. { this.txtText.MaxLength = 400; }
  171. else
  172. {
  173. if (!string.IsNullOrEmpty(this.listViewData_Sights.SelectedItems[0].SubItems["来源"].Text.Trim()))
  174. { return; }
  175. else
  176. { this.txtText.MaxLength = 3; }
  177. }
  178. this.txtText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 2);
  179. this.txtText.Size = rect.Size;
  180. this.txtText.Visible = true;
  181. this.txtText.Tag = info.SubItem.Name.Trim();
  182. this.txtText.Text = info.SubItem.Text.Trim();
  183. this.txtText.Focus();
  184. break;
  185. case "拍摄级别":
  186. this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 4);
  187. this.cmbtreevText.Size = rect.Size;
  188. this.cmbtreevText.Visible = true;
  189. this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
  190. this.cmbtreevText.Focus();
  191. break;
  192. case "预拍时间":
  193. this.dtpText.Location = new Point(rect.Location.X + this.listViewData_Sights.Location.X + 3, rect.Location.Y + this.listViewData_Sights.Location.Y + 4);
  194. this.dtpText.Size = rect.Size;
  195. this.dtpText.Visible = true;
  196. this.dtpText.DateValue = (info.SubItem.Text.Trim());
  197. this.dtpText.Focus();
  198. break;
  199. }
  200. }
  201. }
  202. /// <summary>
  203. /// 服装套数输入限制
  204. /// </summary>
  205. /// <param name="sender"></param>
  206. /// <param name="e"></param>
  207. void txtText_KeyPress(object sender, KeyPressEventArgs e)
  208. {
  209. if (this.txtText.Tag != null)
  210. {
  211. if (this.txtText.Tag.ToString().Trim() == "服装套数")
  212. {
  213. //if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  214. //{ e.Handled = true; }
  215. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  216. { e.Handled = true; }
  217. if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
  218. { e.Handled = true; }
  219. }
  220. }
  221. }
  222. /// <summary>
  223. /// 服装套数离开事件
  224. /// </summary>
  225. /// <param name="sender"></param>
  226. /// <param name="e"></param>
  227. void txtText_Leave(object sender, EventArgs e)
  228. {
  229. if (this.txtText.Tag != null)
  230. {
  231. if (this.txtText.Tag.ToString().Trim() == "服装套数")
  232. {
  233. if (!string.IsNullOrEmpty(this.txtText.Text.Trim()))
  234. {
  235. try
  236. {
  237. if (!LYFZ.Command.Command_Validate.IsNumeric(this.txtText.Text.Trim()))
  238. { this.txtText.Text = ""; }
  239. }
  240. catch
  241. { this.txtText.Text = ""; }
  242. }
  243. try
  244. { this.listViewData_Sights.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text; }
  245. catch
  246. { }
  247. }
  248. else
  249. { this.listViewData_Sights.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = this.txtText.Text.Trim(); }
  250. }
  251. this.listViewData_Sights_Click(this, null);
  252. }
  253. /// <summary>
  254. /// 拍摄级别离开事件
  255. /// </summary>
  256. /// <param name="sender"></param>
  257. /// <param name="e"></param>
  258. void cmbtreevText_Leave(object sender, EventArgs e)
  259. {
  260. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
  261. ColumnModel.SightsLevel = this.cmbtreevText.Tag.ToString().Trim();
  262. this.listViewData_Sights.SelectedItems[0].SubItems["拍摄级别"].Text = this.cmbtreevText.Text.Trim();
  263. this.listViewData_Sights_Click(this, null);
  264. }
  265. #endregion
  266. /// <summary>
  267. /// 景点添加
  268. /// </summary>
  269. /// <param name="sender"></param>
  270. /// <param name="e"></param>
  271. void btnSightsAdd_Click(object sender, EventArgs e)
  272. {
  273. if (!this.IsClickToolbox)
  274. { MessageBoxCustom.Show("请先选择套系名称!"); return; }
  275. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.SightsAddSmallForm frm = new SetSmallForm.SightsAddSmallForm();
  276. frm.LoadType = "景点设置";
  277. frm.ShowDialog();
  278. if (frm.IsSaveed)
  279. { this.SetOrderSightsValue(frm.mlist, frm.tbl); }
  280. }
  281. /// <summary>
  282. /// 景点删除
  283. /// </summary>
  284. /// <param name="sender"></param>
  285. /// <param name="e"></param>
  286. void btnSightsDelete_Click(object sender, EventArgs e)
  287. {
  288. if (this.listViewData_Sights.SelectedItems.Count > 0)
  289. {
  290. if (string.IsNullOrEmpty(this.listViewData_Sights.SelectedItems[0].SubItems["来源"].Text.Trim()))
  291. {
  292. bool isDelete = true;
  293. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  294. {
  295. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
  296. if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
  297. {
  298. DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
  299. if (tbl.Rows.Count > 0)
  300. {
  301. if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() != "0")
  302. { MessageBoxCustom.Show("此景点拍照已OK,不能删除"); isDelete = false; }
  303. else
  304. {
  305. LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel("Ord_Number", this.StrOrdNumber);
  306. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", tbl.Rows[0]["Ordpg_ViceNumber"].ToString().Trim());
  307. LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(ord_model, vmodel);
  308. List<string> sPhotoList = sPh.GetSpecifyTypePhotoList(Model.Model_ErpOrder.DirectoryType.PrimitivePicture, BLL.SelectPhotoHandling.PhotoType.Small, this.listViewData_Sights.SelectedItems[0].Text.Trim());
  309. if (sPhotoList.Count == 0)
  310. {
  311. if (MessageBoxCustom.Show("您确定要删除此拍摄景点吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  312. { return; }
  313. this.listViewData_Sights.Items.Remove(this.listViewData_Sights.SelectedItems[0]);
  314. isDelete = false;
  315. }
  316. else
  317. { MessageBoxCustom.Show("此景点已导片,不能删除"); isDelete = false; }
  318. }
  319. }
  320. }
  321. }
  322. if (isDelete)
  323. { this.listViewData_Sights.Items.Remove(this.listViewData_Sights.SelectedItems[0]); }
  324. }
  325. }
  326. if ((this.listViewData_Sights.Items.Count - 1)<0)
  327. {
  328. return;
  329. }
  330. this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
  331. this.listViewData_Sights.Focus();
  332. }
  333. public void DeleteSightByNotAction()
  334. {
  335. foreach (ListViewItem sightItem in this.listViewData_Sights.Items)
  336. {
  337. if (string.IsNullOrEmpty(sightItem.SubItems["来源"].Text.Trim()))
  338. {
  339. bool isDelete = true;
  340. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  341. {
  342. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)sightItem.Tag;
  343. if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
  344. {
  345. DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
  346. if (tbl.Rows.Count > 0)
  347. {
  348. if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() != "0")
  349. { isDelete = false; }
  350. else
  351. {
  352. LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel("Ord_Number", this.StrOrdNumber);
  353. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", tbl.Rows[0]["Ordpg_ViceNumber"].ToString().Trim());
  354. LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(ord_model, vmodel);
  355. List<string> sPhotoList = sPh.GetSpecifyTypePhotoList(Model.Model_ErpOrder.DirectoryType.PrimitivePicture, BLL.SelectPhotoHandling.PhotoType.Small, sightItem.Text.Trim());
  356. if (sPhotoList.Count == 0)
  357. {
  358. this.listViewData_Sights.Items.Remove(sightItem);
  359. isDelete = false;
  360. }
  361. else
  362. { isDelete = false; }
  363. }
  364. }
  365. }
  366. }
  367. if (isDelete)
  368. { this.listViewData_Sights.Items.Remove(sightItem); }
  369. }
  370. }
  371. if ((this.listViewData_Sights.Items.Count - 1) < 0)
  372. {
  373. return;
  374. }
  375. this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
  376. this.listViewData_Sights.Focus();
  377. this.bUpgrade = true;
  378. }
  379. /// <summary>
  380. /// 景点设置
  381. /// </summary>
  382. /// <param name="sender"></param>
  383. /// <param name="e"></param>
  384. void btnSightsSet_Click(object sender, EventArgs e)
  385. {
  386. LYFZ.Software.MainBusiness.InitialSet.FrmAttractionsSet frm = new InitialSet.FrmAttractionsSet("0");
  387. frm.StrSightsType = "0";
  388. frm.ShowDialog();
  389. this.listViewData_Sights.Focus();
  390. }
  391. /// <summary>
  392. /// 更换
  393. /// </summary>
  394. /// <param name="sender"></param>
  395. /// <param name="e"></param>
  396. void btnReplace_Click(object sender, EventArgs e)
  397. {
  398. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  399. {
  400. if (this.listViewData_Sights.SelectedItems.Count <= 0)
  401. {
  402. MessageBoxCustom.Show("请选择你要更换的景点"); return;
  403. }
  404. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
  405. if (!string.IsNullOrEmpty(ColumnModel.SightsOrderID))
  406. {
  407. DataTable tbl = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + ColumnModel.SightsOrderID + "'", ShowColumnName: "Ordpg_ViceNumber,Ordpg_PhotographyStatus").Tables[0];
  408. if (tbl.Rows.Count > 0)
  409. {
  410. if (tbl.Rows[0]["Ordpg_PhotographyStatus"].ToString().Trim() == "1")
  411. {
  412. MessageBoxCustom.Show("此景点已拍照OK,不能更换");
  413. this.listViewData_Sights.Focus();
  414. return;
  415. }
  416. }
  417. }
  418. }
  419. if (!this.IsClickToolbox)
  420. { MessageBoxCustom.Show("请先选择套系名称!"); return; }
  421. if (this.listViewData_Sights.SelectedItems.Count != 1)
  422. { MessageBoxCustom.Show("请选择要更换的景点!"); return; }
  423. List<string> SightsList = new List<string>();
  424. foreach (ListViewItem item in this.listViewData_Sights.Items)
  425. { SightsList.Add(item.Text.Trim()); }
  426. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.SightsAddSmallForm frm = new SetSmallForm.SightsAddSmallForm();
  427. frm.GetType = "更换";
  428. frm.LoadType = "景点设置";
  429. frm.RemovedSightsList = SightsList;
  430. frm.ShowDialog();
  431. if (frm.IsSaveed)
  432. {
  433. string StrOldSightsName = this.listViewData_Sights.SelectedItems[0].Text;
  434. LYFZ.Model.Model_ErpTheScenery modelss = frm.mlist[0];
  435. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.SelectedItems[0].Tag;
  436. ColumnModel.SightsLevel = modelss.Tsc_Rating.Trim();
  437. ColumnModel.SightsType = modelss.Tcs_Category.ToString().Trim();
  438. ColumnModel.SightsCostPrice = modelss.Tsc_CostPrice.ToString().Trim();
  439. ColumnModel.SightsRemark = modelss.Tsc_Remark;
  440. this.listViewData_Sights.SelectedItems[0].Text = modelss.Tsc_Name;
  441. this.listViewData_Sights.SelectedItems[0].SubItems["景点价格"].Text = modelss.Tsc_SalesPrice.ToString().Trim();
  442. this.listViewData_Sights.SelectedItems[0].SubItems["景点类别"].Text = modelss.Tcs_Category == 0 ? "内景" : "外景";
  443. this.listViewData_Sights.SelectedItems[0].SubItems["服装套数"].Text = "1";
  444. string StrClassName = "";
  445. DataRow dtRow = frm.tbl.Rows.Find(modelss.Tsc_Rating.Trim());
  446. if (dtRow == null)
  447. { StrClassName = ""; }
  448. else
  449. { StrClassName = dtRow["Sc_ClassName"].ToString().Trim(); }
  450. this.listViewData_Sights.SelectedItems[0].SubItems["拍摄级别"].Text = StrClassName;
  451. this.listViewData_Sights.SelectedItems[0].SubItems["备注"].Text = "景点由'" + StrOldSightsName + "'更换为'" + this.listViewData_Sights.SelectedItems[0].Text + "'";
  452. }
  453. this.listViewData_Sights.Focus();
  454. }
  455. /// <summary>
  456. /// 浏览选择
  457. /// </summary>
  458. /// <param name="sender"></param>
  459. /// <param name="e"></param>
  460. void lblBrowseSelect_Click(object sender, EventArgs e)
  461. {
  462. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
  463. frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.景点浏览;
  464. List<string> OldSelectStyleList = new List<string>();
  465. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  466. {
  467. OldSelectStyleList.Add(this.listViewData_Sights.Items[i].Text.Trim());
  468. }
  469. frm.OldSelectStyleList = OldSelectStyleList;
  470. frm.WindowState = FormWindowState.Maximized;
  471. frm.ShowDialog();
  472. if (frm.IsSaveed)
  473. {
  474. List<string> strList = frm.SelectStyleList;
  475. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  476. {
  477. for (int j = 0; j < strList.Count; j++)
  478. {
  479. if (this.listViewData_Sights.Items[i].Text.Trim() == strList[j].Trim())
  480. {
  481. strList.RemoveAt(j);
  482. break;
  483. }
  484. }
  485. }
  486. string StrWhere = "";
  487. for (int i = 0; i < strList.Count; i++)
  488. {
  489. StrWhere += "'" + strList[i].Trim() + "',";
  490. }
  491. if (!string.IsNullOrEmpty(StrWhere))
  492. {
  493. LYFZ.BLL.BLL_ErpTheScenery tsybll = new BLL.BLL_ErpTheScenery();
  494. List<LYFZ.Model.Model_ErpTheScenery> mlist = tsybll.GetModelList("Tsc_Name in (" + StrWhere.TrimEnd(',') + ") And Tsc_Type = '0'");
  495. //DataTable tbl = orbll.GetView_Custom("tb_ErpTheScenery", StrWhere: "ID in (" + StrWhere.TrimEnd(',') + ")", ShowColumnName: "").Tables[0];
  496. DataTable tbl = new LYFZ.BLL.BLL_ErpSystemCategory().GetAllList().Tables[0];
  497. tbl.PrimaryKey = new DataColumn[] { tbl.Columns["Sc_ClassCode"] };
  498. this.SetOrderSightsValue(mlist, tbl);
  499. }
  500. }
  501. }
  502. #region 属性
  503. private bool _isClickToolbox;
  504. /// <summary>
  505. /// 是否能点击工具箱
  506. /// </summary>
  507. public bool IsClickToolbox
  508. {
  509. get { return _isClickToolbox; }
  510. set { _isClickToolbox = value; }
  511. }
  512. private string _strOrdNumber;
  513. /// <summary>
  514. /// 订单号
  515. /// </summary>
  516. public string StrOrdNumber
  517. {
  518. get { return _strOrdNumber; }
  519. set { _strOrdNumber = value; }
  520. }
  521. private bool _isShowSightsSet;
  522. /// <summary>
  523. /// 是否显示景点设置
  524. /// </summary>
  525. public bool IsShowSightsSet
  526. {
  527. get { return _isShowSightsSet; }
  528. set
  529. {
  530. _isShowSightsSet = value;
  531. this.btnSightsSet.Enabled = _isShowSightsSet;
  532. }
  533. }
  534. /// <summary>
  535. /// 获取商品的总价
  536. /// </summary>
  537. /// <returns></returns>
  538. public decimal GetSightsAoumnt()
  539. {
  540. decimal dec_Aoumnt = 0;
  541. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  542. {
  543. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
  544. dec_Aoumnt += Convert.ToDecimal(ColumnModel.SightsCostPrice);
  545. }
  546. return dec_Aoumnt;
  547. }
  548. /// <summary>
  549. /// 获取列表详情数据
  550. /// </summary>
  551. /// <returns></returns>
  552. public string GetOrderSightsContentDetails()
  553. {
  554. string StrContentDetails = "";
  555. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  556. { StrContentDetails += "名称:" + this.listViewData_Sights.Items[i].Text.Trim() + " 套数:" + this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim() + " ;"; }
  557. return StrContentDetails;
  558. }
  559. /// <summary>
  560. /// 获取当前列表
  561. /// </summary>
  562. /// <returns></returns>
  563. public DataTable GetListViewData()
  564. {
  565. DataTable NewTable = new DataTable();
  566. NewTable.Columns.Add("PgmID", typeof(string));
  567. for (int i = 0; i < this.listViewData_Sights.Columns.Count; i++)
  568. {
  569. NewTable.Columns.Add(this.listViewData_Sights.Columns[i].Text.Trim(), typeof(string));
  570. }
  571. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  572. {
  573. if (string.IsNullOrEmpty(this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim()))
  574. {
  575. DataRow newRow = NewTable.NewRow();
  576. for (int j = 0; j < this.listViewData_Sights.Columns.Count; j++)
  577. {
  578. if (j == 0)
  579. {
  580. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
  581. newRow["PgmID"] = ColumnModel.PgmID;
  582. newRow[this.listViewData_Sights.Columns[j].Text.Trim()] = this.listViewData_Sights.Items[i].Text.Trim();
  583. }
  584. else
  585. { newRow[this.listViewData_Sights.Columns[j].Text.Trim()] = this.listViewData_Sights.Items[i].SubItems[this.listViewData_Sights.Columns[j].Text.Trim()].Text.Trim(); }
  586. }
  587. NewTable.Rows.Add(newRow);
  588. }
  589. }
  590. return NewTable;
  591. }
  592. #endregion
  593. /// <summary>
  594. /// 绑定景点的数据信息
  595. /// </summary>
  596. /// <param name="erpModel"></param>
  597. public void GetOrderSightsValueData(Api_ErpOrderModel erpModel)
  598. {
  599. erpModel.OrderSightData = new List<Api_StagesModel>();
  600. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  601. {
  602. SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
  603. string strReservationPhotographyTime = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim();
  604. if (this.listViewData_Sights.Items[i].SubItems["预拍时间"].Tag != null)
  605. {
  606. string[] dateTimeList = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Tag.ToString().Split(' ');
  607. if (dateTimeList.Length > 1)
  608. {
  609. strReservationPhotographyTime = strReservationPhotographyTime + " " + dateTimeList[1].Trim();
  610. }
  611. }
  612. Api_StagesModel model = new Api_StagesModel()
  613. {
  614. SightsOrderName = this.listViewData_Sights.Items[i].Text,
  615. PgmID = ColumnModel.PgmID,
  616. SightsLevel = ColumnModel.SightsLevel,
  617. SightsOrderID = ColumnModel.SightsOrderID,
  618. SightsCostPrice = ColumnModel.SightsCostPrice,
  619. SightsType = ColumnModel.SightsType,
  620. SightsRemark = this.listViewData_Sights.Items[i].SubItems["备注"].Text.Trim(),
  621. SightsPrice = this.listViewData_Sights.Items[i].SubItems["景点价格"].Text.Trim(),
  622. Source = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim(),
  623. WearCount = Convert.ToInt32(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim()),
  624. StagesReservationPhotographyTime = strReservationPhotographyTime.Trim()
  625. };
  626. erpModel.OrderSightData.Add(model);
  627. }
  628. }
  629. /// <summary>
  630. /// 获取订单景点数据
  631. /// </summary>
  632. /// <param name="IsMagess">是否检测无数据提示:true为提示(如用于保存订单);false为不提示(如用于保存意向订单)</param>
  633. /// <returns></returns>
  634. public List<Helper.CommandInfo> GetOrderSightsValue(Hashtable htData_RegisterAndBottom, string StrNumber, DateTime strTime, ref bool IsContinue, bool IsMagess = true)
  635. {
  636. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  637. LYFZ.Model.Model_ErpOrderDigital ViceModel = orvbll.GetModel("Ordv_ViceNumber", StrNumber + "_001");
  638. if (this.listViewData_Sights.Items.Count > 0)
  639. {
  640. int WeddingCount = 0;
  641. int PhotoCount = 0;
  642. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  643. LYFZ.Model.Model_ErpSystemConfigure systemModel = sgbll.GetModel("Sconfig_Code", "DayRemind");
  644. if (systemModel.ID > 0 && !string.IsNullOrEmpty(systemModel.Sconfig_Value))
  645. {
  646. string[] StrArray = systemModel.Sconfig_Value.Trim().Split('|');
  647. string[] StrArray2 = StrArray[0].Trim().Split(',');
  648. if (StrArray2.Length >= 1 && StrArray2[0].Trim().Length > 0)
  649. { WeddingCount = Convert.ToInt32(StrArray2[0].Trim()); }
  650. if (StrArray2.Length >= 3 && StrArray2[2].Trim().Length > 0)
  651. { PhotoCount = Convert.ToInt32(StrArray2[2].Trim()); }
  652. }
  653. if (ViceModel.ID <= 0)
  654. {
  655. ViceModel = new Model.Model_ErpOrderDigital();
  656. ViceModel.Ordv_Number = StrNumber;
  657. ViceModel.Ordv_ViceNumber = StrNumber + "_001";
  658. ViceModel.Ordv_DigitalNumber = 1;
  659. ViceModel.Ordv_IntoBottomAddPickQuantity = 0;
  660. ViceModel.Ordv_IntoRegisterAddPickQuantity = 0;
  661. ViceModel.Ordv_ClothingDispatcher = "";
  662. ViceModel.Ordv_ClothingName = "";
  663. ViceModel.Ordv_ClothingRemark = "";
  664. ViceModel.Ordv_ClothingStatus = "0";
  665. ViceModel.Ordv_CreateDatetime = strTime;
  666. ViceModel.Ordv_CreateName = strUserID;
  667. ViceModel.Ordv_DesignerDispatcher = "";
  668. ViceModel.Ordv_DesignerName = "";
  669. ViceModel.Ordv_DesignerStatus = "0";
  670. ViceModel.Ordv_DesignValidation = "";
  671. ViceModel.Ordv_EarlyRepairDispatcher = "";
  672. ViceModel.Ordv_EarlyRepairName = "";
  673. ViceModel.Ordv_EarlyRepairStatus = "0";
  674. ViceModel.Ordv_FilmSelectionDispatcher = "";
  675. ViceModel.Ordv_FilmSelectionName = "";
  676. ViceModel.Ordv_FilmSelectionStatus = "0";
  677. ViceModel.Ordv_LookDesignClaim = "";
  678. ViceModel.Ordv_LookDesignDispatcher = "";
  679. ViceModel.Ordv_LookDesignName = "";
  680. ViceModel.Ordv_LookDesignStatus = "0";
  681. ViceModel.Ordv_RefinementDispatcher = "";
  682. ViceModel.Ordv_RefinementName = "";
  683. ViceModel.Ordv_RefinementStatus = "0";
  684. ViceModel.Ordv_ReservationClothingName = "";
  685. ViceModel.Ordv_ReservationDesignerName = "";
  686. ViceModel.Ordv_ReservationEarlyRepairName = "";
  687. ViceModel.Ordv_ReservationFilmSelectionName = "";
  688. ViceModel.Ordv_ReservationLookDesignName = "";
  689. ViceModel.Ordv_ReservationRefinementName = "";
  690. ViceModel.Ordv_ReservationSendPhotoName = "";
  691. ViceModel.Ordv_ReservationSendPhotoStatus = "0";
  692. ViceModel.Ordv_SelectionDesign = "";
  693. ViceModel.Ordv_SelectionFilm = "";
  694. ViceModel.Ordv_UpdateName = "";
  695. ViceModel.Ordv_IntoRegisterQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantity"].ToString().Trim());
  696. ViceModel.Ordv_IntoBottomQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantity"].ToString().Trim());
  697. ViceModel.Ordv_IntoRegisterQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantityPackage"].ToString().Trim());
  698. ViceModel.Ordv_IntoBottomQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantityPackage"].ToString().Trim());
  699. ViceModel.Ordv_IntoRegisterQuantity += ViceModel.Ordv_IntoRegisterQuantityPackage;
  700. if (ViceModel.Ordv_IntoBottomQuantity != -1 && ViceModel.Ordv_IntoBottomQuantityPackage != -1)
  701. { ViceModel.Ordv_IntoBottomQuantity += ViceModel.Ordv_IntoBottomQuantityPackage; }
  702. clist.Add(orvbll.GetAddCommandInfo(ViceModel));
  703. LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = new Model.Model_ErpOrderDigitalStatus();
  704. modelStatus.Ords_Number = "ORDS_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  705. modelStatus.Ords_OrdNumber = ViceModel.Ordv_Number;
  706. modelStatus.Ords_ViceNumber = ViceModel.Ordv_ViceNumber;
  707. modelStatus.Ords_DigitalNumber = ViceModel.Ordv_DigitalNumber;
  708. modelStatus.Ords_OutSendEarlyRepairName = "";
  709. modelStatus.Ords_OutSendEarlyRepairQuantity = 0;
  710. modelStatus.Ords_OutSendEarlyRepairStatus = "未发";
  711. modelStatus.Ords_OutSendEarlyRepairVendor = "";
  712. modelStatus.Ords_OutSendEarlyRepairVendorQQ = "";
  713. modelStatus.Ords_PhotographStatus = "未拍";
  714. modelStatus.Ords_PhotographIntStatus = 0;
  715. modelStatus.Ords_SightsName = "";
  716. modelStatus.Ords_Photographer = "";
  717. modelStatus.Ords_PhotographyAssistant = "";
  718. modelStatus.Ords_MakeupArtist = "";
  719. modelStatus.Ords_MakeupAssistant = "";
  720. modelStatus.Ords_BootDivision = "";
  721. modelStatus.Ords_BootDivisionAssistant = "";
  722. modelStatus.Ords_ProductSendStatus = "未发";
  723. modelStatus.Ords_ProductCompletedStatus = "未完";
  724. modelStatus.Ords_ProductPickupStatus = "未取";
  725. modelStatus.Ords_ProductPickupIntStatus = 0;
  726. modelStatus.Ords_ProductIsExpedited = "否";
  727. modelStatus.Ords_ServiceStatus = "未进行";
  728. modelStatus.Ords_ServiceIntStatus = 0;
  729. clist.Add(orsbll.GetAddCommandInfo(modelStatus));
  730. }
  731. else
  732. {
  733. ViceModel.Ordv_IntoRegisterQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantity"].ToString().Trim());
  734. ViceModel.Ordv_IntoBottomQuantity = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantity"].ToString().Trim());
  735. ViceModel.Ordv_IntoRegisterQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoRegisterQuantityPackage"].ToString().Trim());
  736. ViceModel.Ordv_IntoBottomQuantityPackage = Convert.ToInt32(htData_RegisterAndBottom["IntoBottomQuantityPackage"].ToString().Trim());
  737. ViceModel.Ordv_IntoRegisterQuantity += ViceModel.Ordv_IntoRegisterQuantityPackage;
  738. if (ViceModel.Ordv_IntoBottomQuantity != -1 && ViceModel.Ordv_IntoBottomQuantityPackage != -1)
  739. { ViceModel.Ordv_IntoBottomQuantity += ViceModel.Ordv_IntoBottomQuantityPackage; }
  740. clist.Add(orvbll.GetUpdateCommandInfo(ViceModel));
  741. }
  742. LYFZ.Model.Model_ErpOrdersPhotography model = null;
  743. DataTable dt = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
  744. dt.PrimaryKey = new DataColumn[] { dt.Columns["Ordpg_Sights"] };
  745. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  746. {
  747. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = (SetCustomControls_SightsColumnHeaderModel)this.listViewData_Sights.Items[i].Tag;
  748. if (ColumnModel.SightsOrderID.Trim().Length > 0)
  749. {
  750. DataRow[] dtRows = dt.Select("ID = '" + ColumnModel.SightsOrderID.Trim() + "'");
  751. if (dtRows.Length <= 0)
  752. {
  753. model = new Model.Model_ErpOrdersPhotography();
  754. model.Ordpg_IDNumber = "JD_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  755. model.Ordpg_Number = StrNumber;
  756. model.Ordpg_ViceNumber = StrNumber + "_001";
  757. model.Ordpg_BootDivision = "";
  758. model.Ordpg_BootDivisionAssistant = "";
  759. model.Ordpg_Dispatcher = "";
  760. model.Ordpg_ImportPhotoer = "";
  761. model.Ordpg_MakeupArtist = "";
  762. model.Ordpg_MakeupAssistant = "";
  763. model.Ordpg_Photographer = "";
  764. model.Ordpg_PhotographyAssistant = "";
  765. model.Ordpg_PhotographyStatus = "0";
  766. model.Ordpg_Remark = "";
  767. model.Ordpg_ReservationBootDivision = "";
  768. model.Ordpg_ReservationBootDivisionAssistant = "";
  769. model.Ordpg_ReservationMakeupArtist = "";
  770. model.Ordpg_ReservationMakeupAssistant = "";
  771. model.Ordpg_ReservationPhotographyAssistant = "";
  772. model.Ordpg_ReservationPhotographyName = "";
  773. model.Ordpg_CreateName = this.strUserID;
  774. model.Ordpg_CreateDateTime = strTime;
  775. model.Ordpg_UpdateName = "";
  776. model.Ordpg_OpenOrderSource = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim();
  777. }
  778. else
  779. {
  780. model = opbll.DataRowToModel(dtRows[0]);
  781. model.Ordpg_UpdateDateTime = strTime;
  782. model.Ordpg_UpdateName = this.strUserID;
  783. dt.Rows.Remove(dtRows[0]);
  784. }
  785. }
  786. else
  787. {
  788. DataRow dtRow = dt.Rows.Find(this.listViewData_Sights.Items[i].Text.Trim());
  789. if (dtRow != null)
  790. {
  791. model = opbll.DataRowToModel(dtRow);
  792. model.Ordpg_UpdateDateTime = strTime;
  793. model.Ordpg_UpdateName = this.strUserID;
  794. dt.Rows.Remove(dtRow);
  795. }
  796. else
  797. {
  798. model = new Model.Model_ErpOrdersPhotography();
  799. model.Ordpg_IDNumber = "JD_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  800. model.Ordpg_Number = StrNumber;
  801. model.Ordpg_ViceNumber = StrNumber + "_001";
  802. model.Ordpg_BootDivision = "";
  803. model.Ordpg_BootDivisionAssistant = "";
  804. model.Ordpg_Dispatcher = "";
  805. model.Ordpg_ImportPhotoer = "";
  806. model.Ordpg_MakeupArtist = "";
  807. model.Ordpg_MakeupAssistant = "";
  808. model.Ordpg_Photographer = "";
  809. model.Ordpg_PhotographyAssistant = "";
  810. model.Ordpg_PhotographyStatus = "0";
  811. model.Ordpg_Remark = "";
  812. model.Ordpg_ReservationBootDivision = "";
  813. model.Ordpg_ReservationBootDivisionAssistant = "";
  814. model.Ordpg_ReservationMakeupArtist = "";
  815. model.Ordpg_ReservationMakeupAssistant = "";
  816. model.Ordpg_ReservationPhotographyAssistant = "";
  817. model.Ordpg_ReservationPhotographyName = "";
  818. model.Ordpg_CreateName = this.strUserID;
  819. model.Ordpg_CreateDateTime = strTime;
  820. model.Ordpg_UpdateName = "";
  821. model.Ordpg_OpenOrderSource = this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim();
  822. }
  823. }
  824. if (this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim() != "")
  825. {
  826. string StrPreShotDateTime = this.listViewData_Sights.Items[i].SubItems["预拍时间"].Text.Trim();
  827. #region 判断预约日期是否满档或需要授权
  828. if (!string.IsNullOrEmpty(StrPreShotDateTime))
  829. {
  830. bool IsShowPrompt = true;
  831. if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(model.Ordpg_ReservationPhotographyTime)))
  832. {
  833. if (Convert.ToDateTime(StrPreShotDateTime).ToString("yyyy-MM-dd") == LYFZ.Command.Command_Validate.DateTimeToString(model.Ordpg_ReservationPhotographyTime))
  834. { IsShowPrompt = false; }
  835. }
  836. if (IsShowPrompt && OrdType>-1)
  837. {
  838. string StrWhere = " Ord_Type in ('" + OrdType + "') And Ordpg_ViceNumber != '" + model.Ordpg_ViceNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_ReservationPhotographyTime", StrPreShotDateTime, StrPreShotDateTime);
  839. string StrTableName = "tb_ErpOrdersPhotography Left Join tb_ErpOrderDigital on Ordv_ViceNumber = Ordpg_ViceNumber Left Join tb_ErpOrder on Ord_Number = Ordpg_Number";
  840. string StrColumnName = " distinct Ordv_ViceNumber";
  841. DataTable photographyDt = orbll.GetView_Custom(StrTableName, StrWhere: StrWhere, ShowColumnName: StrColumnName, GroupBy: StrColumnName).Tables[0];
  842. if (dt.Rows.Count >= (OrdType==0?WeddingCount:PhotoCount))
  843. {
  844. if (MessageBoxCustom.Show("拍摄名称‘" + model.Ordpg_Sights + "’\r\n预拍日期‘" + StrPreShotDateTime + "’\r\n可安排的‘" + (OrdType == 0 ? "婚纱单" : "写真单") + ":" + (OrdType == 0 ? WeddingCount : PhotoCount) + "单’已满。\r\n是否要继续安排?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  845. { IsContinue = true; return null; }
  846. if (!LYFZ.Software.MainBusiness.CameraControlBook.PublicClass.GetMagess(IsShowPrompt: false))
  847. { IsContinue = true; return null; }
  848. }
  849. }
  850. }
  851. #endregion
  852. model.Ordpg_ReservationPhotographyTime = Convert.ToDateTime(StrPreShotDateTime);
  853. model.Ordpg_ReservationPhotographyDividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  854. }
  855. else
  856. { model.Ordpg_ReservationPhotographyTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); }
  857. model.Ordpg_Sights = this.listViewData_Sights.Items[i].Text.Trim();
  858. model.Ordpg_SightsRemark = ColumnModel.SightsRemark;
  859. model.Ordpg_CostPrice = Convert.ToDecimal(ColumnModel.SightsCostPrice);
  860. model.Ordpg_SalesPrice = Convert.ToDecimal(this.listViewData_Sights.Items[i].SubItems["景点价格"].Text.Trim());
  861. model.Ordpg_ApparelQuantity = Convert.ToInt32(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim());
  862. model.Ordpg_OpenOrderRemark = this.listViewData_Sights.Items[i].SubItems["备注"].Text.Trim();
  863. model.Ordpg_SightsLevel = ColumnModel.SightsLevel.Trim();
  864. model.Ordpg_SightsType = ColumnModel.SightsType.Trim();
  865. if (model.ID > 0)
  866. { clist.Add(opbll.GetUpdateCommandInfo(model)); }
  867. else
  868. { clist.Add(opbll.GetAddCommandInfo(model)); }
  869. }
  870. //for (int i = 0; i < RemoveList.Count; i++)
  871. //{ dt.Rows.Remove(RemoveList[i]); }
  872. for (int i = 0; i < dt.Rows.Count; i++)
  873. { clist.Add(opbll.GetDeleteCommandInfo("ID", "=", dt.Rows[i]["ID"])); }
  874. }
  875. else
  876. {
  877. if (IsMagess)
  878. { MessageBoxCustom.Show("拍摄次数至少要有一项!"); IsContinue = true; return null; }
  879. else
  880. {
  881. if (ViceModel.ID > 0)
  882. {
  883. DataTable dt = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
  884. for (int i = 0; i < dt.Rows.Count; i++)
  885. {
  886. clist.Add(opbll.GetDeleteCommandInfo("ID", "=", dt.Rows[i]["ID"]));
  887. }
  888. }
  889. }
  890. }
  891. return clist;
  892. }
  893. /// <summary>
  894. /// 设置绑定订单景点数据
  895. /// </summary>
  896. /// <param name="mlist"></param>
  897. public void SetOrderSightsValue(List<LYFZ.Model.Model_ErpTheScenery> mlist, DataTable tbl)
  898. {
  899. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  900. {
  901. for (int j = 0; j < mlist.Count; j++)
  902. {
  903. if (this.listViewData_Sights.Items[i].Text.Trim() == mlist[j].Tsc_Name.Trim())
  904. {
  905. mlist.RemoveAt(j);
  906. break;
  907. }
  908. }
  909. }
  910. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
  911. for (int i = 0; i < mlist.Count; i++)
  912. {
  913. ListViewItem lvItem = new ListViewItem();
  914. ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
  915. ColumnModel.SightsLevel = mlist[i].Tsc_Rating.Trim();
  916. ColumnModel.SightsType = mlist[i].Tcs_Category.ToString().Trim();
  917. ColumnModel.SightsOrderID = "";
  918. ColumnModel.SightsCostPrice = mlist[i].Tsc_CostPrice.ToString().Trim();
  919. ColumnModel.SightsRemark = mlist[i].Tsc_Remark;
  920. lvItem.Tag = ColumnModel;
  921. lvItem.Text = mlist[i].Tsc_Name.Trim();
  922. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  923. ListSubItem.Name = "景点价格";
  924. ListSubItem.Text = mlist[i].Tsc_SalesPrice.ToString().Trim();
  925. lvItem.SubItems.Add(ListSubItem);
  926. ListSubItem = new ListViewItem.ListViewSubItem();
  927. ListSubItem.Name = "来源";
  928. ListSubItem.Text = "";
  929. lvItem.SubItems.Add(ListSubItem);
  930. ListSubItem = new ListViewItem.ListViewSubItem();
  931. ListSubItem.Name = "景点类别";
  932. ListSubItem.Text = mlist[i].Tcs_Category == 0 ? "内景" : "外景";
  933. lvItem.SubItems.Add(ListSubItem);
  934. ListSubItem = new ListViewItem.ListViewSubItem();
  935. ListSubItem.Name = "拍摄级别";
  936. DataRow dtRow = tbl.Rows.Find(mlist[i].Tsc_Rating.Trim());
  937. if (dtRow == null)
  938. { ListSubItem.Text = ""; }
  939. else
  940. { ListSubItem.Text = dtRow["Sc_ClassName"].ToString().Trim(); }
  941. lvItem.SubItems.Add(ListSubItem);
  942. ListSubItem = new ListViewItem.ListViewSubItem();
  943. ListSubItem.Name = "服装套数";
  944. ListSubItem.Text = "1";
  945. lvItem.SubItems.Add(ListSubItem);
  946. ListSubItem = new ListViewItem.ListViewSubItem();
  947. ListSubItem.Name = "预拍时间";
  948. ListSubItem.Text = "";
  949. lvItem.SubItems.Add(ListSubItem);
  950. ListSubItem = new ListViewItem.ListViewSubItem();
  951. ListSubItem.Name = "备注";
  952. ListSubItem.Text = "";
  953. lvItem.SubItems.Add(ListSubItem);
  954. if ((this.listViewData_Sights.Items.Count % 2) > 0)
  955. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  956. else
  957. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  958. this.listViewData_Sights.Items.Add(lvItem);
  959. }
  960. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  961. { this.listViewData_Sights.Items[i].Selected = false; }
  962. this.listViewData_Sights.Items[this.listViewData_Sights.Items.Count - 1].Selected = true;
  963. this.listViewData_Sights.Focus();
  964. }
  965. /// <summary>
  966. /// 加载时订单拍摄景点数据
  967. /// </summary>
  968. /// <param name="mlist"></param>
  969. public void SetOrderSightsValue(string StrNumber, string StrSeriesName)
  970. {
  971. this.btnReplace.Visible = true;
  972. if(bUpgrade)
  973. {
  974. this.DeleteSightByNotAction();
  975. }
  976. else
  977. {
  978. this.listViewData_Sights.Items.Clear();
  979. }
  980. if (!string.IsNullOrEmpty(StrSeriesName))
  981. { this.IsClickToolbox = true; }
  982. string StrTableName = "(SELECT Ordpg_Number,Ordpg_ViceNumber,tb_ErpOrdersPhotography.ID,Ordpg_Sights,Ordpg_ApparelQuantity,Ordpg_SightsLevel,Sc_ClassName,Ordpg_SightsType,Ordpg_OpenOrderRemark,Ordpg_OpenOrderSource," +
  983. "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," +
  984. "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' " +
  985. "Left Join tb_ErpSystemCategory on Sc_ClassCode = Ordpg_SightsLevel) AS tb";
  986. DataTable tbl = orbll.GetView_Custom(StrTableName, StrWhere: "Ordpg_Number = '" + StrNumber + "'", ShowColumnName: "*").Tables[0];
  987. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
  988. for (int i = 0; i < tbl.Rows.Count; i++)
  989. {
  990. ListViewItem lvItem = new ListViewItem();
  991. ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
  992. ColumnModel.SightsLevel = tbl.Rows[i]["Ordpg_SightsLevel"].ToString().Trim();
  993. ColumnModel.SightsType = tbl.Rows[i]["Ordpg_SightsType"].ToString().Trim();
  994. ColumnModel.SightsOrderID = tbl.Rows[i]["ID"].ToString().Trim();
  995. ColumnModel.SightsCostPrice = tbl.Rows[i]["Ordpg_CostPrice"].ToString().Trim();
  996. ColumnModel.SightsRemark = tbl.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  997. lvItem.Tag = ColumnModel;
  998. lvItem.Text = tbl.Rows[i]["Ordpg_Sights"].ToString().Trim();
  999. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1000. ListSubItem.Name = "景点价格";
  1001. ListSubItem.Text = tbl.Rows[i]["Ordpg_SalesPrice"].ToString().Trim();
  1002. lvItem.SubItems.Add(ListSubItem);
  1003. ListSubItem = new ListViewItem.ListViewSubItem();
  1004. ListSubItem.Name = "来源";
  1005. ListSubItem.Text = tbl.Rows[i]["Ordpg_OpenOrderSource"].ToString().Trim();
  1006. lvItem.SubItems.Add(ListSubItem);
  1007. ListSubItem = new ListViewItem.ListViewSubItem();
  1008. ListSubItem.Name = "景点类别";
  1009. ListSubItem.Text = tbl.Rows[i]["Ordpg_SightsTypeText"].ToString().Trim();
  1010. lvItem.SubItems.Add(ListSubItem);
  1011. ListSubItem = new ListViewItem.ListViewSubItem();
  1012. ListSubItem.Name = "拍摄级别";
  1013. ListSubItem.Text = tbl.Rows[i]["Sc_ClassName"].ToString().Trim();
  1014. lvItem.SubItems.Add(ListSubItem);
  1015. ListSubItem = new ListViewItem.ListViewSubItem();
  1016. ListSubItem.Name = "服装套数";
  1017. ListSubItem.Text = tbl.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim();
  1018. lvItem.SubItems.Add(ListSubItem);
  1019. ListSubItem = new ListViewItem.ListViewSubItem();
  1020. ListSubItem.Name = "预拍时间";
  1021. if (tbl.Rows[i]["Ordpg_ReservationPhotographyTime"] != null)
  1022. {
  1023. ListSubItem.Text = tbl.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim().Split(' ')[0];
  1024. }
  1025. ListSubItem.Tag = tbl.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim();
  1026. lvItem.SubItems.Add(ListSubItem);
  1027. ListSubItem = new ListViewItem.ListViewSubItem();
  1028. ListSubItem.Name = "备注";
  1029. ListSubItem.Text = tbl.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
  1030. lvItem.SubItems.Add(ListSubItem);
  1031. if ((this.listViewData_Sights.Items.Count % 2) > 0)
  1032. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  1033. else
  1034. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  1035. this.listViewData_Sights.Items.Add(lvItem);
  1036. }
  1037. }
  1038. /// <summary>
  1039. /// 加载时订单拍摄景点数据
  1040. /// </summary>
  1041. /// <param name="listStages"></param>
  1042. /// <param name="dtSet"></param>
  1043. public string SetOrderSightsValue(DataRow[] dtRows, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType)
  1044. {
  1045. string StrDeleteSights = "";
  1046. if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
  1047. {
  1048. if (!bUpgrade)
  1049. {
  1050. this.listViewData_Sights.Items.Clear();
  1051. }
  1052. else
  1053. {
  1054. DeleteSightByNotAction();
  1055. }
  1056. this.btnReplace.Visible = false;
  1057. }
  1058. else
  1059. { this.RemovePackageItem(); }
  1060. this.IsClickToolbox = true;
  1061. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.SetCustomControls_SightsColumnHeaderModel ColumnModel = null;
  1062. string StrRepeatSightsName = "";
  1063. for (int i = 0; i < dtRows.Length; i++)
  1064. {
  1065. bool IsFind = false;
  1066. if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
  1067. {
  1068. for (int j = 0; j < this.listViewData_Sights.Items.Count; j++)
  1069. {
  1070. if (this.listViewData_Sights.Items[j].Text.Trim() == dtRows[i]["Pgm_ProductName"].ToString().Trim())
  1071. {
  1072. StrRepeatSightsName += "[" + dtRows[i]["Pgm_ProductName"].ToString().Trim() + "],";
  1073. IsFind = true;
  1074. break;
  1075. }
  1076. }
  1077. }
  1078. if (!IsFind)
  1079. {
  1080. if (!string.IsNullOrEmpty(dtRows[i]["ID"].ToString().Trim()))
  1081. {
  1082. if (BindSightExist(dtRows[i]["Pgm_ProductName"].ToString().Trim()))
  1083. {
  1084. continue;
  1085. }
  1086. ListViewItem lvItem = new ListViewItem();
  1087. ColumnModel = new SetCustomControls_SightsColumnHeaderModel();
  1088. ColumnModel.PgmID = dtRows[i]["PgmID"].ToString().Trim();
  1089. ColumnModel.SightsLevel = dtRows[i]["Tsc_Rating"].ToString().Trim();
  1090. ColumnModel.SightsType = dtRows[i]["Tcs_Category"].ToString().Trim();
  1091. ColumnModel.SightsOrderID = "";
  1092. ColumnModel.SightsCostPrice = dtRows[i]["Tsc_CostPrice"].ToString().Trim();
  1093. ColumnModel.SightsRemark = dtRows[i]["Tsc_Remark"].ToString().Trim();
  1094. lvItem.Tag = ColumnModel;
  1095. lvItem.Text = dtRows[i]["Pgm_ProductName"].ToString().Trim();
  1096. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1097. ListSubItem.Name = "景点价格";
  1098. ListSubItem.Text = dtRows[i]["Tsc_SalesPrice"].ToString().Trim();
  1099. lvItem.SubItems.Add(ListSubItem);
  1100. ListSubItem = new ListViewItem.ListViewSubItem();
  1101. ListSubItem.Name = "来源";
  1102. ListSubItem.Text = dtRows[i]["TaoXiNameSource"].ToString().Trim();
  1103. lvItem.SubItems.Add(ListSubItem);
  1104. ListSubItem = new ListViewItem.ListViewSubItem();
  1105. ListSubItem.Name = "景点类别";
  1106. ListSubItem.Text = dtRows[i]["Tcs_CategoryText"].ToString().Trim();
  1107. lvItem.SubItems.Add(ListSubItem);
  1108. ListSubItem = new ListViewItem.ListViewSubItem();
  1109. ListSubItem.Name = "拍摄级别";
  1110. ListSubItem.Text = dtRows[i]["Sc_ClassName"].ToString().Trim();
  1111. lvItem.SubItems.Add(ListSubItem);
  1112. ListSubItem = new ListViewItem.ListViewSubItem();
  1113. ListSubItem.Name = "服装套数";
  1114. ListSubItem.Text = dtRows[i]["Pgm_Quantity"].ToString().Trim();
  1115. lvItem.SubItems.Add(ListSubItem);
  1116. ListSubItem = new ListViewItem.ListViewSubItem();
  1117. ListSubItem.Name = "预拍时间";
  1118. ListSubItem.Text = "";
  1119. lvItem.SubItems.Add(ListSubItem);
  1120. ListSubItem = new ListViewItem.ListViewSubItem();
  1121. ListSubItem.Name = "备注";
  1122. ListSubItem.Text = "";
  1123. lvItem.SubItems.Add(ListSubItem);
  1124. if ((this.listViewData_Sights.Items.Count % 2) > 0)
  1125. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  1126. else
  1127. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  1128. this.listViewData_Sights.Items.Add(lvItem);
  1129. }
  1130. else
  1131. { StrDeleteSights += dtRows[i]["Pgm_ProductName"].ToString().Trim() + ","; }
  1132. }
  1133. }
  1134. if (StrDeleteSights.Trim() != "")
  1135. { StrDeleteSights = "有景点已删除,已删除景点为:" + StrDeleteSights.TrimEnd(',') + ";"; }
  1136. if (PackagesType == EnumPublic.EnumPackagesType.AAAAAAB)
  1137. { this.GetIsActivity(IsActivity); }
  1138. if (!string.IsNullOrEmpty(StrRepeatSightsName))
  1139. { MessageBoxCustom.Show("订单套系景点有包含礼包景点:\r\n" + StrRepeatSightsName.TrimEnd(',')); }
  1140. return StrDeleteSights;
  1141. }
  1142. bool BindSightExist(string sightText)
  1143. {
  1144. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  1145. {
  1146. if (this.listViewData_Sights.Items[i].Text.ToLower().Equals(sightText.ToLower()))
  1147. {
  1148. return true;
  1149. }
  1150. }
  1151. return false;
  1152. }
  1153. /// <summary>
  1154. /// 移除礼包的项目
  1155. /// </summary>
  1156. public void RemovePackageItem()
  1157. {
  1158. if (this.listViewData_Sights.Items.Count > 0)
  1159. {
  1160. List<ListViewItem> listItem = new List<ListViewItem>();
  1161. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  1162. {
  1163. if (!string.IsNullOrEmpty(this.listViewData_Sights.Items[i].SubItems["来源"].Text.Trim()))
  1164. { listItem.Add(this.listViewData_Sights.Items[i]); }
  1165. }
  1166. for (int i = 0; i < listItem.Count; i++)
  1167. { this.listViewData_Sights.Items.Remove(listItem[i]); }
  1168. }
  1169. }
  1170. /// <summary>
  1171. /// 是否能操作
  1172. /// </summary>
  1173. /// <param name="IsActivity"></param>
  1174. void GetIsActivity(bool IsActivity)
  1175. {
  1176. this.btnSightsAdd.Enabled = !IsActivity;
  1177. this.btnSightsDelete.Enabled = !IsActivity;
  1178. this.btnSightsSet.Enabled = !IsActivity;
  1179. if (IsActivity && LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ChangeActiveContent)
  1180. {
  1181. this.btnSightsAdd.Enabled = IsActivity;
  1182. this.btnSightsDelete.Enabled = IsActivity;
  1183. this.btnSightsSet.Enabled = IsActivity;
  1184. }
  1185. }
  1186. }
  1187. }