PackagesGoodsSetFormMain.cs 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827
  1. using LYFZ.ComponentLibrary;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.InitialSet
  12. {
  13. public partial class PackagesGoodsSetFormMain : LYFZ.Software.UI.InitialSet.PackagesGoodsSetFormMain
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. LYFZ.BLL.BLL_ErpProduct ptbll = new BLL.BLL_ErpProduct();
  17. LYFZ.BLL.BLL_ErpPackages pkbll = new BLL.BLL_ErpPackages();
  18. LYFZ.BLL.BLL_ErpTheScenery tsbll = new BLL.BLL_ErpTheScenery();
  19. LYFZ.BLL.BLL_ErpPackagesGiftMerchandise pgmbll = new BLL.BLL_ErpPackagesGiftMerchandise();
  20. public PackagesGoodsSetFormMain(string StrType = "0")
  21. {
  22. if (!string.IsNullOrEmpty(StrType))
  23. { this.StrPackagesType = Convert.ToInt32(StrType); }
  24. else
  25. { this.StrPackagesType = 0; }
  26. this.Load += PackagesGoodsSetFormMain_Load;
  27. this.Shown += PackagesGoodsSetFormMain_Shown;
  28. this.cmbtreev_PackageName.ComboBoxTree_NodeMouseClick += cmbtreev_PackageName_ComboBoxTree_NodeMouseClick;
  29. this.btnToolbox_Product.Click += btnToolbox_Product_Click;
  30. this.btnToolbox_Service.Click += btnToolbox_Service_Click;
  31. this.btnToolbox_Sights.Click += btnToolbox_Sights_Click;
  32. this.btnDelete_Product.Click += btnDelete_Product_Click;
  33. this.btnDelete_Service.Click += btnDelete_Service_Click;
  34. this.btnDelete_Sights.Click += btnDelete_Sights_Click;
  35. this.btnSaveed.Click += btnSaveed_Click;
  36. this.btnCloseed.Click += btnCloseed_Click;
  37. this.btnSet.Click += btnSet_Click;
  38. this.btnUp.Click += btnUp_Click;
  39. this.btnDown.Click += btnDown_Click;
  40. this.TabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged;
  41. this.listViewData_Product.MouseDoubleClick += listViewData_Product_MouseDoubleClick;
  42. this.listViewData_Service.MouseDoubleClick += listViewData_Service_MouseDoubleClick;
  43. this.listViewData_Sights.MouseDoubleClick += listViewData_Sights_MouseDoubleClick;
  44. this.listViewData_Stages.MouseDoubleClick += listViewData_Stages_MouseDoubleClick;
  45. this.listViewData_Product.MouseDown += listViewData_Product_MouseDown;
  46. this.listViewData_Service.MouseDown += listViewData_Service_MouseDown;
  47. this.txtText.KeyPress += txtText_KeyPress;
  48. this.txtText.Leave += txtText_Leave;
  49. this.txtIntoRegister.KeyPress += txtIntoRegister_KeyPress;
  50. this.txtIntoBottom.KeyPress += txtIntoBottom_KeyPress;
  51. this.FormClosing += PackagesGoodsSetFormMain_FormClosing;
  52. }
  53. /// <summary>
  54. /// 套系大类类型
  55. /// </summary>
  56. public int StrPackagesType;
  57. /// <summary>
  58. /// 是否保存
  59. /// </summary>
  60. public bool IsSaveed = false;
  61. /// <summary>
  62. /// 套系设置是否有修改
  63. /// </summary>
  64. private bool IsPackagesSet = false;
  65. /// <summary>
  66. /// 存储产品略图集合
  67. /// </summary>
  68. ImageList mlistImage = new ImageList();
  69. /// <summary>
  70. /// true为首次运行
  71. /// </summary>
  72. private bool IsFirstLoad = true;
  73. /// <summary>
  74. /// 套系数据是否有变动过
  75. /// </summary>
  76. private bool IsDataChange = false;
  77. /// <summary>
  78. /// 窗体加载事件
  79. /// </summary>
  80. /// <param name="sender"></param>
  81. /// <param name="e"></param>
  82. void PackagesGoodsSetFormMain_Load(object sender, EventArgs e)
  83. {
  84. this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  85. this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  86. if (this.StrPackagesType == 1)
  87. {
  88. this.panelEx4.Visible = false;
  89. this.Text = "礼包套系商品设置";
  90. this.labelEx6.Text = "套系礼包商品";
  91. this.labelEx8.Text = "套系礼包服务";
  92. }
  93. else
  94. { this.txtIntoBottom.WaterText = "-1表示全送"; }
  95. }
  96. /// <summary>
  97. /// 窗体加载事件
  98. /// </summary>
  99. /// <param name="sender"></param>
  100. /// <param name="e"></param>
  101. void PackagesGoodsSetFormMain_Shown(object sender, EventArgs e)
  102. {
  103. //获取绑定拍摄次数 获取绑定套系名称
  104. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PackagesCategoryAndName(this.cmbtreev_PackageName, StrParentCode: Enum.GetName(typeof(LYFZ.EnumPublic.EnumPackagesType), StrPackagesType).ToString().Trim());
  105. this.tabPage1.Parent = null;
  106. this.tabPage2.Parent = null;
  107. switch (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  108. {
  109. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版:
  110. if (!LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition)
  111. {
  112. this.tabPage2.Parent = this.TabControl;
  113. this.btnUp.Visible = true;
  114. this.btnDown.Visible = true;
  115. }
  116. else
  117. {
  118. this.tabPage1.Parent = this.TabControl;
  119. this.tabPage2.Parent = this.TabControl;
  120. }
  121. break;
  122. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版:
  123. this.tabPage1.Parent = this.TabControl;
  124. break;
  125. default:
  126. this.tabPage1.Parent = this.TabControl;
  127. this.tabPage2.Parent = this.TabControl;
  128. break;
  129. }
  130. //权限设置
  131. if (this.StrPackagesType == 0)
  132. {
  133. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesGoodsCompetence, CustomAttributes.OperatingAuthority.Add) || LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesGoodsCompetence, CustomAttributes.OperatingAuthority.Update))
  134. { this.btnSaveed.Enabled = true; this.btnSet.Enabled = true; }
  135. else
  136. { this.btnSaveed.Enabled = false; this.btnSet.Enabled = false; }
  137. this.btnDelete_Product.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesGoodsCompetence, CustomAttributes.OperatingAuthority.Delete);
  138. }
  139. else
  140. {
  141. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesSuperposedCompetence, CustomAttributes.OperatingAuthority.Add) || LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesSuperposedCompetence, CustomAttributes.OperatingAuthority.Update))
  142. { this.btnSaveed.Enabled = true; this.btnSet.Enabled = true; }
  143. else
  144. { this.btnSaveed.Enabled = false; this.btnSet.Enabled = false; }
  145. this.btnDelete_Product.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.PackagesSuperposedCompetence, CustomAttributes.OperatingAuthority.Delete);
  146. }
  147. this.btnDelete_Service.Enabled = this.btnDelete_Product.Enabled;
  148. this.btnDelete_Sights.Enabled = this.btnDelete_Product.Enabled;
  149. #region 设置列表标题
  150. #region 商品表标题
  151. this.listViewData_Product.View = View.Details;
  152. this.listViewData_Product.GridLines = true;
  153. string[] StrColumns = "商品名称,数量,进货价格,销售单价".Split(',');
  154. int SurplusCount = 90 + 85 + 85 + 23;
  155. for (int i = 0; i < StrColumns.Length; i++)
  156. {
  157. ColumnHeader ch = new ColumnHeader();
  158. ch.Text = StrColumns[i].Trim();
  159. ch.TextAlign = HorizontalAlignment.Left;
  160. if (i == 0)
  161. { ch.Width = this.listViewData_Product.Width - SurplusCount; }
  162. else if (i == StrColumns.Length - 1)
  163. { ch.Width = 90; }
  164. else
  165. { ch.Width = 85; }
  166. switch (StrColumns[i].Trim())
  167. {
  168. case "进货价格":
  169. case "销售单价":
  170. ch.TextAlign = HorizontalAlignment.Right;
  171. break;
  172. default:
  173. ch.TextAlign = HorizontalAlignment.Center;
  174. break;
  175. }
  176. this.listViewData_Product.Columns.Add(ch);
  177. }
  178. this.mlistImage.ImageSize = new Size(25, 25);
  179. this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
  180. this.listViewData_Product.SmallImageList = mlistImage;
  181. this.listViewData_Product.MultiSelect = true;
  182. #endregion
  183. #region 服务表标题
  184. this.listViewData_Service.View = View.Details;
  185. this.listViewData_Service.GridLines = true;
  186. for (int i = 0; i < StrColumns.Length; i++)
  187. {
  188. ColumnHeader ch = new ColumnHeader();
  189. ch.Text = StrColumns[i].Trim();
  190. ch.TextAlign = HorizontalAlignment.Left;
  191. if (i == 0)
  192. { ch.Width = this.listViewData_Service.Width - SurplusCount; }
  193. else if (i == StrColumns.Length - 1)
  194. { ch.Width = 90; }
  195. else
  196. { ch.Width = 85; }
  197. switch (StrColumns[i].Trim())
  198. {
  199. case "进货价格":
  200. case "销售单价":
  201. ch.TextAlign = HorizontalAlignment.Right;
  202. break;
  203. default:
  204. ch.TextAlign = HorizontalAlignment.Center;
  205. break;
  206. }
  207. this.listViewData_Service.Columns.Add(ch);
  208. }
  209. this.listViewData_Service.SmallImageList = mlistImage;
  210. this.listViewData_Service.MultiSelect = true;
  211. #endregion
  212. #region 景点表标题
  213. this.listViewData_Sights.View = View.Details;
  214. this.listViewData_Sights.GridLines = true;
  215. ImageList imgList = new ImageList();
  216. imgList.ImageSize = new Size(1, 25);
  217. this.listViewData_Sights.SmallImageList = imgList;
  218. StrColumns = "景点名称,服装套数,成本单价,销售单价".Split(',');
  219. SurplusCount = 90 + 85 + 85 + 23;
  220. for (int i = 0; i < StrColumns.Length; i++)
  221. {
  222. ColumnHeader ch = new ColumnHeader();
  223. ch.Text = StrColumns[i].Trim();
  224. ch.TextAlign = HorizontalAlignment.Left;
  225. if (i == 0)
  226. { ch.Width = this.listViewData_Sights.Width - SurplusCount; }
  227. else if (i == StrColumns.Length - 1)
  228. { ch.Width = 90; }
  229. else
  230. { ch.Width = 85; }
  231. switch (StrColumns[i].Trim())
  232. {
  233. case "成本单价":
  234. case "销售单价":
  235. ch.TextAlign = HorizontalAlignment.Right;
  236. break;
  237. default:
  238. ch.TextAlign = HorizontalAlignment.Center;
  239. break;
  240. }
  241. this.listViewData_Sights.Columns.Add(ch);
  242. }
  243. #endregion
  244. #region 拍摄次数表标题
  245. this.listViewData_Stages.View = View.Details;
  246. this.listViewData_Stages.GridLines = true;
  247. this.listViewData_Stages.SmallImageList = imgList;
  248. StrColumns = "次数名称,入册,入底,服装套数".Split(',');
  249. for (int i = 0; i < StrColumns.Length; i++)
  250. {
  251. ColumnHeader ch = new ColumnHeader();
  252. ch.Text = StrColumns[i].Trim();
  253. switch (StrColumns[i].Trim())
  254. {
  255. case "次数名称": ch.Width = this.listViewData_Stages.Width - 270 - 23; break;
  256. case "入册": ch.Width = 90; break;
  257. case "入底": ch.Width = 90; break;
  258. case "服装套数": ch.Width = 90; break;
  259. }
  260. switch (StrColumns[i].Trim())
  261. {
  262. case "次数名称": ch.TextAlign = HorizontalAlignment.Left; break;
  263. case "入册":
  264. case "入底":
  265. case "服装套数": ch.TextAlign = HorizontalAlignment.Center; break;
  266. }
  267. this.listViewData_Stages.Columns.Add(ch);
  268. }
  269. #endregion
  270. #endregion
  271. this.IsFirstLoad = false;
  272. }
  273. /// <summary>
  274. /// 套系名称选择设置
  275. /// </summary>
  276. /// <param name="sender"></param>
  277. /// <param name="e"></param>
  278. void cmbtreev_PackageName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  279. {
  280. this.listViewData_Product.Items.Clear();
  281. this.listViewData_Product.Groups.Clear();
  282. this.listViewData_Service.Items.Clear();
  283. this.listViewData_Service.Groups.Clear();
  284. this.listViewData_Sights.Items.Clear();
  285. this.listViewData_Stages.Items.Clear();
  286. this.IsDataChange = false;
  287. //获取套系名称资料
  288. DataTable dt = orbll.GetView_Custom("tb_ErpPackages", StrWhere: "Pak_PackagesID='" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "'", ShowColumnName: "Pak_UnitPrice,Pak_IntoTheArchive,Pak_IntoTheBook").Tables[0];
  289. if (dt.Rows.Count > 0)
  290. {
  291. this.lblPakUnitPrice.Text = "套系价格:" + dt.Rows[0]["Pak_UnitPrice"].ToString().Trim();
  292. this.txtIntoRegister.Text = dt.Rows[0]["Pak_IntoTheBook"].ToString().Trim();
  293. this.txtIntoBottom.Text = dt.Rows[0]["Pak_IntoTheArchive"].ToString().Trim();
  294. #region 景点与次数
  295. DataTable tblSights = orbll.GetView_Custom("tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on tb_ErpTheScenery.ID = Pgm_ProductNumber", StrWhere: "Tsc_Name is not null And Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType in (2,3)", ShowColumnName: "tb_ErpPackagesGiftMerchandise.ID,Pgm_GiveType,Pgm_PackagesCode,Pgm_ProductNumber,Pgm_Quantity,Tsc_Name,Tsc_CostPrice,Tsc_SalesPrice,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity").Tables[0];
  296. for (int i = 0; i < tblSights.Rows.Count; i++)
  297. {
  298. ListViewItem lvItem = new ListViewItem();
  299. lvItem.Tag = tblSights.Rows[i]["Pgm_ProductNumber"].ToString().Trim() + "|" + tblSights.Rows[i]["ID"].ToString().Trim();
  300. lvItem.Text = tblSights.Rows[i]["Tsc_Name"].ToString().Trim();
  301. if (tblSights.Rows[i]["Pgm_GiveType"].ToString().Trim() == "2")
  302. {
  303. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  304. ListSubItem.Name = "服装套数";
  305. ListSubItem.Text = tblSights.Rows[i]["Pgm_Quantity"].ToString().Trim();
  306. lvItem.SubItems.Add(ListSubItem);
  307. ListSubItem = new ListViewItem.ListViewSubItem();
  308. ListSubItem.Name = "成本单价";
  309. ListSubItem.Text = tblSights.Rows[i]["Tsc_CostPrice"].ToString().Trim();
  310. lvItem.SubItems.Add(ListSubItem);
  311. ListSubItem = new ListViewItem.ListViewSubItem();
  312. ListSubItem.Name = "销售单价";
  313. ListSubItem.Text = tblSights.Rows[i]["Tsc_SalesPrice"].ToString().Trim();
  314. lvItem.SubItems.Add(ListSubItem);
  315. if ((this.listViewData_Sights.Items.Count % 2) > 0)
  316. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  317. else
  318. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  319. this.listViewData_Sights.Items.Add(lvItem);
  320. }
  321. else if (tblSights.Rows[i]["Pgm_GiveType"].ToString().Trim() == "3")
  322. {
  323. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  324. ListSubItem.Name = "入册";
  325. ListSubItem.Text = tblSights.Rows[i]["Pgm_IntoRegisterQuantity"].ToString().Trim();
  326. lvItem.SubItems.Add(ListSubItem);
  327. ListSubItem = new ListViewItem.ListViewSubItem();
  328. ListSubItem.Name = "入底";
  329. ListSubItem.Text = tblSights.Rows[i]["Pgm_IntoBottomQuantity"].ToString().Trim();
  330. lvItem.SubItems.Add(ListSubItem);
  331. ListSubItem = new ListViewItem.ListViewSubItem();
  332. ListSubItem.Name = "服装套数";
  333. ListSubItem.Text = tblSights.Rows[i]["Pgm_Quantity"].ToString().Trim();
  334. lvItem.SubItems.Add(ListSubItem);
  335. if ((this.listViewData_Stages.Items.Count % 2) > 0)
  336. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  337. else
  338. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  339. ListViewGroup man_lvg = new ListViewGroup();
  340. man_lvg.Tag = lvItem.Text;
  341. man_lvg.Name = lvItem.Text;
  342. man_lvg.Header = lvItem.Text;
  343. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  344. this.listViewData_Product.Groups.Add(man_lvg);
  345. man_lvg = new ListViewGroup();
  346. man_lvg.Tag = lvItem.Text;
  347. man_lvg.Name = lvItem.Text;
  348. man_lvg.Header = lvItem.Text;
  349. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  350. this.listViewData_Service.Groups.Add(man_lvg);
  351. this.listViewData_Stages.Items.Add(lvItem);
  352. }
  353. }
  354. #endregion
  355. #region 商品与服务
  356. if (this.tabPage2.Parent == null)
  357. {
  358. string StrTableName = "(select Prod_Class,Sc_ClassName,Pgm_GiveType,Pgm_PackagesCode from tb_ErpPackagesGiftMerchandise Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber " +
  359. "Left Join tb_ErpSystemCategory on Prod_Class = Sc_ClassCode Group by Prod_Class,Sc_ClassName,Pgm_GiveType,Pgm_PackagesCode ) as tb";
  360. DataTable dtGroup = orbll.GetView_Custom(StrTableName, StrWhere: "Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType in ('0','1')", ShowColumnName: "*").Tables[0];
  361. ListViewGroup man_lvg = null;
  362. for (int i = 0; i < dtGroup.Rows.Count; i++)
  363. {
  364. man_lvg = new ListViewGroup();
  365. man_lvg.Tag = dtGroup.Rows[i]["Sc_ClassName"].ToString().Trim();
  366. man_lvg.Name = dtGroup.Rows[i]["Prod_Class"].ToString().Trim();
  367. man_lvg.Header = dtGroup.Rows[i]["Sc_ClassName"].ToString().Trim();
  368. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  369. if (dtGroup.Rows[i]["Pgm_GiveType"].ToString().Trim() == "0")
  370. { this.listViewData_Product.Groups.Add(man_lvg); }
  371. else if (dtGroup.Rows[i]["Pgm_GiveType"].ToString().Trim() == "1")
  372. { this.listViewData_Service.Groups.Add(man_lvg); }
  373. }
  374. }
  375. else
  376. {
  377. ListViewGroup man_lvg = new ListViewGroup();
  378. man_lvg.Tag = "";
  379. man_lvg.Name = "NotGroup";
  380. man_lvg.Header = "未分组";
  381. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  382. this.listViewData_Product.Groups.Add(man_lvg);
  383. man_lvg = new ListViewGroup();
  384. man_lvg.Tag = "";
  385. man_lvg.Name = "NotGroup";
  386. man_lvg.Header = "未分组";
  387. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  388. this.listViewData_Service.Groups.Add(man_lvg);
  389. }
  390. DataTable tblProduct = orbll.GetView_Custom("tb_ErpPackagesGiftMerchandise Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber", StrWhere: "Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType in ('0','1')", ShowColumnName: "tb_ErpPackagesGiftMerchandise.ID,Pgm_GiveType,Pgm_PackagesCode,Pgm_Quantity,Prod_Number,Prod_Name,Prod_CostPrice,Prod_SalesPrice,Prod_Thumbnail,Prod_Class,Pgm_ProductGroupName").Tables[0];
  391. for (int i = 0; i < tblProduct.Rows.Count; i++)
  392. {
  393. if (!this.mlistImage.Images.Keys.Contains(tblProduct.Rows[i]["Prod_Number"].ToString().Trim()))
  394. {
  395. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetProductImage(tblProduct.Rows[i]["Prod_Thumbnail"].ToString().Trim());
  396. this.mlistImage.Images.Add(tblProduct.Rows[i]["Prod_Number"].ToString().Trim(), img);
  397. }
  398. ListViewItem lvItem = new ListViewItem();
  399. lvItem.Tag = tblProduct.Rows[i]["Prod_Number"].ToString().Trim() + "|" + tblProduct.Rows[i]["ID"].ToString().Trim();
  400. lvItem.ImageKey = tblProduct.Rows[i]["Prod_Number"].ToString().Trim();
  401. lvItem.Text = tblProduct.Rows[i]["Prod_Name"].ToString().Trim();
  402. if (tblProduct.Rows[i]["Prod_Number"]==null||string.IsNullOrEmpty(tblProduct.Rows[i]["Prod_Number"].ToString()))
  403. {
  404. lvItem.Text = "此产品已在产品设置表中删除";
  405. lvItem.ForeColor = Color.Red;
  406. }
  407. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  408. ListSubItem.Name = "数量";
  409. ListSubItem.Text = tblProduct.Rows[i]["Pgm_Quantity"].ToString().Trim();
  410. lvItem.SubItems.Add(ListSubItem);
  411. ListSubItem = new ListViewItem.ListViewSubItem();
  412. ListSubItem.Name = "进货价格";
  413. ListSubItem.Text = tblProduct.Rows[i]["Prod_CostPrice"].ToString().Trim();
  414. lvItem.SubItems.Add(ListSubItem);
  415. ListSubItem = new ListViewItem.ListViewSubItem();
  416. ListSubItem.Name = "销售单价";
  417. ListSubItem.Text = tblProduct.Rows[i]["Prod_SalesPrice"].ToString().Trim();
  418. lvItem.SubItems.Add(ListSubItem);
  419. if (tblProduct.Rows[i]["Pgm_GiveType"].ToString().Trim() == "0")
  420. {
  421. if (this.tabPage2.Parent == null)
  422. {
  423. if (this.listViewData_Product.Groups.Count > 0)
  424. { this.listViewData_Product.Groups[tblProduct.Rows[i]["Prod_Class"].ToString().Trim()].Items.Add(lvItem); }
  425. }
  426. else
  427. {
  428. if (!string.IsNullOrEmpty(tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()))
  429. {
  430. if (this.listViewData_Product.Groups[tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()] != null)
  431. { this.listViewData_Product.Groups[tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()].Items.Add(lvItem); }
  432. else
  433. { this.listViewData_Product.Groups["NotGroup"].Items.Add(lvItem); }
  434. }
  435. else
  436. { this.listViewData_Product.Groups["NotGroup"].Items.Add(lvItem); }
  437. }
  438. this.listViewData_Product.Items.Add(lvItem);
  439. }
  440. else if (tblProduct.Rows[i]["Pgm_GiveType"].ToString().Trim() == "1")
  441. {
  442. if (this.tabPage2.Parent == null)
  443. {
  444. if (this.listViewData_Service.Groups[tblProduct.Rows[i]["Prod_Class"].ToString().Trim()] != null)
  445. { this.listViewData_Service.Groups[tblProduct.Rows[i]["Prod_Class"].ToString().Trim()].Items.Add(lvItem); }
  446. }
  447. else
  448. {
  449. if (!string.IsNullOrEmpty(tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()))
  450. {
  451. if (this.listViewData_Service.Groups.Count > 0 && this.listViewData_Service.Groups[tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()]!=null)
  452. { this.listViewData_Service.Groups[tblProduct.Rows[i]["Pgm_ProductGroupName"].ToString().Trim()].Items.Add(lvItem); }
  453. else
  454. { this.listViewData_Service.Groups["NotGroup"].Items.Add(lvItem); }
  455. }
  456. else
  457. { this.listViewData_Service.Groups["NotGroup"].Items.Add(lvItem); }
  458. }
  459. this.listViewData_Service.Items.Add(lvItem);
  460. }
  461. }
  462. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系商品);
  463. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系服务);
  464. #endregion
  465. }
  466. else
  467. {
  468. this.lblPakUnitPrice.Text = "套系价格:0";
  469. MessageBoxCustom.Show(this.cmbtreev_PackageName.Text.ToString() + " 此类型无套系名称!请添加套系名称");
  470. this.cmbtreev_PackageName.SetTextAndTag_ValueNull();
  471. }
  472. this.GetSeriesCostsPriceStatistics();
  473. }
  474. /// <summary>
  475. /// 商品工具箱_产品
  476. /// </summary>
  477. /// <param name="sender"></param>
  478. /// <param name="e"></param>
  479. void btnToolbox_Product_Click(object sender, EventArgs e)
  480. {
  481. if (string.IsNullOrEmpty(this.cmbtreev_PackageName.Text))
  482. { MessageBoxCustom.Show("请选择套系名称!"); return; }
  483. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm();
  484. frm.LoadType = "套系包含商品";
  485. frm.ShowDialog();
  486. if (frm.IsSaveed)
  487. {
  488. for (int i = 0; i < frm.mlist_SmallImage.Images.Keys.Count; i++)
  489. {
  490. if (!this.mlistImage.Images.Keys.Contains(frm.mlist_SmallImage.Images.Keys[i].Trim()))
  491. { this.mlistImage.Images.Add(frm.mlist_SmallImage.Images.Keys[i].Trim(), frm.mlist_SmallImage.Images[frm.mlist_SmallImage.Images.Keys[i].Trim()]); }
  492. }
  493. for (int i = 0; i < frm.mlist.Count; i++)
  494. {
  495. ListViewItem lvItem = new ListViewItem();
  496. lvItem.Tag = frm.mlist[i].Prod_Number.Trim() + "|";
  497. lvItem.ImageKey = frm.mlist[i].Prod_Number.Trim();
  498. lvItem.Text = frm.mlist[i].Prod_Name.Trim();
  499. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  500. ListSubItem.Name = "数量";
  501. ListSubItem.Text = "1";
  502. lvItem.SubItems.Add(ListSubItem);
  503. ListSubItem = new ListViewItem.ListViewSubItem();
  504. ListSubItem.Name = "进货价格";
  505. ListSubItem.Text = frm.mlist[i].Prod_CostPrice.ToString().Trim();
  506. lvItem.SubItems.Add(ListSubItem);
  507. ListSubItem = new ListViewItem.ListViewSubItem();
  508. ListSubItem.Name = "销售单价";
  509. ListSubItem.Text = frm.mlist[i].Prod_SalesPrice.ToString().Trim();
  510. lvItem.SubItems.Add(ListSubItem);
  511. //if (this.listViewData_Product.Groups.Count > 0)
  512. {
  513. if (this.tabPage2.Parent == null)
  514. {
  515. if (this.listViewData_Product.Groups[frm.mlist[i].Prod_Class] == null)
  516. {
  517. DataTable tbl = orbll.GetView_Custom("tb_ErpSystemCategory", StrWhere: "Sc_ClassCode = '" + frm.mlist[i].Prod_Class + "'", ShowColumnName: "Sc_ClassName").Tables[0];
  518. ListViewGroup man_lvg = new ListViewGroup();
  519. man_lvg.Name = frm.mlist[i].Prod_Class;
  520. if (tbl.Rows.Count > 0)
  521. { man_lvg.Header = tbl.Rows[0]["Sc_ClassName"].ToString().Trim(); }
  522. else
  523. { man_lvg.Header = "未分组"; }
  524. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  525. this.listViewData_Product.Groups.Add(man_lvg);
  526. }
  527. this.listViewData_Product.Groups[frm.mlist[i].Prod_Class].Items.Add(lvItem);
  528. }
  529. else
  530. {
  531. lvItem.Group = this.listViewData_Product.Groups["NotGroup"];
  532. }
  533. }
  534. this.listViewData_Product.Items.Add(lvItem);
  535. this.IsDataChange = true;
  536. }
  537. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Product);
  538. }
  539. }
  540. /// <summary>
  541. /// 商品工具箱_服务
  542. /// </summary>
  543. /// <param name="sender"></param>
  544. /// <param name="e"></param>
  545. void btnToolbox_Service_Click(object sender, EventArgs e)
  546. {
  547. if (string.IsNullOrEmpty(this.cmbtreev_PackageName.Text))
  548. { MessageBoxCustom.Show("请选择套系名称!"); return; }
  549. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm();
  550. frm.LoadType = "婚庆服务";
  551. frm.ShowDialog();
  552. if (frm.IsSaveed)
  553. {
  554. for (int i = 0; i < frm.mlist_SmallImage.Images.Keys.Count; i++)
  555. {
  556. if (!this.mlistImage.Images.Keys.Contains(frm.mlist_SmallImage.Images.Keys[i].Trim()))
  557. { this.mlistImage.Images.Add(frm.mlist_SmallImage.Images.Keys[i].Trim(), frm.mlist_SmallImage.Images[frm.mlist_SmallImage.Images.Keys[i].Trim()]); }
  558. }
  559. for (int i = 0; i < frm.mlist.Count; i++)
  560. {
  561. ListViewItem lvItem = new ListViewItem();
  562. lvItem.Tag = frm.mlist[i].Prod_Number.Trim() + "|";
  563. lvItem.ImageKey = frm.mlist[i].Prod_Number.Trim();
  564. lvItem.Text = frm.mlist[i].Prod_Name.Trim();
  565. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  566. ListSubItem.Name = "数量";
  567. ListSubItem.Text = "1";
  568. lvItem.SubItems.Add(ListSubItem);
  569. ListSubItem = new ListViewItem.ListViewSubItem();
  570. ListSubItem.Name = "进货价格";
  571. ListSubItem.Text = frm.mlist[i].Prod_CostPrice.ToString().Trim();
  572. lvItem.SubItems.Add(ListSubItem);
  573. ListSubItem = new ListViewItem.ListViewSubItem();
  574. ListSubItem.Name = "销售单价";
  575. ListSubItem.Text = frm.mlist[i].Prod_SalesPrice.ToString().Trim();
  576. lvItem.SubItems.Add(ListSubItem);
  577. //if (this.listViewData_Service.Groups.Count > 0)
  578. {
  579. if (this.tabPage2.Parent == null)
  580. {
  581. if (this.listViewData_Service.Groups[frm.mlist[i].Prod_Class] == null)
  582. {
  583. DataTable tbl = orbll.GetView_Custom("tb_ErpSystemCategory", StrWhere: "Sc_ClassCode = '" + frm.mlist[i].Prod_Class + "'", ShowColumnName: "Sc_ClassName").Tables[0];
  584. ListViewGroup man_lvg = new ListViewGroup();
  585. man_lvg.Name = frm.mlist[i].Prod_Class;
  586. if (tbl.Rows.Count > 0)
  587. { man_lvg.Header = tbl.Rows[0]["Sc_ClassName"].ToString().Trim(); }
  588. else
  589. { man_lvg.Header = "未分组"; }
  590. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  591. this.listViewData_Service.Groups.Add(man_lvg);
  592. }
  593. this.listViewData_Service.Groups[frm.mlist[i].Prod_Class].Items.Add(lvItem);
  594. }
  595. else
  596. {
  597. lvItem.Group = this.listViewData_Service.Groups["NotGroup"];
  598. }
  599. }
  600. this.listViewData_Service.Items.Add(lvItem);
  601. this.IsDataChange = true;
  602. }
  603. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  604. }
  605. }
  606. /// <summary>
  607. /// 景点、次数工具箱
  608. /// </summary>
  609. /// <param name="sender"></param>
  610. /// <param name="e"></param>
  611. void btnToolbox_Sights_Click(object sender, EventArgs e)
  612. {
  613. if (string.IsNullOrEmpty(this.cmbtreev_PackageName.Text))
  614. { MessageBoxCustom.Show("请选择套系名称!"); return; }
  615. LYFZ.Software.MainBusiness.InitialSet.PackagesGoods.FrmTheScenery frm = new PackagesGoods.FrmTheScenery();
  616. frm.StrPackagesType = this.StrPackagesType;
  617. if (this.TabControl.SelectedTab.Name.Trim() == "tabPage1")
  618. {
  619. #region
  620. frm.StrSightsType = "0";
  621. frm.ShowDialog();
  622. if (frm.IsSaveed)
  623. {
  624. for (int i = 0; i < frm.tbl_Select.Rows.Count; i++)
  625. {
  626. bool IsFind = false;
  627. for (int j = 0; j < this.listViewData_Sights.Items.Count; j++)
  628. {
  629. if (this.listViewData_Sights.Items[j].Text.Trim() == frm.tbl_Select.Rows[i]["Tsc_Name"].ToString().Trim())
  630. { IsFind = true; break; }
  631. }
  632. if (!IsFind)
  633. {
  634. ListViewItem lvItem = new ListViewItem();
  635. lvItem.Tag = frm.tbl_Select.Rows[i]["ID"].ToString().Trim() + "|";
  636. lvItem.Text = frm.tbl_Select.Rows[i]["Tsc_Name"].ToString().Trim();
  637. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  638. ListSubItem.Name = "服装套数";
  639. ListSubItem.Text = "1";
  640. lvItem.SubItems.Add(ListSubItem);
  641. ListSubItem = new ListViewItem.ListViewSubItem();
  642. ListSubItem.Name = "成本单价";
  643. ListSubItem.Text = frm.tbl_Select.Rows[i]["Tsc_CostPrice"].ToString().Trim();
  644. lvItem.SubItems.Add(ListSubItem);
  645. ListSubItem = new ListViewItem.ListViewSubItem();
  646. ListSubItem.Name = "销售单价";
  647. ListSubItem.Text = frm.tbl_Select.Rows[i]["Tsc_SalesPrice"].ToString().Trim();
  648. lvItem.SubItems.Add(ListSubItem);
  649. if ((this.listViewData_Sights.Items.Count % 2) > 0)
  650. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  651. else
  652. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  653. this.listViewData_Sights.Items.Add(lvItem);
  654. this.IsDataChange = true;
  655. }
  656. }
  657. }
  658. #endregion
  659. }
  660. else if (this.TabControl.SelectedTab.Name.Trim() == "tabPage2")
  661. {
  662. #region
  663. frm.StrSightsType = "1";
  664. frm.ShowDialog();
  665. if (frm.IsSaveed)
  666. {
  667. for (int i = 0; i < frm.tbl_Select.Rows.Count; i++)
  668. {
  669. bool IsFind = false;
  670. for (int j = 0; j < this.listViewData_Stages.Items.Count; j++)
  671. {
  672. if (this.listViewData_Stages.Items[j].Text.Trim() == frm.tbl_Select.Rows[i]["Tsc_Name"].ToString().Trim())
  673. { IsFind = true; break; }
  674. }
  675. if (!IsFind)
  676. {
  677. ListViewItem lvItem = new ListViewItem();
  678. lvItem.Tag = frm.tbl_Select.Rows[i]["ID"].ToString().Trim() + "|";
  679. lvItem.Text = frm.tbl_Select.Rows[i]["Tsc_Name"].ToString().Trim();
  680. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  681. ListSubItem.Name = "入册";
  682. ListSubItem.Text = "0";
  683. lvItem.SubItems.Add(ListSubItem);
  684. ListSubItem = new ListViewItem.ListViewSubItem();
  685. ListSubItem.Name = "入底";
  686. ListSubItem.Text = "0";
  687. lvItem.SubItems.Add(ListSubItem);
  688. ListSubItem = new ListViewItem.ListViewSubItem();
  689. ListSubItem.Name = "服装套数";
  690. ListSubItem.Text = "1";
  691. lvItem.SubItems.Add(ListSubItem);
  692. if ((this.listViewData_Stages.Items.Count % 2) > 0)
  693. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  694. else
  695. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  696. ListViewGroup man_lvg = new ListViewGroup();
  697. man_lvg.Tag = lvItem.Text;
  698. man_lvg.Name = lvItem.Text;
  699. man_lvg.Header = lvItem.Text;
  700. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  701. this.listViewData_Product.Groups.Add(man_lvg);
  702. man_lvg = new ListViewGroup();
  703. man_lvg.Tag = lvItem.Text;
  704. man_lvg.Name = lvItem.Text;
  705. man_lvg.Header = lvItem.Text;
  706. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  707. this.listViewData_Service.Groups.Add(man_lvg);
  708. this.listViewData_Stages.Items.Add(lvItem);
  709. this.IsDataChange = true;
  710. }
  711. }
  712. }
  713. #endregion
  714. }
  715. }
  716. /// <summary>
  717. /// 商品删除
  718. /// </summary>
  719. /// <param name="sender"></param>
  720. /// <param name="e"></param>
  721. void btnDelete_Product_Click(object sender, EventArgs e)
  722. {
  723. if (this.listViewData_Product.Items.Count > 0 && this.listViewData_Product.SelectedItems.Count > 0)
  724. {
  725. if (MessageBoxCustom.Show("你确定要移除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  726. {
  727. this.listViewData_Product.Items.Remove(this.listViewData_Product.SelectedItems[0]);
  728. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系商品);
  729. this.IsDataChange = true;
  730. this.GetSeriesCostsPriceStatistics();
  731. }
  732. }
  733. }
  734. /// <summary>
  735. /// 服务删除
  736. /// </summary>
  737. /// <param name="sender"></param>
  738. /// <param name="e"></param>
  739. void btnDelete_Service_Click(object sender, EventArgs e)
  740. {
  741. if (this.listViewData_Service.Items.Count > 0 && this.listViewData_Service.SelectedItems.Count > 0)
  742. {
  743. if (MessageBoxCustom.Show("你确定要移除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  744. {
  745. this.listViewData_Service.Items.Remove(this.listViewData_Service.SelectedItems[0]);
  746. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系服务);
  747. this.IsDataChange = true;
  748. this.GetSeriesCostsPriceStatistics();
  749. }
  750. }
  751. }
  752. /// <summary>
  753. /// 景点、次数删除
  754. /// </summary>
  755. /// <param name="sender"></param>
  756. /// <param name="e"></param>
  757. void btnDelete_Sights_Click(object sender, EventArgs e)
  758. {
  759. if (this.TabControl.SelectedTab.Name.Trim() == "tabPage1")
  760. {
  761. if (this.listViewData_Sights.Items.Count > 0 && this.listViewData_Sights.SelectedItems.Count > 0)
  762. {
  763. if (MessageBoxCustom.Show("你确定要移除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  764. {
  765. List<ListViewItem> ListRemove = new List<ListViewItem>();
  766. for (int i = 0; i < this.listViewData_Sights.SelectedItems.Count; i++)
  767. { ListRemove.Add(this.listViewData_Sights.SelectedItems[i]); }
  768. for (int i = 0; i < ListRemove.Count; i++)
  769. { this.listViewData_Sights.Items.Remove(ListRemove[i]); }
  770. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系景点);
  771. this.IsDataChange = true;
  772. this.GetSeriesCostsPriceStatistics();
  773. }
  774. }
  775. }
  776. else if (this.TabControl.SelectedTab.Name.Trim() == "tabPage2")
  777. {
  778. if (this.listViewData_Stages.Items.Count > 0 && this.listViewData_Stages.SelectedItems.Count > 0)
  779. {
  780. if (MessageBoxCustom.Show("你确定要移除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  781. {
  782. List<ListViewItem> ListRemove = new List<ListViewItem>();
  783. for (int i = 0; i < this.listViewData_Stages.SelectedItems.Count; i++)
  784. {
  785. for (int j = 0; j < this.listViewData_Product.Items.Count; j++)
  786. {
  787. if (this.listViewData_Product.Items[j].Group.Header.Trim() == this.listViewData_Stages.SelectedItems[i].Text.Trim())
  788. {
  789. this.listViewData_Product.Items[j].Group = this.listViewData_Product.Groups["NotGroup"];
  790. }
  791. }
  792. this.listViewData_Product.Groups.Remove(this.listViewData_Product.Groups[this.listViewData_Stages.SelectedItems[i].Text.Trim()]);
  793. for (int j = 0; j < this.listViewData_Service.Items.Count; j++)
  794. {
  795. if (this.listViewData_Service.Items[j].Group.Header.Trim() == this.listViewData_Stages.SelectedItems[i].Text.Trim())
  796. {
  797. this.listViewData_Service.Items[j].Group = this.listViewData_Service.Groups["NotGroup"];
  798. }
  799. }
  800. this.listViewData_Service.Groups.Remove(this.listViewData_Service.Groups[this.listViewData_Stages.SelectedItems[i].Text.Trim()]);
  801. ListRemove.Add(this.listViewData_Stages.SelectedItems[i]);
  802. }
  803. for (int i = 0; i < ListRemove.Count; i++)
  804. { this.listViewData_Stages.Items.Remove(ListRemove[i]); }
  805. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系次数);
  806. this.IsDataChange = true;
  807. this.GetSeriesCostsPriceStatistics();
  808. }
  809. }
  810. }
  811. }
  812. /// <summary>
  813. /// 保存
  814. /// </summary>
  815. /// <param name="sender"></param>
  816. /// <param name="e"></param>
  817. void btnSaveed_Click(object sender, EventArgs e)
  818. {
  819. if (!string.IsNullOrEmpty(this.cmbtreev_PackageName.Text.Trim()))
  820. {
  821. if (!this.IsDataChange)
  822. { MessageBoxCustom.Show("没做任何修改,无须保存!"); return; }
  823. DateTime StrTime = SDateTime.Now;
  824. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  825. string StrPackagesName = this.cmbtreev_PackageName.Text.Trim();
  826. string StrPackagesClass = this.cmbtreev_PackageName.Tag.ToString().Trim();
  827. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  828. DataTable tblPackage = orbll.GetView_Custom("tb_ErpPackages", StrWhere: "Pak_PackagesID = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "'", ShowColumnName: "*").Tables[0];
  829. if (tblPackage.Rows.Count <= 0)
  830. { MessageBoxCustom.Show("套系'" + this.cmbtreev_PackageName.Text.Trim() + "'不存在,可能已经被删除!"); return; }
  831. LYFZ.Model.Model_ErpPackagesGiftMerchandise model = null;
  832. DataTable tblProduct = orbll.GetView_Custom("tb_ErpPackagesGiftMerchandise", StrWhere: "Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType in ('0','1')", ShowColumnName: "*").Tables[0];
  833. #region 商品
  834. for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
  835. {
  836. string[] StrArray = this.listViewData_Product.Items[i].Tag.ToString().Trim().Split('|');
  837. if (string.IsNullOrEmpty(this.listViewData_Product.Items[i].SubItems["数量"].Text.Trim()))
  838. { MessageBoxCustom.Show("商品'" + this.listViewData_Product.Items[i].Text + "'的数量不能为空!"); return; }
  839. string strProductName = this.listViewData_Product.Items[i].Text.Trim();
  840. int Quantity = Convert.ToInt32(this.listViewData_Product.Items[i].SubItems["数量"].Text);
  841. if (!string.IsNullOrEmpty(StrArray[1].Trim()))
  842. {
  843. DataRow[] dtRow = tblProduct.Select("ID = '" + StrArray[1].Trim() + "'");
  844. if (dtRow.Length <= 0)
  845. { MessageBoxCustom.Show("此套系赠送商品已被修改过,商品'" + strProductName + "'已被删除!"); return; }
  846. model = pgmbll.DataRowToModel(dtRow[0]);
  847. model.Pgm_Quantity = Quantity;
  848. if (this.listViewData_Product.Items[i].Group.Tag != null)
  849. { model.Pgm_ProductGroupName = this.listViewData_Product.Items[i].Group.Tag.ToString().Trim(); }
  850. model.Pgm_UpdateDateTime = StrTime;
  851. model.Pgm_UpdateName = StrUserID;
  852. clist.Add(pgmbll.GetUpdateCommandInfo(model));
  853. tblProduct.Rows.Remove(dtRow[0]);
  854. }
  855. else
  856. {
  857. model = new Model.Model_ErpPackagesGiftMerchandise();
  858. model.Pgm_GiveType = 0;
  859. model.Pgm_ProductNumber = StrArray[0].Trim();
  860. model.Pgm_ProductName = strProductName;
  861. model.Pgm_Quantity = Quantity;
  862. model.Pgm_StageNumber = "";
  863. model.Pgm_StageName = "";
  864. model.Pgm_PackagesNumber = tblPackage.Rows[0]["Pak_PackagesClass"].ToString().Trim();
  865. model.Pgm_PackagesName = StrPackagesName;
  866. model.Pgm_PackagesCode = StrPackagesClass;
  867. if (this.listViewData_Product.Items[i].Group.Tag != null)
  868. { model.Pgm_ProductGroupName = this.listViewData_Product.Items[i].Group.Tag.ToString().Trim(); }
  869. model.Pgm_CreateDateTime = StrTime;
  870. model.Pgm_CreateName = StrUserID;
  871. clist.Add(pgmbll.GetAddCommandInfo(model));
  872. }
  873. }
  874. #endregion
  875. #region 服务
  876. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  877. {
  878. string[] StrArray = this.listViewData_Service.Items[i].Tag.ToString().Trim().Split('|');
  879. if (string.IsNullOrEmpty(this.listViewData_Service.Items[i].SubItems["数量"].Text.Trim()))
  880. { MessageBoxCustom.Show("服务'" + this.listViewData_Service.Items[i].Text + "'的数量不能为空!"); return; }
  881. string strProductName = this.listViewData_Service.Items[i].Text.Trim();
  882. int Quantity = Convert.ToInt32(this.listViewData_Service.Items[i].SubItems["数量"].Text);
  883. if (!string.IsNullOrEmpty(StrArray[1].Trim()))
  884. {
  885. DataRow[] dtRow = tblProduct.Select("ID = '" + StrArray[1].Trim() + "'");
  886. if (dtRow.Length <= 0)
  887. { MessageBoxCustom.Show("此套系赠送服务已被修改过,服务'" + strProductName + "'已被删除!"); return; }
  888. model = pgmbll.DataRowToModel(dtRow[0]);
  889. model.Pgm_Quantity = Quantity;
  890. if (this.listViewData_Service.Items[i].Group.Tag != null)
  891. { model.Pgm_ProductGroupName = this.listViewData_Service.Items[i].Group.Tag.ToString().Trim(); }
  892. model.Pgm_UpdateDateTime = StrTime;
  893. model.Pgm_UpdateName = StrUserID;
  894. clist.Add(pgmbll.GetUpdateCommandInfo(model));
  895. tblProduct.Rows.Remove(dtRow[0]);
  896. }
  897. else
  898. {
  899. model = new Model.Model_ErpPackagesGiftMerchandise();
  900. model.Pgm_GiveType = 1;
  901. model.Pgm_ProductNumber = StrArray[0].Trim();
  902. model.Pgm_ProductName = strProductName;
  903. model.Pgm_Quantity = Quantity;
  904. model.Pgm_StageNumber = "";
  905. model.Pgm_StageName = "";
  906. model.Pgm_PackagesNumber = tblPackage.Rows[0]["Pak_PackagesClass"].ToString().Trim();
  907. model.Pgm_PackagesName = StrPackagesName;
  908. model.Pgm_PackagesCode = StrPackagesClass;
  909. if (this.listViewData_Service.Items[i].Group.Tag != null)
  910. { model.Pgm_ProductGroupName = this.listViewData_Service.Items[i].Group.Tag.ToString().Trim(); }
  911. model.Pgm_CreateDateTime = StrTime;
  912. model.Pgm_CreateName = StrUserID;
  913. clist.Add(pgmbll.GetAddCommandInfo(model));
  914. }
  915. }
  916. #endregion
  917. for (int i = 0; i < tblProduct.Rows.Count; i++)
  918. { clist.Add(pgmbll.GetDeleteCommandInfo("ID", "=", tblProduct.Rows[i]["ID"])); }
  919. #region 景点
  920. if (this.TabControl.TabPages.ContainsKey("tabPage1"))
  921. {
  922. DataTable tblSights = orbll.GetView_Custom("tb_ErpPackagesGiftMerchandise", StrWhere: "Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType = '2'", ShowColumnName: "*").Tables[0];
  923. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  924. {
  925. string[] StrArray = this.listViewData_Sights.Items[i].Tag.ToString().Trim().Split('|');
  926. if (string.IsNullOrEmpty(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text.Trim()))
  927. { MessageBoxCustom.Show("景点'" + this.listViewData_Sights.Items[i].Text + "'的服装套数不能为空!"); return; }
  928. string strProductName = this.listViewData_Sights.Items[i].Text.Trim();
  929. int Quantity = Convert.ToInt32(this.listViewData_Sights.Items[i].SubItems["服装套数"].Text);
  930. if (!string.IsNullOrEmpty(StrArray[1].Trim()))
  931. {
  932. DataRow[] dtRow = tblSights.Select("ID = '" + StrArray[1].Trim() + "'");
  933. if (dtRow.Length <= 0)
  934. { MessageBoxCustom.Show("此套系赠送景点已被修改过,景点'" + strProductName + "'已被删除!"); return; }
  935. model = pgmbll.DataRowToModel(dtRow[0]);
  936. model.Pgm_IntoRegisterQuantity = 0;
  937. model.Pgm_IntoBottomQuantity = 0;
  938. model.Pgm_Quantity = Quantity;
  939. model.Pgm_UpdateDateTime = StrTime;
  940. model.Pgm_UpdateName = StrUserID;
  941. clist.Add(pgmbll.GetUpdateCommandInfo(model));
  942. tblSights.Rows.Remove(dtRow[0]);
  943. }
  944. else
  945. {
  946. model = new Model.Model_ErpPackagesGiftMerchandise();
  947. model.Pgm_GiveType = 2;
  948. model.Pgm_ProductNumber = StrArray[0].Trim();
  949. model.Pgm_Quantity = Quantity;
  950. model.Pgm_PackagesNumber = tblPackage.Rows[0]["Pak_PackagesClass"].ToString().Trim();
  951. model.Pgm_ProductName = strProductName;
  952. model.Pgm_PackagesName = StrPackagesName;
  953. model.Pgm_StageNumber = "";
  954. model.Pgm_StageName = "";
  955. model.Pgm_IntoRegisterQuantity = 0;
  956. model.Pgm_IntoBottomQuantity = 0;
  957. model.Pgm_PackagesCode = StrPackagesClass;
  958. model.Pgm_CreateDateTime = StrTime;
  959. model.Pgm_CreateName = StrUserID;
  960. clist.Add(pgmbll.GetAddCommandInfo(model));
  961. }
  962. }
  963. for (int i = 0; i < tblSights.Rows.Count; i++)
  964. { clist.Add(pgmbll.GetDeleteCommandInfo("ID", "=", tblSights.Rows[i]["ID"])); }
  965. }
  966. #endregion
  967. #region 次数
  968. if (this.TabControl.TabPages.ContainsKey("tabPage2"))
  969. {
  970. DataTable tblStages = orbll.GetView_Custom("tb_ErpPackagesGiftMerchandise", StrWhere: "Pgm_PackagesCode = '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "' And Pgm_GiveType = '3'", ShowColumnName: "*").Tables[0];
  971. for (int i = 0; i < this.listViewData_Stages.Items.Count; i++)
  972. {
  973. string[] StrArray = this.listViewData_Stages.Items[i].Tag.ToString().Trim().Split('|');
  974. if (string.IsNullOrEmpty(this.listViewData_Stages.Items[i].SubItems["服装套数"].Text.Trim()))
  975. { MessageBoxCustom.Show("次数'" + this.listViewData_Stages.Items[i].Text + "'的服装套数不能为空!"); return; }
  976. int IntoRegisterQuantity = 0;
  977. if (!string.IsNullOrEmpty(this.listViewData_Stages.Items[i].SubItems["入册"].Text.Trim()))
  978. { IntoRegisterQuantity = Convert.ToInt32(this.listViewData_Stages.Items[i].SubItems["入册"].Text.Trim()); }
  979. int IntoBottomQuantity = 0;
  980. if (!string.IsNullOrEmpty(this.listViewData_Stages.Items[i].SubItems["入底"].Text.Trim()))
  981. { IntoBottomQuantity = Convert.ToInt32(this.listViewData_Stages.Items[i].SubItems["入底"].Text.Trim()); }
  982. string strProductName = this.listViewData_Stages.Items[i].Text.Trim();
  983. int Quantity = Convert.ToInt32(this.listViewData_Stages.Items[i].SubItems["服装套数"].Text);
  984. if (!string.IsNullOrEmpty(StrArray[1].Trim()))
  985. {
  986. DataRow[] dtRow = tblStages.Select("ID = '" + StrArray[1].Trim() + "'");
  987. if (dtRow.Length <= 0)
  988. { MessageBoxCustom.Show("此套系赠送次数已被修改过,次数'" + strProductName + "'已被删除!"); return; }
  989. model = pgmbll.DataRowToModel(dtRow[0]);
  990. model.Pgm_IntoRegisterQuantity = IntoRegisterQuantity;
  991. model.Pgm_IntoBottomQuantity = IntoBottomQuantity;
  992. model.Pgm_Quantity = Quantity;
  993. model.Pgm_UpdateDateTime = StrTime;
  994. model.Pgm_UpdateName = StrUserID;
  995. clist.Add(pgmbll.GetUpdateCommandInfo(model));
  996. tblStages.Rows.Remove(dtRow[0]);
  997. }
  998. else
  999. {
  1000. model = new Model.Model_ErpPackagesGiftMerchandise();
  1001. model.Pgm_GiveType = 3;
  1002. model.Pgm_ProductNumber = StrArray[0].Trim();
  1003. model.Pgm_Quantity = Quantity;
  1004. model.Pgm_PackagesNumber = tblPackage.Rows[0]["Pak_PackagesClass"].ToString().Trim();
  1005. model.Pgm_ProductName = strProductName;
  1006. model.Pgm_PackagesName = StrPackagesName;
  1007. model.Pgm_StageNumber = "";
  1008. model.Pgm_StageName = "";
  1009. model.Pgm_IntoRegisterQuantity = IntoRegisterQuantity;
  1010. model.Pgm_IntoBottomQuantity = IntoBottomQuantity;
  1011. model.Pgm_PackagesCode = StrPackagesClass;
  1012. model.Pgm_CreateDateTime = StrTime;
  1013. model.Pgm_CreateName = StrUserID;
  1014. clist.Add(pgmbll.GetAddCommandInfo(model));
  1015. }
  1016. }
  1017. for (int i = 0; i < tblStages.Rows.Count; i++)
  1018. { clist.Add(pgmbll.GetDeleteCommandInfo("ID", "=", tblStages.Rows[i]["ID"])); }
  1019. }
  1020. #endregion
  1021. int IntoRegisterQuantityPackage = 0;
  1022. if (!string.IsNullOrEmpty(this.txtIntoRegister.Text.Trim()))
  1023. { IntoRegisterQuantityPackage = Convert.ToInt32(this.txtIntoRegister.Text.Trim()); }
  1024. int IntoBottomQuantityPackage = 0;
  1025. if (!string.IsNullOrEmpty(this.txtIntoBottom.Text.Trim()))
  1026. { IntoBottomQuantityPackage = Convert.ToInt32(this.txtIntoBottom.Text.Trim()); }
  1027. LYFZ.Model.Model_ErpPackages modelPackages = pkbll.DataRowToModel(tblPackage.Select("Pak_PackagesID= '" + this.cmbtreev_PackageName.Tag.ToString().Trim() + "'")[0]);
  1028. modelPackages.Pak_IntoTheArchive = IntoBottomQuantityPackage;
  1029. modelPackages.Pak_IntoTheBook = IntoRegisterQuantityPackage;
  1030. modelPackages.Pak_UpdateDatetime = StrTime;
  1031. modelPackages.Pak_Update = StrUserID;
  1032. clist.Add(pkbll.GetUpdateCommandInfo(modelPackages));
  1033. if (clist.Count > 0)
  1034. {
  1035. if (MessageBoxCustom.Show("您确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1036. { return; }
  1037. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  1038. {
  1039. this.IsSaveed = true;
  1040. this.IsDataChange = false;
  1041. MessageBoxCustom.Show("保存成功!");
  1042. }
  1043. else
  1044. { MessageBoxCustom.Show("保存失败!"); }
  1045. }
  1046. }
  1047. }
  1048. /// <summary>
  1049. /// 关闭
  1050. /// </summary>
  1051. /// <param name="sender"></param>
  1052. /// <param name="e"></param>
  1053. void btnCloseed_Click(object sender, EventArgs e)
  1054. {
  1055. this.Close();
  1056. }
  1057. /// <summary>
  1058. /// 设置
  1059. /// </summary>
  1060. /// <param name="sender"></param>
  1061. /// <param name="e"></param>
  1062. void btnSet_Click(object sender, EventArgs e)
  1063. {
  1064. LYFZ.Software.MainBusiness.InitialSet.FrmPackagesSet frm = new FrmPackagesSet();
  1065. frm.IsShowUcNavigationTool = false;
  1066. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1067. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1068. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1069. frm.StrPackagesType = this.StrPackagesType;
  1070. frm.ShowDialog();
  1071. if (frm.IsSaveed)
  1072. {
  1073. this.listViewData_Product.Items.Clear();
  1074. this.listViewData_Service.Items.Clear();
  1075. this.listViewData_Sights.Items.Clear();
  1076. this.listViewData_Stages.Items.Clear();
  1077. this.cmbtreev_PackageName.SetTextAndTag_ValueNull();
  1078. this.lblCostPrice.Text = "0.00";
  1079. this.lblSalePrice.Text = "0.00";
  1080. this.IsPackagesSet = true;
  1081. this.IsDataChange = false;
  1082. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PackagesCategoryAndName(this.cmbtreev_PackageName, StrParentCode: Enum.GetName(typeof(LYFZ.EnumPublic.EnumPackagesType), StrPackagesType).ToString().Trim());
  1083. }
  1084. }
  1085. /// <summary>
  1086. /// 上移
  1087. /// </summary>
  1088. /// <param name="sender"></param>
  1089. /// <param name="e"></param>
  1090. void btnUp_Click(object sender, EventArgs e)
  1091. {
  1092. if (this.listViewData_Stages.Items.Count > 0 && this.listViewData_Stages.SelectedItems.Count > 0)
  1093. {
  1094. int selectionIdx = this.listViewData_Stages.SelectedIndices[0];
  1095. if (selectionIdx > 0)
  1096. {
  1097. ListViewItem lvItem = new ListViewItem();
  1098. ListViewItem.ListViewSubItem ListSubItem = null;
  1099. for (int i = 0; i < this.listViewData_Stages.Columns.Count; i++)
  1100. {
  1101. if (i == 0)
  1102. {
  1103. lvItem.ImageKey = this.listViewData_Stages.SelectedItems[0].ImageKey;
  1104. lvItem.Text = this.listViewData_Stages.SelectedItems[0].Text;
  1105. lvItem.Tag = this.listViewData_Stages.SelectedItems[0].Tag;
  1106. }
  1107. else
  1108. {
  1109. ListSubItem = new ListViewItem.ListViewSubItem();
  1110. ListSubItem.Name = this.listViewData_Stages.Columns[i].Text.Trim();
  1111. ListSubItem.Text = this.listViewData_Stages.SelectedItems[0].SubItems[this.listViewData_Stages.Columns[i].Text.Trim()].Text.Trim();
  1112. lvItem.SubItems.Add(ListSubItem);
  1113. }
  1114. }
  1115. //ListViewItem lvItem = new ListViewItem();
  1116. //lvItem.Text = this.listViewData_Stages.SelectedItems[0].Text;
  1117. //lvItem.Tag = this.listViewData_Stages.SelectedItems[0].Tag;
  1118. //ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1119. //ListSubItem.Name = "服装套数";
  1120. //ListSubItem.Text = this.listViewData_Stages.SelectedItems[0].SubItems["服装套数"].Text.Trim();
  1121. //lvItem.SubItems.Add(ListSubItem);
  1122. this.listViewData_Stages.Items.Remove(this.listViewData_Stages.SelectedItems[0]);
  1123. this.listViewData_Stages.Items.Insert(selectionIdx - 1, lvItem);
  1124. this.listViewData_Stages.Items[selectionIdx - 1].Selected = true;
  1125. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系次数);
  1126. this.listViewData_Stages.Select();
  1127. }
  1128. }
  1129. }
  1130. /// <summary>
  1131. /// 下移
  1132. /// </summary>
  1133. /// <param name="sender"></param>
  1134. /// <param name="e"></param>
  1135. void btnDown_Click(object sender, EventArgs e)
  1136. {
  1137. if (this.listViewData_Stages.Items.Count > 0 && this.listViewData_Stages.SelectedItems.Count > 0)
  1138. {
  1139. int selectionIdx = this.listViewData_Stages.SelectedIndices[0];
  1140. if (selectionIdx < (this.listViewData_Stages.Items.Count - 1))
  1141. {
  1142. ListViewItem lvItem = new ListViewItem();
  1143. ListViewItem.ListViewSubItem ListSubItem = null;
  1144. for (int i = 0; i < this.listViewData_Stages.Columns.Count; i++)
  1145. {
  1146. if (i == 0)
  1147. {
  1148. lvItem.ImageKey = this.listViewData_Stages.SelectedItems[0].ImageKey;
  1149. lvItem.Text = this.listViewData_Stages.SelectedItems[0].Text;
  1150. lvItem.Tag = this.listViewData_Stages.SelectedItems[0].Tag;
  1151. }
  1152. else
  1153. {
  1154. ListSubItem = new ListViewItem.ListViewSubItem();
  1155. ListSubItem.Name = this.listViewData_Stages.Columns[i].Text.Trim();
  1156. ListSubItem.Text = this.listViewData_Stages.SelectedItems[0].SubItems[this.listViewData_Stages.Columns[i].Text.Trim()].Text.Trim();
  1157. lvItem.SubItems.Add(ListSubItem);
  1158. }
  1159. }
  1160. //ListViewItem lvItem = new ListViewItem();
  1161. //lvItem.Text = this.listViewData_Stages.SelectedItems[0].Text;
  1162. //lvItem.Tag = this.listViewData_Stages.SelectedItems[0].Tag;
  1163. //ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1164. //ListSubItem.Name = "服装套数";
  1165. //ListSubItem.Text = this.listViewData_Stages.SelectedItems[0].SubItems["服装套数"].Text.Trim();
  1166. //lvItem.SubItems.Add(ListSubItem);
  1167. this.listViewData_Stages.Items.Remove(this.listViewData_Stages.SelectedItems[0]);
  1168. this.listViewData_Stages.Items.Insert(selectionIdx + 1, lvItem);
  1169. this.listViewData_Stages.Items[selectionIdx + 1].Selected = true;
  1170. this.ListViewDrawSingleOrDoubleRows(ListViewType.套系次数);
  1171. this.listViewData_Stages.Select();
  1172. }
  1173. }
  1174. }
  1175. /// <summary>
  1176. /// 选择版本获取商品成本价,卖价
  1177. /// </summary>
  1178. /// <param name="sender"></param>
  1179. /// <param name="e"></param>
  1180. void TabControl_SelectedIndexChanged(object sender, EventArgs e)
  1181. {
  1182. if (!this.IsFirstLoad)
  1183. {
  1184. if (this.TabControl.SelectedTab != null)
  1185. {
  1186. if (this.TabControl.SelectedTab.Name.Trim() == "tabPage2")
  1187. {
  1188. this.btnDown.Visible = true;
  1189. this.btnUp.Visible = true;
  1190. }
  1191. else
  1192. {
  1193. this.btnDown.Visible = false;
  1194. this.btnUp.Visible = false;
  1195. }
  1196. this.GetSeriesCostsPriceStatistics();
  1197. }
  1198. }
  1199. }
  1200. /// <summary>
  1201. /// 商品列表双击
  1202. /// </summary>
  1203. /// <param name="sender"></param>
  1204. /// <param name="e"></param>
  1205. void listViewData_Product_MouseDoubleClick(object sender, MouseEventArgs e)
  1206. {
  1207. ListViewHitTestInfo info = this.listViewData_Product.HitTest(e.X, e.Y);
  1208. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1209. {
  1210. Rectangle rect = info.SubItem.Bounds;
  1211. switch (info.SubItem.Name.Trim())
  1212. {
  1213. case "数量":
  1214. this.txtText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + this.splitContainerEx1.Location.Y + 2);
  1215. this.txtText.Size = rect.Size;
  1216. this.txtText.Visible = true;
  1217. this.txtText.Tag = info.SubItem.Name.Trim() + "|Product";
  1218. this.txtText.Text = info.SubItem.Text.Trim();
  1219. this.txtText.Focus();
  1220. break;
  1221. }
  1222. }
  1223. }
  1224. /// <summary>
  1225. /// 服务列表双击
  1226. /// </summary>
  1227. /// <param name="sender"></param>
  1228. /// <param name="e"></param>
  1229. void listViewData_Service_MouseDoubleClick(object sender, MouseEventArgs e)
  1230. {
  1231. ListViewHitTestInfo info = this.listViewData_Service.HitTest(e.X, e.Y);
  1232. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1233. {
  1234. Rectangle rect = info.SubItem.Bounds;
  1235. switch (info.SubItem.Name.Trim())
  1236. {
  1237. case "数量":
  1238. this.txtText.Location = new Point(this.splitContainerEx1.Panel1.Width + rect.Location.X + this.listViewData_Service.Location.X + 6, rect.Location.Y + this.listViewData_Service.Location.Y + this.splitContainerEx1.Location.Y + 2);
  1239. this.txtText.Size = rect.Size;
  1240. this.txtText.Visible = true;
  1241. this.txtText.Tag = info.SubItem.Name.Trim() + "|Service";
  1242. this.txtText.Text = info.SubItem.Text.Trim();
  1243. this.txtText.Focus();
  1244. break;
  1245. }
  1246. }
  1247. }
  1248. /// <summary>
  1249. /// 景点列表双击
  1250. /// </summary>
  1251. /// <param name="sender"></param>
  1252. /// <param name="e"></param>
  1253. void listViewData_Sights_MouseDoubleClick(object sender, MouseEventArgs e)
  1254. {
  1255. ListViewHitTestInfo info = this.listViewData_Sights.HitTest(e.X, e.Y);
  1256. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1257. {
  1258. Rectangle rect = info.SubItem.Bounds;
  1259. switch (info.SubItem.Name.Trim())
  1260. {
  1261. case "服装套数":
  1262. this.txtText.Location = new Point(this.splitContainerEx1.Panel1.Width + rect.Location.X + this.listViewData_Sights.Location.X + 10, rect.Location.Y + this.listViewData_Sights.Location.Y + this.splitContainerEx1.Location.Y + this.splitContainerEx2.Panel1.Height + 39);
  1263. this.txtText.Size = rect.Size;
  1264. this.txtText.Visible = true;
  1265. this.txtText.Tag = info.SubItem.Name.Trim() + "|Sights";
  1266. this.txtText.Text = info.SubItem.Text.Trim();
  1267. this.txtText.Focus();
  1268. break;
  1269. }
  1270. }
  1271. }
  1272. /// <summary>
  1273. /// 次数列表双击
  1274. /// </summary>
  1275. /// <param name="sender"></param>
  1276. /// <param name="e"></param>
  1277. void listViewData_Stages_MouseDoubleClick(object sender, MouseEventArgs e)
  1278. {
  1279. ListViewHitTestInfo info = this.listViewData_Stages.HitTest(e.X, e.Y);
  1280. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1281. {
  1282. Rectangle rect = info.SubItem.Bounds;
  1283. switch (info.SubItem.Name.Trim())
  1284. {
  1285. case "入册":
  1286. case "入底":
  1287. case "服装套数":
  1288. this.txtText.Location = new Point(this.splitContainerEx1.Panel1.Width + rect.Location.X + this.listViewData_Stages.Location.X + 10, rect.Location.Y + this.listViewData_Stages.Location.Y + this.splitContainerEx1.Location.Y + this.splitContainerEx2.Panel1.Height + 39);
  1289. this.txtText.Size = rect.Size;
  1290. this.txtText.Visible = true;
  1291. this.txtText.Tag = info.SubItem.Name.Trim() + "|Stages";
  1292. this.txtText.Text = info.SubItem.Text.Trim();
  1293. this.txtText.Focus();
  1294. break;
  1295. }
  1296. }
  1297. }
  1298. /// <summary>
  1299. /// 商品右键
  1300. /// </summary>
  1301. /// <param name="sender"></param>
  1302. /// <param name="e"></param>
  1303. void listViewData_Product_MouseDown(object sender, MouseEventArgs e)
  1304. {
  1305. if (e.Button == MouseButtons.Right)
  1306. {
  1307. LYFZ.ComponentLibrary.ContextMenuStripEx contextmenu = new ContextMenuStripEx();
  1308. contextmenu.Name = "Source";
  1309. contextmenu.ItemClicked += contextmenu_ItemClicked;
  1310. //弹出操作菜单
  1311. contextmenu.Items.Clear();
  1312. contextmenu.Show(MousePosition.X, MousePosition.Y);
  1313. if (this.listViewData_Product.SelectedItems.Count > 0)
  1314. {
  1315. ToolStripMenuItem item = null;
  1316. for (int i = 0; i < this.listViewData_Stages.Items.Count; i++)
  1317. {
  1318. item = new ToolStripMenuItem();
  1319. item.Text = this.listViewData_Stages.Items[i].Text.Trim();
  1320. item.Name = "Grouped_Product_" + i;
  1321. item.Tag = this.listViewData_Stages.Items[i].Text.Trim();
  1322. contextmenu.Items.Add(item);
  1323. }
  1324. item = new ToolStripMenuItem();
  1325. item.Text = "未分组";
  1326. item.Name = "Grouped_Product_NotGroup_";
  1327. item.Tag = "";
  1328. contextmenu.Items.Add(item);
  1329. if (this.listViewData_Product.SelectedItems.Count == 1)
  1330. {
  1331. ToolStripSeparator tools = new ToolStripSeparator();
  1332. contextmenu.Items.Add(tools);
  1333. item = new ToolStripMenuItem();
  1334. item.Text = "放大(" + this.listViewData_Product.SelectedItems[0].Text.Trim() + ")";
  1335. item.Name = "ZoomView_0";
  1336. item.Tag = this.listViewData_Product.SelectedItems[0].Tag.ToString().Trim();
  1337. contextmenu.Items.Add(item);
  1338. }
  1339. }
  1340. contextmenu.Show();
  1341. }
  1342. }
  1343. /// <summary>
  1344. /// 服务右键
  1345. /// </summary>
  1346. /// <param name="sender"></param>
  1347. /// <param name="e"></param>
  1348. void listViewData_Service_MouseDown(object sender, MouseEventArgs e)
  1349. {
  1350. if (e.Button == MouseButtons.Right)
  1351. {
  1352. LYFZ.ComponentLibrary.ContextMenuStripEx contextmenu = new ContextMenuStripEx();
  1353. contextmenu.Name = "Source";
  1354. contextmenu.ItemClicked += contextmenu_ItemClicked;
  1355. //弹出操作菜单
  1356. contextmenu.Items.Clear();
  1357. contextmenu.Show(MousePosition.X, MousePosition.Y);
  1358. if (this.listViewData_Service.SelectedItems.Count > 0)
  1359. {
  1360. ToolStripMenuItem item = null;
  1361. for (int i = 0; i < this.listViewData_Stages.Items.Count; i++)
  1362. {
  1363. item = new ToolStripMenuItem();
  1364. item.Text = this.listViewData_Stages.Items[i].Text.Trim();
  1365. item.Name = "Grouped_Service_" + i;
  1366. item.Tag = this.listViewData_Stages.Items[i].Text.Trim();
  1367. contextmenu.Items.Add(item);
  1368. }
  1369. item = new ToolStripMenuItem();
  1370. item.Text = "未分组";
  1371. item.Name = "Grouped_Service_NotGroup";
  1372. item.Tag = "";
  1373. contextmenu.Items.Add(item);
  1374. if (this.listViewData_Service.SelectedItems.Count == 1)
  1375. {
  1376. ToolStripSeparator tools = new ToolStripSeparator();
  1377. contextmenu.Items.Add(tools);
  1378. item = new ToolStripMenuItem();
  1379. item.Text = "放大(" + this.listViewData_Service.SelectedItems[0].Text.Trim() + ")";
  1380. item.Name = "ZoomView_0";
  1381. item.Tag = this.listViewData_Service.SelectedItems[0].Tag.ToString().Trim();
  1382. contextmenu.Items.Add(item);
  1383. }
  1384. }
  1385. contextmenu.Show();
  1386. }
  1387. }
  1388. /// <summary>
  1389. /// 右键菜单选择事件
  1390. /// </summary>
  1391. /// <param name="sender"></param>
  1392. /// <param name="e"></param>
  1393. void contextmenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  1394. {
  1395. ToolStripItem item = e.ClickedItem;
  1396. if (!string.IsNullOrEmpty(item.Text.Trim()))
  1397. {
  1398. string[] StrArrayName = item.Name.Trim().Split('_');
  1399. switch (StrArrayName[0].Trim())
  1400. {
  1401. case "ZoomView":
  1402. string[] StrArray = item.Tag.ToString().Trim().Split('|');
  1403. DataTable tbl = orbll.GetView_Custom("tb_ErpProduct", StrWhere: "Prod_Number = '" + StrArray[0].Trim() + "'", ShowColumnName: "Prod_Thumbnail").Tables[0];
  1404. if (tbl.Rows.Count > 0)
  1405. {
  1406. if (!string.IsNullOrEmpty(tbl.Rows[0]["Prod_Thumbnail"].ToString().Trim()))
  1407. {
  1408. LYFZ.Software.MainBusiness.InitialSet.Product.FrmProductPic frm = new InitialSet.Product.FrmProductPic();
  1409. frm.FrmImage = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(tbl.Rows[0]["Prod_Thumbnail"].ToString()));
  1410. frm.ShowDialog();
  1411. }
  1412. else
  1413. { MessageBoxCustom.Show("产品未上传相片!"); return; }
  1414. }
  1415. break;
  1416. case "Grouped":
  1417. this.IsDataChange = true;
  1418. switch (StrArrayName[1].Trim())
  1419. {
  1420. case "Product":
  1421. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1422. {
  1423. switch (StrArrayName[2].Trim())
  1424. {
  1425. case "NotGroup":
  1426. this.listViewData_Product.SelectedItems[i].Group = this.listViewData_Product.Groups["NotGroup"];
  1427. break;
  1428. default:
  1429. this.listViewData_Product.SelectedItems[i].Group = this.listViewData_Product.Groups[item.Text.Trim()];
  1430. break;
  1431. }
  1432. }
  1433. break;
  1434. case "Service":
  1435. for (int i = 0; i < this.listViewData_Service.SelectedItems.Count; i++)
  1436. {
  1437. switch (StrArrayName[2].Trim())
  1438. {
  1439. case "NotGroup":
  1440. this.listViewData_Service.SelectedItems[i].Group = this.listViewData_Service.Groups["NotGroup"];
  1441. break;
  1442. default:
  1443. this.listViewData_Service.SelectedItems[i].Group = this.listViewData_Service.Groups[item.Text.Trim()];
  1444. break;
  1445. }
  1446. }
  1447. break;
  1448. }
  1449. break;
  1450. }
  1451. }
  1452. }
  1453. /// <summary>
  1454. /// 文本框控件限制输入
  1455. /// </summary>
  1456. /// <param name="sender"></param>
  1457. /// <param name="e"></param>
  1458. void txtText_KeyPress(object sender, KeyPressEventArgs e)
  1459. {
  1460. string[] StrArray = this.txtText.Tag.ToString().Trim().Split('|');
  1461. bool IsFind = false;
  1462. switch (StrArray[0].Trim())
  1463. {
  1464. case "入册":
  1465. case "入底":
  1466. if (this.StrPackagesType == 0)
  1467. {
  1468. IsFind = true;
  1469. if (Convert.ToString(e.KeyChar) == "-")
  1470. {
  1471. if (this.txtText.BaseText.SelectedText.Trim() == this.txtText.Text.Trim())
  1472. { this.txtText.Text = ""; }
  1473. if (this.txtText.Text.Trim().IndexOf('-') != -1)
  1474. { e.Handled = true; }
  1475. if (this.txtText.Text.Trim().Length > 0)
  1476. { e.Handled = true; }
  1477. }
  1478. else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  1479. { e.Handled = true; }
  1480. else
  1481. {
  1482. if (!string.IsNullOrEmpty(this.txtText.Text.Trim()))
  1483. {
  1484. char[] chr = this.txtText.Text.Trim().ToArray();
  1485. if (chr[0].ToString().Trim() == "-")
  1486. {
  1487. if (Char.IsNumber(e.KeyChar))
  1488. {
  1489. if (Convert.ToInt32(e.KeyChar.ToString().Trim()) != 1)
  1490. { e.Handled = true; }
  1491. }
  1492. }
  1493. }
  1494. }
  1495. }
  1496. break;
  1497. }
  1498. if (!IsFind)
  1499. {
  1500. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  1501. { e.Handled = true; }
  1502. }
  1503. }
  1504. /// <summary>
  1505. /// 文本框控件离开事件
  1506. /// </summary>
  1507. /// <param name="sender"></param>
  1508. /// <param name="e"></param>
  1509. void txtText_Leave(object sender, EventArgs e)
  1510. {
  1511. string[] StrArray = this.txtText.Tag.ToString().Trim().Split('|');
  1512. switch (StrArray[1].Trim())
  1513. {
  1514. case "Product":
  1515. if (this.listViewData_Product.SelectedItems[0].SubItems[StrArray[0].Trim()].Text.Trim() != this.txtText.Text.Trim())
  1516. {
  1517. this.listViewData_Product.SelectedItems[0].SubItems[StrArray[0].Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text;
  1518. this.IsDataChange = true;
  1519. this.GetSeriesCostsPriceStatistics();
  1520. }
  1521. break;
  1522. case "Service":
  1523. if (this.listViewData_Service.SelectedItems[0].SubItems[StrArray[0].Trim()].Text.Trim() != this.txtText.Text.Trim())
  1524. {
  1525. this.listViewData_Service.SelectedItems[0].SubItems[StrArray[0].Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text;
  1526. this.IsDataChange = true;
  1527. this.GetSeriesCostsPriceStatistics();
  1528. }
  1529. break;
  1530. case "Sights":
  1531. if (this.listViewData_Sights.SelectedItems[0].SubItems[StrArray[0].Trim()].Text.Trim() != this.txtText.Text.Trim())
  1532. {
  1533. this.listViewData_Sights.SelectedItems[0].SubItems[StrArray[0].Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text;
  1534. this.IsDataChange = true;
  1535. this.GetSeriesCostsPriceStatistics();
  1536. }
  1537. break;
  1538. case "Stages":
  1539. if (this.listViewData_Stages.SelectedItems[0].SubItems[StrArray[0].Trim()].Text.Trim() != this.txtText.Text.Trim())
  1540. {
  1541. this.listViewData_Stages.SelectedItems[0].SubItems[StrArray[0].Trim()].Text = this.txtText.Text.Trim() == "" ? "1" : this.txtText.Text;
  1542. this.IsDataChange = true;
  1543. this.GetSeriesCostsPriceStatistics();
  1544. }
  1545. break;
  1546. }
  1547. this.txtText.Visible = false;
  1548. }
  1549. /// <summary>
  1550. /// 入册
  1551. /// </summary>
  1552. /// <param name="sender"></param>
  1553. /// <param name="e"></param>
  1554. void txtIntoRegister_KeyPress(object sender, KeyPressEventArgs e)
  1555. {
  1556. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  1557. { e.Handled = true; }
  1558. if (!e.Handled)
  1559. { this.IsDataChange = true; }
  1560. }
  1561. /// <summary>
  1562. /// 入底
  1563. /// </summary>
  1564. /// <param name="sender"></param>
  1565. /// <param name="e"></param>
  1566. void txtIntoBottom_KeyPress(object sender, KeyPressEventArgs e)
  1567. {
  1568. if (this.StrPackagesType == 0)
  1569. {
  1570. if (Convert.ToString(e.KeyChar) == "-")
  1571. {
  1572. if (this.txtIntoBottom.BaseText.SelectedText.Trim() == this.txtIntoBottom.Text.Trim())
  1573. { this.txtIntoBottom.Text = ""; }
  1574. if (this.txtIntoBottom.Text.Trim().IndexOf('-') != -1)
  1575. { e.Handled = true; }
  1576. if (this.txtIntoBottom.Text.Trim().Length > 0)
  1577. { e.Handled = true; }
  1578. }
  1579. else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  1580. { e.Handled = true; }
  1581. else
  1582. {
  1583. if (!string.IsNullOrEmpty(this.txtIntoBottom.Text.Trim()))
  1584. {
  1585. char[] chr = this.txtIntoBottom.Text.Trim().ToArray();
  1586. if (chr[0].ToString().Trim() == "-")
  1587. {
  1588. if (Char.IsNumber(e.KeyChar))
  1589. {
  1590. if (Convert.ToInt32(e.KeyChar.ToString().Trim()) != 1)
  1591. { e.Handled = true; }
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. else
  1598. {
  1599. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  1600. { e.Handled = true; }
  1601. }
  1602. if (!e.Handled)
  1603. { this.IsDataChange = true; }
  1604. }
  1605. /// <summary>
  1606. /// 窗体关闭前
  1607. /// </summary>
  1608. /// <param name="sender"></param>
  1609. /// <param name="e"></param>
  1610. void PackagesGoodsSetFormMain_FormClosing(object sender, FormClosingEventArgs e)
  1611. {
  1612. if (!this.IsSaveed)
  1613. {
  1614. if (this.IsPackagesSet)
  1615. { this.IsSaveed = this.IsPackagesSet; }
  1616. }
  1617. }
  1618. #region
  1619. /// <summary>
  1620. /// 获取套系成本统计
  1621. /// </summary>
  1622. void GetSeriesCostsPriceStatistics()
  1623. {
  1624. decimal CostPrice = 0;
  1625. decimal SalePrice = 0;
  1626. if (this.TabControl.SelectedTab.Name.Trim() == "tabPage1")
  1627. {
  1628. this.GetProductPrice(ref CostPrice, ref SalePrice);
  1629. this.GetServicePrice(ref CostPrice, ref SalePrice);
  1630. this.GetSightsPrice(ref CostPrice, ref SalePrice);
  1631. this.lblCostPrice.Text = Convert.ToDecimal(CostPrice).ToString("N2");
  1632. this.lblSalePrice.Text = Convert.ToDecimal(SalePrice).ToString("N2");
  1633. }
  1634. else
  1635. {
  1636. this.GetProductPrice(ref CostPrice, ref SalePrice);
  1637. this.GetServicePrice(ref CostPrice, ref SalePrice);
  1638. this.lblCostPrice.Text = Convert.ToDecimal(CostPrice).ToString("N2");
  1639. this.lblSalePrice.Text = Convert.ToDecimal(SalePrice).ToString("N2");
  1640. }
  1641. ////儿童与婚纱区分版本
  1642. ////版本判断
  1643. //switch (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  1644. //{
  1645. // case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版:
  1646. // this.GetProductPrice(ref CostPrice, ref SalePrice);
  1647. // this.GetServicePrice(ref CostPrice, ref SalePrice);
  1648. // this.lblCostPrice.Text = Convert.ToDecimal(CostPrice).ToString("N2");
  1649. // this.lblSalePrice.Text = Convert.ToDecimal(SalePrice).ToString("N2");
  1650. // break;
  1651. // default:
  1652. // this.GetProductPrice(ref CostPrice, ref SalePrice);
  1653. // this.GetServicePrice(ref CostPrice, ref SalePrice);
  1654. // this.GetSightsPrice(ref CostPrice, ref SalePrice);
  1655. // this.lblCostPrice.Text = Convert.ToDecimal(CostPrice).ToString("N2");
  1656. // this.lblSalePrice.Text = Convert.ToDecimal(SalePrice).ToString("N2");
  1657. // break;
  1658. //}
  1659. }
  1660. decimal ConvertToDecimal(object obj)
  1661. {
  1662. try
  1663. {
  1664. if (obj != null && !string.IsNullOrEmpty(obj.ToString()))
  1665. {
  1666. decimal outdec = 0.00m;
  1667. decimal.TryParse(obj.ToString().Trim(), out outdec);
  1668. return outdec;
  1669. }
  1670. else
  1671. {
  1672. return 0.00m;
  1673. }
  1674. }
  1675. catch {
  1676. return 0.00m;
  1677. }
  1678. }
  1679. /// <summary>
  1680. /// 获取商品成本价
  1681. /// </summary>
  1682. /// <param name="CostPrice"></param>
  1683. /// <param name="SalesPrice"></param>
  1684. void GetProductPrice(ref decimal CostPrice, ref decimal SalesPrice)
  1685. {
  1686. for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
  1687. {
  1688. CostPrice += ConvertToDecimal(this.listViewData_Product.Items[i].SubItems["数量"].Text.Trim()) * ConvertToDecimal(this.listViewData_Product.Items[i].SubItems["进货价格"].Text.Trim());
  1689. SalesPrice += ConvertToDecimal(this.listViewData_Product.Items[i].SubItems["数量"].Text.Trim()) * ConvertToDecimal(this.listViewData_Product.Items[i].SubItems["销售单价"].Text.Trim());
  1690. }
  1691. }
  1692. /// <summary>
  1693. /// 获取服务成本价
  1694. /// </summary>
  1695. /// <param name="CostPrice"></param>
  1696. /// <param name="SalesPrice"></param>
  1697. void GetServicePrice(ref decimal CostPrice, ref decimal SalesPrice)
  1698. {
  1699. for (int i = 0; i < this.listViewData_Service.Items.Count; i++)
  1700. {
  1701. CostPrice += ConvertToDecimal(this.listViewData_Service.Items[i].SubItems["数量"].Text.Trim()) * ConvertToDecimal(this.listViewData_Service.Items[i].SubItems["进货价格"].Text.Trim());
  1702. SalesPrice += ConvertToDecimal(this.listViewData_Service.Items[i].SubItems["数量"].Text.Trim()) * ConvertToDecimal(this.listViewData_Service.Items[i].SubItems["销售单价"].Text.Trim());
  1703. }
  1704. }
  1705. /// <summary>
  1706. /// 获取景点成本价
  1707. /// </summary>
  1708. /// <param name="CostPrice"></param>
  1709. /// <param name="SalesPrice"></param>
  1710. void GetSightsPrice(ref decimal CostPrice, ref decimal SalesPrice)
  1711. {
  1712. for (int i = 0; i < this.listViewData_Sights.Items.Count; i++)
  1713. {
  1714. CostPrice += ConvertToDecimal(this.listViewData_Sights.Items[i].SubItems["成本单价"].Text.Trim());
  1715. SalesPrice += ConvertToDecimal(this.listViewData_Sights.Items[i].SubItems["销售单价"].Text.Trim());
  1716. }
  1717. }
  1718. /// <summary>
  1719. /// 绘制列表单双行
  1720. /// </summary>
  1721. /// <param name="ProcessType"></param>
  1722. void ListViewDrawSingleOrDoubleRows(ListViewType ProcessType)
  1723. {
  1724. if (ProcessType == ListViewType.套系商品)
  1725. {
  1726. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Product);
  1727. }
  1728. else if (ProcessType == ListViewType.套系服务)
  1729. {
  1730. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Service);
  1731. }
  1732. else if (ProcessType == ListViewType.套系景点)
  1733. {
  1734. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Sights);
  1735. }
  1736. else if (ProcessType == ListViewType.套系次数)
  1737. {
  1738. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Stages);
  1739. }
  1740. }
  1741. #endregion
  1742. enum ListViewType
  1743. {
  1744. 套系商品,
  1745. 套系服务,
  1746. 套系景点,
  1747. 套系次数
  1748. }
  1749. }
  1750. }