OrderSightsControlsEx.cs 50 KB

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