frmEditStatisticsProgram.cs 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. namespace LYFZ.Software.MainBusiness.FinancialManagement
  9. {
  10. public class frmEditStatisticsProgram : LYFZ.Software.UI.FinancialManagement.frmEditStatisticsProgram
  11. {
  12. public frmEditStatisticsProgram() {
  13. this.btnClose.Click += btnClose_Click;
  14. this.btnSave.Click += btnSave_Click;
  15. this.Shown += frmEditStatisticsProgram_Shown;
  16. this.treecustomersource.AfterCheck += treecustomersource_AfterCheck;
  17. this.treeOrdercategory.AfterCheck += treecustomersource_AfterCheck;
  18. this.treePaymentMethod.AfterCheck += treecustomersource_AfterCheck;
  19. //
  20. this.grbAdditionalConditions.Hide();
  21. this.treecustomersource.NodeMouseClick += treecustomersource_NodeMouseClick;
  22. this.treeOrdercategory.NodeMouseClick += treecustomersource_NodeMouseClick;
  23. this.treePaymentMethod.NodeMouseClick += treecustomersource_NodeMouseClick;
  24. this.cmbItemCategory.SelectedIndexChanged += cmbItemCategory_SelectedIndexChanged;
  25. this.cmbProjectTitle.ComboBoxTreeViewEx_TextChanged += cmbProjectTitle_ComboBoxTreeViewEx_TextChanged;
  26. // SetGrbAdditionalConditions(false);
  27. }
  28. void cmbProjectTitle_ComboBoxTreeViewEx_TextChanged(object sender, TreeViewEventArgs e)
  29. {
  30. if (this.cmbItemCategory.SelectedIndex != 0)
  31. {
  32. LYFZ.Model.WageStatisticsQueryItem sItem = (LYFZ.Model.WageStatisticsQueryItem)Enum.Parse(typeof(LYFZ.Model.WageStatisticsQueryItem), this.cmbItemCategory.SelectedItem.ToString());
  33. if (sItem == Model.WageStatisticsQueryItem.订单后期)
  34. {
  35. if (e.Node.Name.ToUpper() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.选片二销).ToUpper())
  36. {
  37. ShowOrHideProcessAdditionalConditions(true);
  38. ShowOrHideSelectionFilmsAmount(true);
  39. SetGrbAdditionalConditions(true);
  40. }
  41. else {
  42. ShowOrHideProcessAdditionalConditions(false);
  43. ShowOrHideSelectionFilmsAmount(false);
  44. this.plProcessAdditionalConditions.Visible = true;
  45. SetGrbAdditionalConditions(true);
  46. this.plProcessAdditionalConditions.Visible = false;
  47. }
  48. }
  49. }
  50. }
  51. BLL.BLL_WageQueryConfig wqcBll = new BLL.BLL_WageQueryConfig();
  52. LYFZ.Model.Model_WageQueryConfig wqcModel = null;
  53. /// <summary>
  54. /// 当前统计配置对象
  55. /// </summary>
  56. public LYFZ.Model.Model_WageQueryConfig WqcModel
  57. {
  58. get { return wqcModel; }
  59. set { wqcModel = value; }
  60. }
  61. LYFZ.Model.AdditionalConditions aCModel = null;
  62. /// <summary>
  63. /// 保存
  64. /// </summary>
  65. /// <param name="sender"></param>
  66. /// <param name="e"></param>
  67. void btnSave_Click(object sender, EventArgs e)
  68. {
  69. try
  70. {
  71. if (string.IsNullOrEmpty(this.txtProgramName.Text.Trim()))
  72. {
  73. MessageBoxCustom.Show("请输入统计名称");
  74. return;
  75. }
  76. string programName = this.txtProgramName.Text.Trim();
  77. if (wqcModel == null || wqcModel.ID <= 0)
  78. {
  79. if (wqcBll.Exists("WQC_QueryName", programName))
  80. {
  81. MessageBoxCustom.Show("你输入的统计名称已经存在,请更换名称");
  82. return;
  83. }
  84. }
  85. if (this.cmbItemCategory.SelectedIndex == 0)
  86. {
  87. MessageBoxCustom.Show("请选择要统计的项目"); return;
  88. }
  89. if (this.cmbProjectTitle.TreeView.SelectedNode == null)
  90. {
  91. MessageBoxCustom.Show("请选择项目内容"); return;
  92. }
  93. if (this.cmbCommissionScheme.Enabled && this.cmbCommissionScheme.TreeView.SelectedNode == null)
  94. {
  95. MessageBoxCustom.Show("请选择提成方案"); return;
  96. }
  97. // MessageBoxCustom.Show(programName+"\r\n"+this.cmbItemCategory.SelectedItem.ToString()+"\r\n"+this.cmbProjectTitle.TreeView.SelectedNode.Text+"\r\n"+this.cmbCommissionScheme.TreeView.SelectedNode.Text);
  98. LYFZ.Model.WageStatisticsQueryItem sItem = (LYFZ.Model.WageStatisticsQueryItem)Enum.Parse(typeof(LYFZ.Model.WageStatisticsQueryItem), this.cmbItemCategory.SelectedItem.ToString());
  99. if (wqcModel == null)
  100. {
  101. wqcModel = new Model.Model_WageQueryConfig();
  102. }
  103. if (wqcModel.ID <= 0)
  104. {
  105. wqcModel.WQC_CreateDateTime = SDateTime.NowToLong;
  106. wqcModel.WQC_CreateName = CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  107. wqcModel.WQC_Remarks = "";
  108. }
  109. wqcModel.WQC_UpdateDateTime = SDateTime.NowToLong;
  110. wqcModel.WQC_UpdateName = CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  111. wqcModel.WQC_QueryName = programName;
  112. wqcModel.WQC_StatisticalItems = (int)sItem;
  113. wqcModel.WQC_ProjectContent = this.cmbProjectTitle.TreeView.SelectedNode.Name;
  114. wqcModel.WQC_Type = 0;
  115. if (this.cmbCommissionScheme.TreeView.SelectedNode != null)
  116. {
  117. wqcModel.WQC_CommissionProgram = this.cmbCommissionScheme.TreeView.SelectedNode.Name;
  118. }
  119. wqcModel.WQC_QueryCondition = "";
  120. if (aCModel == null)
  121. {
  122. aCModel = new Model.AdditionalConditions();
  123. }
  124. switch (sItem)
  125. {
  126. case Model.WageStatisticsQueryItem.订单前期:
  127. case Model.WageStatisticsQueryItem.订单后期:
  128. case Model.WageStatisticsQueryItem.服务前期:
  129. case Model.WageStatisticsQueryItem.服务后期:
  130. aCModel.IsProcessStatus = this.chkProcessStatus.Checked;
  131. if (this.chkProcessStatus.Checked)
  132. {
  133. aCModel.ProcessStatusValue = this.cmbProcessStatus.Text.Trim();
  134. }
  135. aCModel.IsSetsAmount = this.chkorderamount.Checked;
  136. if (this.chkorderamount.Checked)
  137. {
  138. aCModel.SetsAmountStar = Convert.ToInt32(this.nudorderamountStar.Value);
  139. aCModel.SetsAmountEnd = Convert.ToInt32(this.nudorderamountEnd.Value);
  140. if (aCModel.SetsAmountStar > aCModel.SetsAmountEnd)
  141. {
  142. aCModel.IsSetsAmount = false;
  143. MessageBoxCustom.Show("套系金额的开始值不能大于结束值");
  144. return;
  145. }
  146. }
  147. aCModel.IsSelectionFilmsAmount = this.chkSelectionFilmsAmount.Checked;
  148. if (this.chkSelectionFilmsAmount.Checked)
  149. {
  150. aCModel.SelectionFilmsAmountStar = Convert.ToInt32(this.nudSelectionFilmsAmountStar.Value);
  151. aCModel.SelectionFilmsAmountEnd = Convert.ToInt32(this.nudSelectionFilmsAmountEnd.Value);
  152. if (aCModel.SelectionFilmsAmountStar > aCModel.SelectionFilmsAmountEnd)
  153. {
  154. aCModel.IsSelectionFilmsAmount = false;
  155. MessageBoxCustom.Show("选片金额的开始值不能大于结束值");
  156. return;
  157. }
  158. }
  159. aCModel.IsSatisfactionScore = this.chkSatisfactionScore.Checked;
  160. if (this.chkSatisfactionScore.Checked)
  161. {
  162. aCModel.SatisfactionScoreStar = Convert.ToInt32(this.nudSatisfactionScoreStar.Value);
  163. aCModel.SatisfactionScoreEnd = Convert.ToInt32(this.nudSatisfactionScoreEnd.Value);
  164. if (aCModel.SatisfactionScoreStar > aCModel.SatisfactionScoreEnd)
  165. {
  166. aCModel.IsSatisfactionScore = false;
  167. MessageBoxCustom.Show("满意分值的开始值不能大于结束值");
  168. return;
  169. }
  170. }
  171. aCModel.IsCustomerSource = this.chkcustomersource.Checked;
  172. if (this.chkcustomersource.Checked)
  173. {
  174. SetListValue(aCModel.CustomerSourceList, this.treecustomersource);
  175. }
  176. aCModel.IsOrderCategory = this.chkOrdercategory.Checked;
  177. if (this.chkOrdercategory.Checked)
  178. {
  179. SetListValue(aCModel.OrderCategoryList, this.treeOrdercategory);
  180. }
  181. aCModel.IsPaymentMethod = this.chkPaymentMethod.Checked;
  182. if (this.chkPaymentMethod.Checked)
  183. {
  184. SetListValue(aCModel.PaymentMethodList, this.treePaymentMethod);
  185. }
  186. wqcModel.WQC_QueryCondition = aCModel.ToString();
  187. break;
  188. case Model.WageStatisticsQueryItem.计件提成:
  189. wqcModel.WQC_QueryCondition = "";
  190. wqcModel.WQC_CommissionProgram = "按工作内容计件提成";
  191. wqcModel.WQC_Type = 1;
  192. break;
  193. case Model.WageStatisticsQueryItem.散客消费:
  194. case Model.WageStatisticsQueryItem.礼服租售:
  195. case Model.WageStatisticsQueryItem.会员充值:
  196. case Model.WageStatisticsQueryItem.服务卡充值:
  197. if (sItem == Model.WageStatisticsQueryItem.礼服租售
  198. ||sItem== Model.WageStatisticsQueryItem.散客消费)
  199. {
  200. aCModel.IsSetsAmount = this.chkLifuJinE.Checked;
  201. if (this.chkLifuJinE.Checked)
  202. {
  203. aCModel.SetsAmountStar = Convert.ToInt32(this.nuLiFuStar.Value);
  204. aCModel.SetsAmountEnd = Convert.ToInt32(this.nuLiFuEnd.Value);
  205. if (aCModel.SetsAmountStar > aCModel.SetsAmountEnd)
  206. {
  207. aCModel.IsSetsAmount = false;
  208. MessageBoxCustom.Show("订单金额的开始值不能大于结束值");
  209. return;
  210. }
  211. }
  212. }
  213. aCModel.IsPaymentMethod = this.chkPaymentMethod.Checked;
  214. if (this.chkPaymentMethod.Checked || aCModel.IsSetsAmount)
  215. {
  216. SetListValue(aCModel.PaymentMethodList, this.treePaymentMethod);
  217. wqcModel.WQC_QueryCondition = aCModel.ToString();
  218. }
  219. else
  220. {
  221. wqcModel.WQC_QueryCondition = "";
  222. }
  223. break;
  224. }
  225. bool ret = false;
  226. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  227. {
  228. if (wqcModel.ID > 0)
  229. {
  230. ret = wqcBll.Update(wqcModel);
  231. }
  232. else
  233. {
  234. ret = wqcBll.Add(wqcModel);
  235. }
  236. });
  237. if (ret)
  238. {
  239. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  240. }
  241. else
  242. {
  243. MessageBoxCustom.Show("保存失败,请重试!");
  244. }
  245. }
  246. catch(Exception ex) {
  247. MessageBoxCustom.Show("保存出错:"+ex.Message);
  248. }
  249. }
  250. void SetListValue(List<string> list, TreeView tView)
  251. {
  252. list.Clear();
  253. foreach (TreeNode node in tView.Nodes)
  254. {
  255. if (node.Checked)
  256. {
  257. list.Add(node.Name);
  258. }
  259. if (node.Nodes.Count > 0)
  260. {
  261. this.SetSubListValue(list,node);
  262. }
  263. }
  264. }
  265. void SetSubListValue(List<string> list, TreeNode _node)
  266. {
  267. foreach (TreeNode node in _node.Nodes)
  268. {
  269. if (node.Checked)
  270. {
  271. list.Add(node.Name);
  272. }
  273. if (node.Nodes.Count > 0)
  274. {
  275. this.SetSubListValue(list, node);
  276. }
  277. }
  278. }
  279. /// <summary>
  280. /// 设置订单类别的位置
  281. /// </summary>
  282. void SetOrdercategoryPosition()
  283. {
  284. this.chkOrdercategory.Location = this.chkPaymentMethod.Location;
  285. this.treeOrdercategory.Location = this.treePaymentMethod.Location;
  286. this.chkPaymentMethod.Hide();
  287. this.treePaymentMethod.Hide();
  288. this.chkOrdercategory.Show();
  289. this.treeOrdercategory.Show();
  290. }
  291. void cmbItemCategory_SelectedIndexChanged(object sender, EventArgs e)
  292. {
  293. if (this.cmbItemCategory.SelectedIndex == 0)
  294. {
  295. ClearAdditionalConditions();
  296. this.lbqItemMsg.Text = "请选择统计项目";
  297. }
  298. else
  299. {
  300. this.plLifuJinE.Hide();
  301. LYFZ.Model.WageStatisticsQueryItem sItem = (LYFZ.Model.WageStatisticsQueryItem)Enum.Parse(typeof(LYFZ.Model.WageStatisticsQueryItem), this.cmbItemCategory.SelectedItem.ToString());
  302. SetSelectItme(this.cmbProjectTitle, "");
  303. SetSelectItme(this.cmbCommissionScheme, "");
  304. this.lbqItemMsg.Text = GetWageStatisticsQueryItemPropertyAttribute(sItem);
  305. switch (sItem)
  306. {
  307. case Model.WageStatisticsQueryItem.订单前期:
  308. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.ReceiptsType)));
  309. SetSelectItme(this.cmbProjectTitle, LYFZ.Model.ReceiptsType.实收.ToString());
  310. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  311. {
  312. case LYFZSS.SystemSpecterType.SST_E:
  313. ShowOrHideProcessAdditionalConditions(true);
  314. ShowOrHideSelectionFilmsAmount(false);
  315. SetGrbAdditionalConditions(true);
  316. break;
  317. case LYFZSS.SystemSpecterType.SST_D:
  318. ShowOrHideProcessAdditionalConditions(false);
  319. ShowOrHideSelectionFilmsAmount(false);
  320. this.plProcessAdditionalConditions.Visible = true;
  321. SetGrbAdditionalConditions(true);
  322. this.plProcessAdditionalConditions.Visible = false;
  323. SetOrdercategoryPosition();
  324. break;
  325. case LYFZSS.SystemSpecterType.SST_C:
  326. ShowOrHideProcessAdditionalConditions(false);
  327. ShowOrHideSelectionFilmsAmount(false);
  328. SetGrbAdditionalConditions(false);
  329. break;
  330. }
  331. break;
  332. case Model.WageStatisticsQueryItem.订单后期:
  333. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.二销类别).ToUpper(), this.cmbProjectTitle.TreeView, ExclusionsList: BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.证件照).ToUpper());
  334. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  335. {
  336. case LYFZSS.SystemSpecterType.SST_E:
  337. ShowOrHideProcessAdditionalConditions(true);
  338. ShowOrHideSelectionFilmsAmount(true);
  339. SetGrbAdditionalConditions(true);
  340. break;
  341. case LYFZSS.SystemSpecterType.SST_D:
  342. ShowOrHideProcessAdditionalConditions(false);
  343. ShowOrHideSelectionFilmsAmount(false);
  344. this.plProcessAdditionalConditions.Visible = true;
  345. SetGrbAdditionalConditions(true);
  346. this.plProcessAdditionalConditions.Visible = false;
  347. SetOrdercategoryPosition();
  348. break;
  349. case LYFZSS.SystemSpecterType.SST_C:
  350. ShowOrHideProcessAdditionalConditions(false);
  351. ShowOrHideSelectionFilmsAmount(false);
  352. SetGrbAdditionalConditions(false);
  353. break;
  354. }
  355. break;
  356. case Model.WageStatisticsQueryItem.服务前期:
  357. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.EarlyServiceType)));
  358. // SetSelectItme(this.cmbProjectTitle, LYFZ.Model.EarlyServiceType.摄影前期.ToString());
  359. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  360. {
  361. case LYFZSS.SystemSpecterType.SST_E:
  362. ShowOrHideProcessAdditionalConditions(true);
  363. ShowOrHideSelectionFilmsAmount(false);
  364. SetGrbAdditionalConditions(true);
  365. break;
  366. case LYFZSS.SystemSpecterType.SST_D:
  367. ShowOrHideProcessAdditionalConditions(false);
  368. ShowOrHideSelectionFilmsAmount(false);
  369. this.plProcessAdditionalConditions.Visible = true;
  370. SetGrbAdditionalConditions(true);
  371. this.plProcessAdditionalConditions.Visible = false;
  372. SetOrdercategoryPosition();
  373. break;
  374. case LYFZSS.SystemSpecterType.SST_C:
  375. ShowOrHideProcessAdditionalConditions(false);
  376. ShowOrHideSelectionFilmsAmount(false);
  377. SetGrbAdditionalConditions(false);
  378. break;
  379. }
  380. break;
  381. case Model.WageStatisticsQueryItem.服务后期:
  382. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.LateServicesType)));
  383. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  384. {
  385. case LYFZSS.SystemSpecterType.SST_E:
  386. ShowOrHideProcessAdditionalConditions(true);
  387. ShowOrHideSelectionFilmsAmount(true);
  388. SetGrbAdditionalConditions(true);
  389. break;
  390. case LYFZSS.SystemSpecterType.SST_D:
  391. ShowOrHideProcessAdditionalConditions(false);
  392. ShowOrHideSelectionFilmsAmount(false);
  393. this.plProcessAdditionalConditions.Visible = true;
  394. SetGrbAdditionalConditions(true);
  395. this.plProcessAdditionalConditions.Visible = false;
  396. SetOrdercategoryPosition();
  397. break;
  398. case LYFZSS.SystemSpecterType.SST_C:
  399. ShowOrHideProcessAdditionalConditions(false);
  400. ShowOrHideSelectionFilmsAmount(false);
  401. SetGrbAdditionalConditions(false);
  402. break;
  403. }
  404. break;
  405. case Model.WageStatisticsQueryItem.散客消费:
  406. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.二销类别).ToUpper(), this.cmbProjectTitle.TreeView, ExclusionsList: BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.选片二销).ToUpper());
  407. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  408. {
  409. case LYFZSS.SystemSpecterType.SST_E:
  410. this.plLifuJinE.Show();
  411. ShowOrHideProcessAdditionalConditions(false);
  412. ShowOrHideSelectionFilmsAmount(false);
  413. this.plProcessAdditionalConditions.Visible = true;
  414. SetGrbAdditionalConditions(true);
  415. this.plProcessAdditionalConditions.Visible = false;
  416. break;
  417. case LYFZSS.SystemSpecterType.SST_D:
  418. case LYFZSS.SystemSpecterType.SST_C:
  419. ShowOrHideProcessAdditionalConditions(false);
  420. ShowOrHideSelectionFilmsAmount(false);
  421. SetGrbAdditionalConditions(false);
  422. break;
  423. }
  424. break;
  425. case Model.WageStatisticsQueryItem.计件提成:
  426. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.PieceCommissionType)));
  427. SetSelectItme(this.cmbProjectTitle, LYFZ.Model.PieceCommissionType.工作内容.ToString(), true);
  428. ShowOrHideSelectionFilmsAmount(false);
  429. SetGrbAdditionalConditions(false);
  430. SetSelectItme(this.cmbCommissionScheme, "",true);
  431. // LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBBBABBEBAIHGDCB", this.cmbProjectTitle, IsFirstNodeNull: true, tbl: AllSystemCategory);
  432. break;
  433. case Model.WageStatisticsQueryItem.礼服租售:
  434. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.DressRentalType)));
  435. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  436. {
  437. case LYFZSS.SystemSpecterType.SST_E:
  438. this.plLifuJinE.Show();
  439. ShowOrHideProcessAdditionalConditions(false);
  440. ShowOrHideSelectionFilmsAmount(false);
  441. this.plProcessAdditionalConditions.Visible = true;
  442. SetGrbAdditionalConditions(true);
  443. this.plProcessAdditionalConditions.Visible = false;
  444. break;
  445. case LYFZSS.SystemSpecterType.SST_D:
  446. case LYFZSS.SystemSpecterType.SST_C:
  447. ShowOrHideProcessAdditionalConditions(false);
  448. ShowOrHideSelectionFilmsAmount(false);
  449. SetGrbAdditionalConditions(false);
  450. break;
  451. }
  452. break;
  453. case Model.WageStatisticsQueryItem.会员充值:
  454. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.RechargeType)));
  455. SetSelectItme(this.cmbProjectTitle, LYFZ.Model.RechargeType.充值金额.ToString(),true);
  456. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  457. {
  458. case LYFZSS.SystemSpecterType.SST_E:
  459. ShowOrHideProcessAdditionalConditions(false);
  460. ShowOrHideSelectionFilmsAmount(false);
  461. this.plProcessAdditionalConditions.Visible = true;
  462. SetGrbAdditionalConditions(true);
  463. this.plProcessAdditionalConditions.Visible = false;
  464. break;
  465. case LYFZSS.SystemSpecterType.SST_D:
  466. case LYFZSS.SystemSpecterType.SST_C:
  467. ShowOrHideProcessAdditionalConditions(false);
  468. ShowOrHideSelectionFilmsAmount(false);
  469. SetGrbAdditionalConditions(false);
  470. break;
  471. }
  472. break;
  473. case Model.WageStatisticsQueryItem.服务卡充值:
  474. BindComboxTreeView(this.cmbProjectTitle.TreeView, Enum.GetNames(typeof(LYFZ.Model.RechargeType)));
  475. SetSelectItme(this.cmbProjectTitle, LYFZ.Model.RechargeType.充值金额.ToString(), true);
  476. switch (LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter)
  477. {
  478. case LYFZSS.SystemSpecterType.SST_E:
  479. ShowOrHideProcessAdditionalConditions(false);
  480. ShowOrHideSelectionFilmsAmount(false);
  481. this.plProcessAdditionalConditions.Visible = true;
  482. SetGrbAdditionalConditions(true);
  483. this.plProcessAdditionalConditions.Visible = false;
  484. break;
  485. case LYFZSS.SystemSpecterType.SST_D:
  486. case LYFZSS.SystemSpecterType.SST_C:
  487. ShowOrHideProcessAdditionalConditions(false);
  488. ShowOrHideSelectionFilmsAmount(false);
  489. SetGrbAdditionalConditions(false);
  490. break;
  491. }
  492. break;
  493. }
  494. }
  495. }
  496. /// <summary>
  497. /// 获取统计项目的说明属性信息
  498. /// </summary>
  499. /// <param name="sEvent"></param>
  500. /// <returns></returns>
  501. string GetWageStatisticsQueryItemPropertyAttribute(Model.WageStatisticsQueryItem qItem)
  502. {
  503. string ret = LYFZ.WinAPI.CustomPublicMethod.ConvertEnumToDescription(qItem);
  504. if (string.IsNullOrEmpty(ret))
  505. {
  506. ret = qItem.ToString();
  507. }
  508. return ret;
  509. }
  510. void SetGrbAdditionalConditions(bool isDisabled)
  511. {
  512. // bool isShow = this.plProcessAdditionalConditions.Visible;
  513. // this.plProcessAdditionalConditions.Visible = true;
  514. this.grbAdditionalConditions.Enabled = isDisabled;
  515. if (!isDisabled)
  516. {
  517. ClearAdditionalConditions();
  518. this.Height = 720 - 470;
  519. this.grbAdditionalConditions.Hide();
  520. }
  521. else {
  522. this.Height = 720;
  523. this.grbAdditionalConditions.Show();
  524. }
  525. // this.plProcessAdditionalConditions.Visible = isShow;
  526. }
  527. /// <summary>
  528. /// 显示隐藏流程附加条件
  529. /// </summary>
  530. /// <param name="bl"></param>
  531. void ShowOrHideProcessAdditionalConditions(bool bl)
  532. {
  533. this.plProcessAdditionalConditions.Visible = bl;
  534. this.chkcustomersource.Visible = bl;
  535. this.treecustomersource.Visible = bl;
  536. this.chkOrdercategory.Visible = bl;
  537. this.treeOrdercategory.Visible = bl;
  538. }
  539. /// <summary>
  540. /// 显示隐藏选片金额
  541. /// </summary>
  542. /// <param name="bl"></param>
  543. void ShowOrHideSelectionFilmsAmount(bool bl)
  544. {
  545. this.chkSelectionFilmsAmount.Visible = bl;
  546. this.nudSelectionFilmsAmountStar.Visible = bl;
  547. this.nudSelectionFilmsAmountEnd.Visible = bl;
  548. this.lbSelectionFilmsAmount.Visible = bl;
  549. }
  550. /// <summary>
  551. /// 设置选择项
  552. /// </summary>
  553. /// <param name="cmbProject"></param>
  554. /// <param name="selectValue">要选中的值</param>
  555. /// <param name="isDisabled">是否禁用</param>
  556. public static void SetSelectItme(ComponentLibrary.ComboBoxTreeViewEx cmbProject,string selectValue,bool isDisabled=false)
  557. {
  558. if (string.IsNullOrEmpty(selectValue))
  559. {
  560. cmbProject.TreeView.SelectedNode = null;
  561. cmbProject.Text = "";
  562. }
  563. else
  564. {
  565. foreach (TreeNode node in cmbProject.TreeView.Nodes)
  566. {
  567. if (node.Name.ToLower() == selectValue.ToLower())
  568. {
  569. cmbProject.TreeView.SelectedNode = node;
  570. cmbProject.Text = node.Text;
  571. break;
  572. }
  573. else if (node.Nodes.Count > 0)
  574. {
  575. SelectSubItem(cmbProject, node, selectValue);
  576. }
  577. }
  578. }
  579. if (isDisabled)
  580. {
  581. cmbProject.Enabled = false;
  582. }
  583. else {
  584. cmbProject.Enabled = true;
  585. }
  586. }
  587. public static void SelectSubItem(ComponentLibrary.ComboBoxTreeViewEx cmbProject, TreeNode node, string selectValue)
  588. {
  589. foreach (TreeNode subNode in node.Nodes)
  590. {
  591. if (subNode.Name.ToLower() == selectValue.ToLower())
  592. {
  593. cmbProject.TreeView.SelectedNode = subNode;
  594. cmbProject.SelectedText = subNode.Text;
  595. break;
  596. }
  597. else if (subNode.Nodes.Count > 0)
  598. {
  599. SelectSubItem(cmbProject, subNode, selectValue);
  600. }
  601. }
  602. }
  603. void BindComboxTreeView(TreeView tvw, string[] bindDatas, bool isExpandAll=true)
  604. {
  605. tvw.Nodes.Clear();
  606. foreach (string data in bindDatas)
  607. {
  608. TreeNode node = new TreeNode();
  609. node.Name = data;
  610. node.Text = data;
  611. node.Tag = data;
  612. tvw.Nodes.Add(node);
  613. }
  614. if (isExpandAll)
  615. {
  616. tvw.ExpandAll();
  617. }
  618. }
  619. /// <summary>
  620. /// 清除附加条件
  621. /// </summary>
  622. void ClearAdditionalConditions()
  623. {
  624. this.chkProcessStatus.Checked = false;
  625. this.chkcustomersource.Checked = false;
  626. this.chkorderamount.Checked = false;
  627. this.chkOrdercategory.Checked = false;
  628. this.chkSatisfactionScore.Checked = false;
  629. this.chkSelectionFilmsAmount.Checked = false;
  630. this.cmbProcessStatus.SelectedItem = null;
  631. this.nudorderamountStar.Value = 0;
  632. this.nudorderamountEnd.Value = 0;
  633. this.nudSatisfactionScoreEnd.Value = 0;
  634. this.nudSatisfactionScoreStar.Value = 0;
  635. this.nudSelectionFilmsAmountStar.Value = 0;
  636. this.nudSelectionFilmsAmountEnd.Value = 0;
  637. foreach (TreeNode node in this.treecustomersource.Nodes)
  638. {
  639. node.Checked = false;
  640. }
  641. foreach (TreeNode node in this.treeOrdercategory.Nodes)
  642. {
  643. node.Checked = false;
  644. }
  645. foreach (TreeNode node in this.treePaymentMethod.Nodes)
  646. {
  647. node.Checked = false;
  648. }
  649. }
  650. void treecustomersource_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  651. {
  652. foreach (TreeNode node in e.Node.Nodes)
  653. {
  654. node.Checked = e.Node.Checked;
  655. treecustomersource_NodeMouseClick(nudorderamountEnd,new TreeNodeMouseClickEventArgs(node,e.Button,e.Clicks,e.X,e.Y));
  656. }
  657. }
  658. void treecustomersource_AfterCheck(object sender, TreeViewEventArgs e)
  659. {
  660. if (!e.Node.Checked)
  661. {
  662. if (e.Node.Parent != null)
  663. {
  664. if (e.Node.Parent.Checked)
  665. {
  666. e.Node.Parent.Checked = false;
  667. }
  668. }
  669. }
  670. else {
  671. if (e.Node.Parent != null)
  672. {
  673. if (!e.Node.Parent.Checked)
  674. {
  675. bool ischecked = true;
  676. foreach (TreeNode node in e.Node.Parent.Nodes)
  677. {
  678. if (!node.Checked) {
  679. ischecked = false;
  680. }
  681. }
  682. e.Node.Parent.Checked = ischecked;
  683. }
  684. }
  685. }
  686. }
  687. public static LYFZ.BLL.BLL_ErpSystemCategory SCBll = new BLL.BLL_ErpSystemCategory();
  688. // private static DataTable _AllSystemCategory = null;
  689. /// <summary>
  690. /// 所有系统类别
  691. /// </summary>
  692. public static DataTable AllSystemCategory
  693. {
  694. get {
  695. return LYFZ.BLL.WageStatisticsProcess.AllSystemCategory;
  696. }
  697. }
  698. /// <summary>
  699. /// 重新加载所有系统类别
  700. /// </summary>
  701. public static void LoadAllSystemCategory()
  702. {
  703. LYFZ.BLL.WageStatisticsProcess.LoadAllSystemCategory();
  704. }
  705. void frmEditStatisticsProgram_Shown(object sender, EventArgs e)
  706. {
  707. this.Height = 660 - 410;
  708. //绑定统计项目
  709. BindItemCategory();
  710. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.提成点方案).ToUpper(), this.cmbCommissionScheme.TreeView);
  711. //客户来源
  712. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.客户来源).ToUpper(), this.treecustomersource);
  713. //套系类别
  714. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.订单类别).ToUpper(), this.treeOrdercategory);
  715. //支付方式
  716. BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.支付方式).ToUpper(), this.treePaymentMethod,ExclusionsList:BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.代金券).Trim().ToUpper());
  717. if (wqcModel != null && wqcModel.ID > 0)
  718. {
  719. this.txtProgramName.Enabled = false;
  720. aCModel = new Model.AdditionalConditions(wqcModel.WQC_QueryCondition);
  721. SetEditStatisticsProgram(aCModel);
  722. }
  723. else {
  724. this.txtProgramName.Enabled = true;
  725. }
  726. }
  727. void SetEditStatisticsProgram(Model.AdditionalConditions acModel)
  728. {
  729. this.txtProgramName.Text = WqcModel.WQC_QueryName;
  730. LYFZ.Model.WageStatisticsQueryItem StatisticalItems = (LYFZ.Model.WageStatisticsQueryItem)WqcModel.WQC_StatisticalItems;
  731. this.cmbItemCategory.SelectedItem = StatisticalItems.ToString();
  732. switch (StatisticalItems)
  733. {
  734. case Model.WageStatisticsQueryItem.订单前期:
  735. case Model.WageStatisticsQueryItem.订单后期:
  736. case Model.WageStatisticsQueryItem.服务前期:
  737. case Model.WageStatisticsQueryItem.服务后期:
  738. case Model.WageStatisticsQueryItem.散客消费:
  739. case Model.WageStatisticsQueryItem.礼服租售:
  740. SetSelectItme(this.cmbProjectTitle, WqcModel.WQC_ProjectContent, false);
  741. break;
  742. case Model.WageStatisticsQueryItem.计件提成:
  743. case Model.WageStatisticsQueryItem.会员充值:
  744. case Model.WageStatisticsQueryItem.服务卡充值:
  745. SetSelectItme(this.cmbProjectTitle, WqcModel.WQC_ProjectContent, true);
  746. break;
  747. }
  748. if (StatisticalItems == Model.WageStatisticsQueryItem.计件提成)
  749. {
  750. SetSelectItme(this.cmbCommissionScheme, "", true);
  751. }
  752. else {
  753. SetSelectItme(this.cmbCommissionScheme, WqcModel.WQC_CommissionProgram);
  754. }
  755. if (StatisticalItems == Model.WageStatisticsQueryItem.订单后期)
  756. {
  757. if (WqcModel.WQC_ProjectContent.ToUpper() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.选片二销).ToUpper())
  758. {
  759. SetGrbAdditionalConditions(true);
  760. }
  761. else
  762. {
  763. SetGrbAdditionalConditions(false);
  764. }
  765. }
  766. if (acModel.IsProcessStatus)
  767. {
  768. this.chkProcessStatus.Checked = acModel.IsProcessStatus;
  769. this.cmbProcessStatus.SelectedItem = acModel.ProcessStatusValue;
  770. }
  771. if (acModel.IsSetsAmount)
  772. {
  773. if (StatisticalItems == Model.WageStatisticsQueryItem.礼服租售
  774. ||StatisticalItems== Model.WageStatisticsQueryItem.散客消费)
  775. {
  776. this.chkLifuJinE.Checked = acModel.IsSetsAmount;
  777. this.nuLiFuStar.Value = acModel.SetsAmountStar;
  778. this.nuLiFuEnd.Value = acModel.SetsAmountEnd;
  779. }
  780. else
  781. {
  782. this.chkorderamount.Checked = acModel.IsSetsAmount;
  783. this.nudorderamountStar.Value = acModel.SetsAmountStar;
  784. this.nudorderamountEnd.Value = acModel.SetsAmountEnd;
  785. }
  786. }
  787. if (acModel.IsSelectionFilmsAmount)
  788. {
  789. this.chkSelectionFilmsAmount.Checked = acModel.IsSelectionFilmsAmount;
  790. this.nudSelectionFilmsAmountStar.Value = acModel.SelectionFilmsAmountStar;
  791. this.nudSelectionFilmsAmountEnd.Value = acModel.SelectionFilmsAmountEnd;
  792. }
  793. if (acModel.IsSatisfactionScore)
  794. {
  795. this.chkSatisfactionScore.Checked = acModel.IsSatisfactionScore;
  796. this.nudSatisfactionScoreStar.Value = acModel.SatisfactionScoreStar;
  797. this.nudSatisfactionScoreEnd.Value = acModel.SatisfactionScoreEnd;
  798. }
  799. if (acModel.IsCustomerSource)
  800. {
  801. this.chkcustomersource.Checked = acModel.IsCustomerSource;
  802. CheckedTreeView(this.treecustomersource, acModel.CustomerSourceList);
  803. }
  804. if (acModel.IsOrderCategory)
  805. {
  806. this.chkOrdercategory.Checked = acModel.IsOrderCategory;
  807. CheckedTreeView(this.treeOrdercategory, acModel.OrderCategoryList);
  808. }
  809. if (acModel.IsPaymentMethod)
  810. {
  811. this.chkPaymentMethod.Checked = acModel.IsPaymentMethod;
  812. CheckedTreeView(this.treePaymentMethod, acModel.PaymentMethodList);
  813. }
  814. }
  815. void CheckedTreeView(TreeView tview, List<string> vlueList)
  816. {
  817. foreach (TreeNode node in tview.Nodes)
  818. {
  819. if (vlueList.Contains(node.Name))
  820. {
  821. node.Checked = true;
  822. }
  823. if (node.Nodes.Count > 0)
  824. {
  825. this.CheckedSubValue(vlueList, node);
  826. }
  827. }
  828. }
  829. void CheckedSubValue(List<string> vlueList, TreeNode _node)
  830. {
  831. foreach (TreeNode node in _node.Nodes)
  832. {
  833. if (vlueList.Contains(node.Name))
  834. {
  835. node.Checked = true;
  836. }
  837. if (node.Nodes.Count > 0)
  838. {
  839. this.CheckedSubValue(vlueList, node);
  840. }
  841. }
  842. }
  843. /// <summary>
  844. /// 绑定类别
  845. /// </summary>
  846. /// <param name="ExclusionsList">要排除的内容</param>
  847. public static void BindTreeView_SystemCategory(string classCode, TreeView tvw, bool isExpandAll = true, string ExclusionsList = "", bool IsFirstNodeNull = false, BLL.SysTemCategoryCodeType codeType = BLL.SysTemCategoryCodeType.未知类别)
  848. {
  849. tvw.Nodes.Clear();
  850. DataRow[] pRow = AllSystemCategory.Select("Sc_ClassCode = '" + classCode + "' ");
  851. if (pRow.Length > 0)
  852. {
  853. tvw.Tag = pRow[0];
  854. BindTreeView_SubNode(Convert.ToInt32(pRow[0]["id"].ToString()), tvw.Nodes, ExclusionsList, IsFirstNodeNull, codeType);
  855. if (isExpandAll)
  856. {
  857. tvw.ExpandAll();
  858. }
  859. }
  860. }
  861. /// <summary>
  862. /// 移除无效套系 (即没有设置任何套系名称的套系)
  863. /// </summary>
  864. /// <param name="tvw"></param>
  865. public static void RemoveInvalidTaoXi(TreeView tvw)
  866. {
  867. List<TreeNode> removeList = new List<TreeNode>();
  868. foreach (TreeNode node in tvw.Nodes)
  869. {
  870. if (node != null)
  871. {
  872. if (node.Name.ToLower() != "IsFirstNodeNull".ToLower())
  873. {
  874. if (node.Nodes.Count > 0)
  875. {
  876. RemoveInvalidTaoXi(node);
  877. if (node.Nodes.Count <= 0)
  878. {
  879. removeList.Add(node);
  880. }
  881. }
  882. else
  883. {
  884. removeList.Add(node);
  885. }
  886. }
  887. }
  888. }
  889. foreach (TreeNode node in removeList)
  890. {
  891. tvw.Nodes.Remove(node);
  892. }
  893. }
  894. static void RemoveInvalidTaoXi(TreeNode node)
  895. {
  896. List<TreeNode> removeList = new List<TreeNode>();
  897. foreach (TreeNode subnode in node.Nodes)
  898. {
  899. if (subnode.Nodes.Count > 0)
  900. {
  901. RemoveInvalidTaoXi(subnode);
  902. if (subnode.Nodes.Count <= 0)
  903. {
  904. removeList.Add(subnode);
  905. }
  906. }
  907. else
  908. {
  909. if (!subnode.Name.ToLower().Contains("AddErpPackages_PakData_".ToLower()))
  910. {
  911. removeList.Add(subnode);
  912. }
  913. }
  914. }
  915. foreach (TreeNode subNode in removeList)
  916. {
  917. node.Nodes.Remove(subNode);
  918. }
  919. }
  920. /// <summary>
  921. /// 绑定套系名和礼包
  922. /// </summary>
  923. /// <param name="classCode"></param>
  924. /// <param name="nodes"></param>
  925. static void BindTreeView_SubNodeToTaoXiMingORLiBao(string classCode, TreeNodeCollection nodes)
  926. {
  927. DataRow[] pRows = LYFZ.BLL.BLL_ErpPackages.AllPackagesName.Select(String.Format("Pak_PackagesClass='{0}' and Pak_IsDisable =0 ", classCode));
  928. foreach (DataRow row in pRows)
  929. {
  930. TreeNode node = new TreeNode();
  931. node.Name = String.Format("AddErpPackages_PakData_{0}", row["Pak_PackagesID"].ToString());
  932. node.Text = row["Pak_Name"].ToString();
  933. node.Tag = new {
  934. PackagesClass= row["Pak_PackagesClass"].ToString(),
  935. PackagesID = row["Pak_PackagesID"].ToString(),
  936. Pak_Name = row["Pak_Name"].ToString(),
  937. };
  938. nodes.Add(node);
  939. }
  940. }
  941. /// <summary>
  942. /// 绑定类别
  943. /// </summary>
  944. /// <param name="classCodeList">多个类别编码用“|”分开</param>
  945. /// <param name="tvw"></param>
  946. /// <param name="isExpandAll"></param>
  947. /// <param name="ExclusionsList">要排除的内容</param>
  948. public static void BindTreeView_SystemCategory(string[] classCodeList, TreeView tvw, bool isExpandAll = true, string ExclusionsList = "")
  949. {
  950. tvw.Nodes.Clear();
  951. string[] codeList = classCodeList;
  952. foreach (string key in codeList)
  953. {
  954. DataRow[] pRow = AllSystemCategory.Select("Sc_ClassCode = '" + key + "'");
  955. tvw.Tag = pRow[0];
  956. TreeNode node = new TreeNode();
  957. node.Name = pRow[0]["Sc_ClassCode"].ToString();
  958. node.Text = pRow[0]["Sc_ClassName"].ToString();
  959. node.Tag = pRow[0]["id"].ToString();
  960. tvw.Nodes.Add(node);
  961. BindTreeView_SubNode(Convert.ToInt32(pRow[0]["id"].ToString()), node.Nodes, ExclusionsList);
  962. }
  963. if (isExpandAll)
  964. {
  965. tvw.ExpandAll();
  966. }
  967. }
  968. public static void BindTreeView_SubNode(int pid, TreeNodeCollection nodes, string ExclusionsList = "",bool IsFirstNodeNull=false, BLL.SysTemCategoryCodeType codeType = BLL.SysTemCategoryCodeType.未知类别)
  969. {
  970. DataRow[] pRows = AllSystemCategory.Select("Sc_ClassParentID =" + pid.ToString() + " and Sc_IsDisable = 0 ");
  971. if (IsFirstNodeNull)
  972. {
  973. TreeNode node = new TreeNode();
  974. node.Name = "IsFirstNodeNull";
  975. node.Text = " ";
  976. node.Tag = "-1";
  977. nodes.Add(node);
  978. }
  979. if (pRows.Length > 0)
  980. {
  981. foreach (DataRow row in pRows)
  982. {
  983. if (!ExclusionsList.ToLower().Contains(row["Sc_ClassCode"].ToString().ToLower())
  984. || (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IncludeVouchers && row["Sc_ClassCode"].ToString().ToLower() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(BLL.SysTemCategoryCodeType.代金券).Trim().ToLower()))
  985. {
  986. TreeNode node = new TreeNode();
  987. node.Name = row["Sc_ClassCode"].ToString();
  988. node.Text = row["Sc_ClassName"].ToString();
  989. node.Tag = row["id"].ToString();
  990. nodes.Add(node);
  991. BindTreeView_SubNode(Convert.ToInt32(node.Tag), node.Nodes, ExclusionsList, false, codeType: codeType);
  992. }
  993. }
  994. }
  995. else {
  996. DataRow[] codeRows = AllSystemCategory.Select("id =" + pid.ToString() + "");
  997. if (codeRows.Length > 0)
  998. {
  999. string classCode = codeRows[0]["Sc_ClassCode"].ToString();
  1000. switch (codeType)
  1001. {
  1002. case BLL.SysTemCategoryCodeType.套系名称:
  1003. case BLL.SysTemCategoryCodeType.订单礼包:
  1004. BindTreeView_SubNodeToTaoXiMingORLiBao(classCode, nodes);
  1005. break;
  1006. }
  1007. }
  1008. }
  1009. }
  1010. /// <summary>
  1011. /// 绑定统计项目
  1012. /// </summary>
  1013. void BindItemCategory()
  1014. {
  1015. this.cmbItemCategory.Items.Clear();
  1016. this.cmbItemCategory.Items.Add("---请选择项目---");
  1017. string[] WageStatisticsQueryItems= Enum.GetNames(typeof(LYFZ.Model.WageStatisticsQueryItem));
  1018. foreach (string qItem in WageStatisticsQueryItems)
  1019. {
  1020. this.cmbItemCategory.Items.Add(qItem);
  1021. }
  1022. this.cmbItemCategory.SelectedIndex = 0;
  1023. }
  1024. void btnClose_Click(object sender, EventArgs e)
  1025. {
  1026. this.Close();
  1027. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  1028. }
  1029. }
  1030. }