OnSingleFormMain01.cs 149 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986
  1. using LYFZ.ComponentLibrary;
  2. using LYFZ.Model.API;
  3. using LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  14. {
  15. public partial class OnSingleFormMain01 : LYFZ.Software.UI.DoorCityProcess.OnSingleFormMain
  16. {
  17. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  18. LYFZ.BLL.BLL_ErpStyle stbll = new BLL.BLL_ErpStyle();
  19. LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
  20. LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL.BLL_ErpCustomer();
  21. LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
  22. LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
  23. LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
  24. LYFZ.BLL.BLL_ErpOrdersPerson orpbll = new BLL.BLL_ErpOrdersPerson();
  25. LYFZ.BLL.BLL_SMSTemplates smsTemplates = new BLL.BLL_SMSTemplates();
  26. LYFZ.BLL.BLL_ErpCustomerGroup cgbll = new BLL.BLL_ErpCustomerGroup();
  27. LYFZ.BLL.BLL_ErpHospitalClient hcbll = new BLL.BLL_ErpHospitalClient();
  28. LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
  29. LYFZ.BLL.BLL_ErpOrderProductLOG ptlog = new BLL.BLL_ErpOrderProductLOG();
  30. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  31. LYFZ.BLL.BLL_ErpOrderProductList libll = new BLL.BLL_ErpOrderProductList();
  32. LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
  33. LYFZ.BLL.BLL_ErpMemberCardPoints mcptsbll = new BLL.BLL_ErpMemberCardPoints();
  34. LYFZ.BLL.BLL_ErpOrderNumberRecord ornrbll = new BLL.BLL_ErpOrderNumberRecord();
  35. LYFZ.BLL.BLL_ErpMemberCardViceCard mcvbll = new BLL.BLL_ErpMemberCardViceCard();
  36. LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
  37. LYFZ.BLL.BLL_ErpMemberCardBackCash mcbcbll = new BLL.BLL_ErpMemberCardBackCash();
  38. LYFZ.BLL.BLL_ErpCustomerGroupMembers cgmbll = new BLL.BLL_ErpCustomerGroupMembers();
  39. LYFZ.BLL.BLL_ErpMemberCardOperateLOG mcopbll = new BLL.BLL_ErpMemberCardOperateLOG();
  40. LYFZ.BLL.BLL_ErpMemberCardPointsLOG mcpslogbll = new BLL.BLL_ErpMemberCardPointsLOG();
  41. LYFZ.BLL.BLL_ErpPackagesGiftMerchandise pgbll = new BLL.BLL_ErpPackagesGiftMerchandise();
  42. LYFZ.BLL.BLL_ErpMemberCardBackCashSet mcbcsetbll = new BLL.BLL_ErpMemberCardBackCashSet();
  43. LYFZ.BLL.BLL_ErpMemberCardInterfaceManagement mcimbll = new BLL.BLL_ErpMemberCardInterfaceManagement();
  44. #region 属性
  45. public bool _bSelectFilm = false;
  46. /// <summary>
  47. /// 是否是修改订单(从订单报表、保存后这里都会为true)
  48. /// </summary>
  49. public bool IsUpdateOrderLoad = false;
  50. /// <summary>
  51. /// 关闭窗体前判断是否提示
  52. /// </summary>
  53. private bool isClose = true;
  54. /// <summary>
  55. /// 订单编号
  56. /// </summary>
  57. public string StrNumber = "";
  58. public int modelId = 0;
  59. /// <summary>
  60. /// 是否保存
  61. /// </summary>
  62. public bool IsSaveed = false;
  63. /// <summary>
  64. /// 订单类型
  65. /// </summary>
  66. public LYFZ.EnumPublic.OrderType OrdType;
  67. /// <summary>
  68. /// 用于写入成人客户控件的序号
  69. /// </summary>
  70. private int ClientAdultNameCount = 1;
  71. /// <summary>
  72. /// 用于写入儿童客户控件的序号
  73. /// </summary>
  74. private int ClientChildNameCount = 1;
  75. /// <summary>
  76. /// 是否显示写真版
  77. /// </summary>
  78. private bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
  79. /// <summary>
  80. /// 登录都姓名
  81. /// </summary>
  82. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  83. /// <summary>
  84. /// 登录者员工ID
  85. /// </summary>
  86. string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  87. /// <summary>
  88. /// 本地分店ID
  89. /// </summary>
  90. string strInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  91. /// <summary>
  92. /// 当前客户数量
  93. /// </summary>
  94. int AddClinetCount = 0;
  95. /// <summary>
  96. /// 订单客户组编号
  97. /// </summary>
  98. string OrderGroupNumber = "";
  99. /// <summary>
  100. /// 来单批号
  101. /// </summary>
  102. string ComeSingleLotNumber = "";
  103. /// <summary>
  104. /// 覆盖订单数据时候,是否覆盖客户数据
  105. /// </summary>
  106. bool UpdateOrderIsUpdateClientData = true;
  107. /// <summary>
  108. /// 如果没有保存权限,是否已授过权
  109. /// </summary>
  110. bool IsSaveedHadAuthorized = false;
  111. /// <summary>
  112. /// 当前登录者、授权者的保利系数
  113. /// </summary>
  114. decimal dec_OrderDiscounts = 0;
  115. /// <summary>
  116. /// 客户来源《朋友介绍——副卡资料》
  117. /// </summary>
  118. LYFZ.Model.Model_ErpMemberCardViceCard modelViceCard = null;
  119. /// <summary>
  120. /// 客户来源《朋友介绍——朋友资料》
  121. /// </summary>
  122. LYFZ.Model.Model_ErpCustomer modelFriends = null;
  123. /// <summary>
  124. /// 老客户信息
  125. /// </summary>
  126. LYFZ.Model.Model_ErpCustomer modelOldClient = null;
  127. /// <summary>
  128. /// 介绍人要办理的会员卡号
  129. /// </summary>
  130. public string StrReferralsMemberCardNumber = "";
  131. /// <summary>
  132. /// 介绍人要修改的电话号码
  133. /// </summary>
  134. public string StrReferralsClientPhone = "";
  135. bool _isIntentionOrder = false;
  136. string _UploadPath = "";
  137. /// <summary>
  138. /// 当前打开的是否为意向订单
  139. /// </summary>
  140. bool IsIntentionOrder
  141. {
  142. get { return _isIntentionOrder; }
  143. set { _isIntentionOrder = value; }
  144. }
  145. public LoadFormType EnumLoadFormType;
  146. public enum LoadFormType
  147. {
  148. 订单报表,
  149. 开单选择
  150. }
  151. /// <summary>
  152. /// 旧套系名称
  153. /// </summary>
  154. string strOldTaoXiName { get; set; }
  155. /// <summary>
  156. /// 旧套系名称
  157. /// </summary>
  158. string strOldTaoXiCode { get; set; }
  159. /// <summary>
  160. /// 旧套系金额
  161. /// </summary>
  162. decimal strOldTaoXiPrice { get; set; }
  163. string strPersonData { get; set; }
  164. #endregion
  165. #region 窗体事件
  166. public OnSingleFormMain01()
  167. {
  168. this.Shown += OnSingleFormMain_Shown;
  169. this.Load += OnSingleFormMain_Load;
  170. this.btnSaveIntent.Click += btnSaveIntent_Click;
  171. this.btnSave.Click += btnSave_Click;
  172. this.btnPrint.Click += btnPrint_Click;
  173. this.btnNewOrder.Click += btnNewOrder_Click;
  174. this.btnOrderClose.Click += btnOrderClose_Click;
  175. this.FormClosing += OnSingleFormMain_FormClosing;
  176. this.FormClosed += OnSingleFormMain_FormClosed;
  177. this.Resize += OnSingleFormMain_Resize;
  178. #region 第一页
  179. this.btnSourceSet.Click += btnSourceSet_Click;
  180. this.btnStyleSet.Click += btnStyleSet_Click;
  181. this.pictAddClient.Click += pictAddClient_Click;
  182. this.btnSelectUser.Click += btnSelectUser_Click;
  183. this.panelEx3.Click += panelEx3_Click;
  184. this.panelEx2.Click += panelEx2_Click;
  185. this.panelVice1.Click += panelVice1_Click;
  186. this.PanelMain1.Click += PanelMain1_Click;
  187. this.chkOldClient.Click += chkOldClient_Click;
  188. this.chkFriends.Click += chkFriends_Click;
  189. this.chkHospitalClient.Click += chkHospitalClient_Click;
  190. this.chkOther.Click += chkOther_Click;
  191. this.lblYiXiangClient.Click += lblYiXiangClient_Click;
  192. this.lblBrowseSelect.Click += lblBrowseSelect_Click;
  193. #endregion
  194. #region 第二页
  195. this.tabControl.SelectedIndexChanged += tabControl_SelectedIndexChanged;
  196. this.PanelMain2.Click += PanelMain2_Click;
  197. this.PanelMain3.Click += PanelMain3_Click;
  198. #endregion
  199. #region 上传预约单
  200. this.btnUpload.Click += btnUpload_Click;
  201. this.btnShow.Click += btnShow_Click;
  202. #endregion
  203. //TestData();
  204. }
  205. void SetButtonPostionData()
  206. {
  207. btnUpload.Location = new Point(this.Width - 170, btnUpload.Location.Y);
  208. btnShow.Location = new Point(this.Width - 85, btnShow.Location.Y);
  209. }
  210. #region 上传预约单
  211. void btnShow_Click(object sender, EventArgs e)
  212. {
  213. if (!string.IsNullOrEmpty(this._UploadPath))
  214. {
  215. string resData = "";
  216. string downFilePath = Application.StartupPath + "\\Temp\\UploadFile\\" + System.IO.Path.GetFileName(this._UploadPath);
  217. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  218. {
  219. LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
  220. resData = tcpFile.DownloadFile(downFilePath, this._UploadPath, backgroundWorker);
  221. });
  222. //LYFZ.Software.MainBusiness.SystemSettings.frmShowPictureBox showPictureBox = new SystemSettings.frmShowPictureBox()
  223. //{
  224. // filePath = filePath
  225. //};
  226. //showPictureBox.ShowDialog();
  227. System.Diagnostics.Process.Start(downFilePath);
  228. }
  229. else
  230. {
  231. MessageBoxCustom.Show("未上传预约单!");
  232. }
  233. }
  234. void btnUpload_Click(object sender, EventArgs e)
  235. {
  236. OpenFileDialog openDlg = new OpenFileDialog();
  237. openDlg.Multiselect = false;
  238. if (openDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  239. {
  240. DateTime startime = DateTime.Now;
  241. string filePath = openDlg.FileName.Trim();
  242. if (filePath.Length > 0)
  243. {
  244. bool b = false;
  245. string retmsg = "";
  246. string servicePath= "UploadFiles\\ReservationForm\\" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + System.IO.Path.GetExtension(filePath);
  247. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  248. {
  249. try
  250. {
  251. LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
  252. retmsg = tcpFile.UploadFileToServer(filePath, servicePath, backgroundWorker);
  253. //tcpFile.
  254. b = true;
  255. }
  256. catch (Exception ex)
  257. {
  258. retmsg = ex.Message;
  259. b = false;
  260. }
  261. });
  262. //this.textBoxEx2.Text = retmsg;
  263. //this.labelEx3.Text = "上传完成 用时:" + ExecDateDiff(startime, DateTime.Now) + " 毫秒数 " + (ExecDateDiff(startime, DateTime.Now) / 1000) + " 秒";
  264. if(b)
  265. {
  266. _UploadPath = servicePath;
  267. MessageBoxCustom.Show(
  268. retmsg + "\r\n" +
  269. "上传完成"
  270. );
  271. /// 用时:" + LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff(startime, DateTime.Now) + " 毫秒数 " + (LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff(startime, DateTime.Now) / 1000) + " 秒
  272. }
  273. else
  274. {
  275. MessageBoxCustom.Show(
  276. "上传失败\r\n" + retmsg
  277. );
  278. }
  279. }
  280. }
  281. }
  282. #endregion
  283. /// <summary>
  284. /// 窗体加载事件
  285. /// </summary>
  286. /// <param name="sender"></param>
  287. /// <param name="e"></param>
  288. void OnSingleFormMain_Shown(object sender, EventArgs e)
  289. {
  290. this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
  291. this.flowPanel0.Location = new Point(this.flowPanel0.Location.X, tabControl.Location.Y - 2);// this.flowPanel0.Location.Y);
  292. this.FillClientDataPanelHeight();
  293. this.PanelMain1_Click(this, null);
  294. ///保存意向订单的版本权限
  295. List<Control> hideControl = new List<Control>();
  296. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  297. hideControl.Add(this.btnSaveIntent);
  298. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  299. VersionControl.VersionFunctionEnum.开单保存意向订单, hideControl, null, null);
  300. ///自动开会员版本权
  301. hideControl = new List<Control>();
  302. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  303. hideControl.Add(this.panelTransactmemberCard);
  304. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  305. VersionControl.VersionFunctionEnum.开单自动开会员, hideControl, null, null);
  306. SetButtonPostionData();
  307. }
  308. /// <summary>
  309. /// 窗体加载事件
  310. /// </summary>
  311. /// <param name="sender"></param>
  312. /// <param name="e"></param>
  313. void OnSingleFormMain_Load(object sender, EventArgs e)
  314. {
  315. if (!string.IsNullOrEmpty(this.StrNumber))
  316. {
  317. DataTable odbDt = odbll.GetOrderDigitalByNumberHandSelect(this.StrNumber);
  318. if (odbDt.Rows.Count > 0)
  319. {
  320. _bSelectFilm = true;
  321. }
  322. }
  323. this.StyleSetAdd();
  324. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT");
  325. this.chBox_Click();
  326. #region 权限与加载
  327. if (this.StrNumber == "")
  328. {
  329. this.tap3.Parent = null;
  330. //this.btnSave.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
  331. this.GetTransactmemberCard();
  332. }
  333. else
  334. {
  335. this.btnSaveIntent.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
  336. this.OpenSingleLoad();
  337. }
  338. this.btnPrint.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.Print);
  339. this.btnStyleSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderLoveStyleSet);
  340. this.btnSourceSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClientSourceSet);
  341. #endregion
  342. }
  343. void RebindUpgrade(bool b)
  344. {
  345. if (this.OrderEx != null)
  346. {
  347. this.OrderEx.bUpgrade = b;
  348. }
  349. //throw new NotImplementedException();
  350. if (this.OrderProductEx != null)
  351. {
  352. this.OrderProductEx.bUpgrade = b;
  353. }
  354. if (OrderServiceEx != null)
  355. {
  356. OrderServiceEx.bUpgrade = b;
  357. }
  358. if (this.OrderSightsEx != null)
  359. {
  360. this.OrderSightsEx.bUpgrade = b;
  361. }
  362. else if (this.OrderStagesEx != null)
  363. {
  364. this.OrderStagesEx.bUpgrade = b;
  365. }
  366. }
  367. /// <summary>
  368. /// 打开订单数据
  369. /// </summary>
  370. void OpenSingleLoad()
  371. {
  372. RebindUpgrade(false);
  373. this.IsSaveedHadAuthorized = false;
  374. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  375. {
  376. LYFZ.Model.Model_ErpOrder modelorder = orbll.GetModel(this.StrNumber);
  377. if (modelorder.ID <= 0)
  378. { return; }
  379. else
  380. {
  381. this._UploadPath = modelorder.Ord_UploadPath;
  382. this.strOldTaoXiName = modelorder.Ord_OldSeriesName;
  383. this.strOldTaoXiPrice = modelorder.Ord_OldSeriesPrice;
  384. this.strOldTaoXiCode = modelorder.Ord_OldSeriesCode;
  385. modelId = modelorder.ID;
  386. this.OrdType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), modelorder.Ord_Type);
  387. if (modelorder.Ord_Class == "0")
  388. {
  389. IsIntentionOrder = true;
  390. }
  391. DataTable tbl_P = orbll.GetView_Custom("tb_ErpOrdersPerson", StrWhere: "OrdPe_OrderNumber = '" + this.StrNumber + "'", filedOrder: "OrdPe_Type ASC", ShowColumnName: "dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) AS OrdPe_OrdersPersonName,OrdPe_OrdersPerson,OrdPe_Type").Tables[0];
  392. DataTable tblFriends = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID,GP_IntroducerCustomerID").Tables[0];
  393. List<LYFZ.Model.Model_ErpCustomer> mlistClient = new List<Model.Model_ErpCustomer>();
  394. List<string> mlistClientRelation = new List<string>();
  395. string StrMasterNumber = "";
  396. string StrChildNumber = "";
  397. DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID").Tables[0];
  398. if (tblGroup.Rows.Count > 0)
  399. {
  400. DataTable tblClientGroup = orbll.GetView_Custom("View_CustomerGroupMembersAndErpCustomer", StrWhere: "GM_CustomerGroupID = '" + tblGroup.Rows[0]["GP_CustomerGroupID"].ToString().Trim() + "'", ShowColumnName: "Cus_CustomerNumber,GM_Master,GM_RelatedPersonID,GM_Relation,GM_ProtagonistCustomer").Tables[0];
  401. for (int i = 0; i < tblClientGroup.Rows.Count; i++)
  402. {
  403. if (tblClientGroup.Rows[i]["GM_Master"].ToString().Trim() == "1")
  404. { StrMasterNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
  405. if (modelorder.Ord_Type == "1")
  406. {
  407. if (tblClientGroup.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
  408. { StrChildNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
  409. }
  410. LYFZ.Model.Model_ErpCustomer modelClient = ctbll.GetModel("Cus_CustomerNumber", tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim());
  411. if (modelClient.ID > 0)
  412. {
  413. mlistClient.Add(modelClient);
  414. mlistClientRelation.Add(tblClientGroup.Rows[i]["GM_Relation"].ToString().Trim());
  415. }
  416. }
  417. }
  418. try
  419. {
  420. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  421. {
  422. if (modelorder.Ord_Class == "1")
  423. { this.btnSaveIntent.Visible = false; }
  424. else
  425. { this.btnSaveIntent.Visible = true; }
  426. if (this.IsUpdateOrderLoad)
  427. { this.lblYiXiangClient.Enabled = false; this.panelTransactmemberCard.Visible = false; }
  428. #region 订单资料
  429. if (this.UpdateOrderIsUpdateClientData)
  430. {
  431. this.AddClinetCount = 0;
  432. }
  433. this.tabControl.SelectedIndex = 1;
  434. bool IsActivity = false;
  435. switch (this.OrdType)
  436. {
  437. case EnumPublic.OrderType.婚纱订单:
  438. case EnumPublic.OrderType.儿童订单:
  439. case EnumPublic.OrderType.写真订单:
  440. case EnumPublic.OrderType.婚庆订单:
  441. this.OrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
  442. IsActivity = this.OrderEx.SetOrderValue(modelorder);
  443. if (this.OrderSightsEx != null)
  444. {
  445. this.OrderSightsEx.SetOrderSightsValue(this.StrNumber, modelorder.Ord_SeriesName);
  446. this.OrderSightsEx.OrdType = (int)this.OrdType;
  447. }
  448. else if (this.OrderStagesEx != null)
  449. { this.OrderStagesEx.SetOrderStagesValue(this.StrNumber, modelorder.Ord_SeriesName); }
  450. break;
  451. case EnumPublic.OrderType.服务订单:
  452. this.ServiceOrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
  453. this.ServiceOrderEx.SetOrderValue(modelorder);
  454. break;
  455. }
  456. try
  457. {
  458. this.OrderServiceEx.SetOrderServiceValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
  459. this.OrderProductEx.SetOrderProductValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
  460. }
  461. catch (Exception ex)
  462. {
  463. MessageBoxCustom.Show(ex.Message + ",原因:可能是“tb_ErpOrderProductList”商品唯一标识重复");
  464. }
  465. #endregion
  466. #region 接单人
  467. string PersonName = "";
  468. string PersonTag = "";
  469. string PersonType = "";
  470. for (int i = 0; i < tbl_P.Rows.Count; i++)
  471. {
  472. if (i == 0)
  473. {
  474. PersonName = tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
  475. PersonTag = tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
  476. PersonType = tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
  477. }
  478. else
  479. {
  480. PersonName += "," + tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
  481. PersonTag += "," + tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
  482. PersonType += "," + tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
  483. }
  484. }
  485. this.txtOrderPerson.Text = PersonName;
  486. this.txtOrderPerson.Tag = PersonTag + "|" + PersonType;
  487. strPersonData = modelorder.Ord_CommissionRatio;
  488. #endregion
  489. #region 客户来源
  490. if (modelorder.Ord_CustomerSource.Trim() == "朋友介绍")
  491. {
  492. this.chkFriends.Checked = true;
  493. if (tblFriends.Rows.Count > 0)
  494. {
  495. if (tblFriends.Rows[0]["GP_IntroducerCustomerID"].ToString().Trim() != "")
  496. {
  497. this.modelFriends = ctbll.GetModel("Cus_CustomerNumber", tblFriends.Rows[0]["GP_IntroducerCustomerID"]);
  498. string StrCardType = "";
  499. string StrCardTypeShow = "";
  500. DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + this.modelFriends.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
  501. if (dt.Rows.Count > 0)
  502. {
  503. StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
  504. if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
  505. { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
  506. }
  507. LYFZ.Model.Model_ErpMemberCardBackCashSet modelCashSet = mcbcsetbll.GetModel("Mcb_OrderNumber", modelorder.Ord_Number);
  508. if (modelCashSet.ID > 0)
  509. {
  510. this.modelViceCard = mcvbll.GetModel("Mvc_ViceNumber", modelCashSet.Mcb_ViceNumber);
  511. this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + " - 副卡)";
  512. this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ";副卡卡号:" + this.modelViceCard.Mvc_ViceCardNumber + ")");
  513. }
  514. else
  515. {
  516. if (this.modelFriends.Cus_Name != null)
  517. {
  518. this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + ")";
  519. this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ")");
  520. }
  521. }
  522. }
  523. }
  524. }
  525. else if (modelorder.Ord_CustomerSource.Trim() == "老客户")
  526. { this.chkOldClient.Checked = true; }
  527. else if (modelorder.Ord_CustomerSource.Trim() == "医院跟踪客户")
  528. { this.chkHospitalClient.Checked = true; }
  529. else
  530. {
  531. this.chkOther.Checked = true;
  532. this.cmbtreevClientSource.Enabled = true;
  533. this.cmbtreevClientSource.TextFindTag(modelorder.Ord_CustomerSource.Trim());
  534. }
  535. #endregion
  536. #region 喜爱格调
  537. if (modelorder.Ord_LovedStyle.Trim() != "")
  538. {
  539. if (modelorder.Ord_LovedStyle.Trim().IndexOf('|') != -1)
  540. {
  541. string[] LovedStylelist = modelorder.Ord_LovedStyle.Trim().Split('|');
  542. if (LovedStylelist.Length > 0)
  543. {
  544. for (int i = 0; i < LovedStylelist.Length; i++)
  545. {
  546. try
  547. {
  548. ((CheckBoxEx)panelEx3.Controls[LovedStylelist[i]]).Checked = true;
  549. }
  550. catch { }
  551. }
  552. }
  553. }
  554. else
  555. { ((CheckBoxEx)panelEx3.Controls[modelorder.Ord_LovedStyle.Trim()]).Checked = true; }
  556. }
  557. #endregion
  558. #region 客户资料
  559. this.chBox_Click();
  560. if (this.UpdateOrderIsUpdateClientData)
  561. {
  562. foreach (Control control in this.flowPanel1.Controls)
  563. {
  564. if (control is SetCustomControls.OrderClientParentsControlsEx)
  565. {
  566. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  567. if (tmp.StrClientAttribute == "Man_")
  568. {
  569. for (int i = 0; i < mlistClient.Count; i++)
  570. {
  571. if (mlistClient[i].Cus_CustomerNumber == StrMasterNumber)
  572. {
  573. this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
  574. tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
  575. tmp.IsPictResetShow = true;
  576. tmp.IsPictEditShow = true;
  577. mlistClient.RemoveAt(i);
  578. mlistClientRelation.RemoveAt(i);
  579. break;
  580. }
  581. }
  582. }
  583. else
  584. {
  585. for (int i = 0; i < mlistClient.Count; i++)
  586. {
  587. if (mlistClient[i].Cus_CustomerNumber != StrChildNumber && mlistClient[i].Cus_CustomerNumber.Trim() == StrMasterNumber)
  588. {
  589. this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
  590. tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
  591. tmp.IsPictResetShow = true;
  592. tmp.IsPictEditShow = true;
  593. mlistClient.RemoveAt(i);
  594. mlistClientRelation.RemoveAt(i);
  595. break;
  596. }
  597. }
  598. }
  599. }
  600. else if (control is SetCustomControls.OrderClientChildrenControlsEx)
  601. {
  602. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  603. for (int i = 0; i < mlistClient.Count; i++)
  604. {
  605. if (mlistClient[i].Cus_CustomerNumber.Trim() == StrChildNumber)
  606. {
  607. tmp.SetClientValue(mlistClient[i], true);
  608. tmp.IsPictResetShow = true;
  609. tmp.IsPictEditShow = true;
  610. mlistClient.RemoveAt(i);
  611. mlistClientRelation.RemoveAt(i);
  612. break;
  613. }
  614. }
  615. }
  616. }
  617. if (mlistClient.Count > 0)
  618. {
  619. for (int i = 0; i < mlistClient.Count; i++)
  620. {
  621. this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
  622. this.ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: mlistClient[i], MainClientRelation: mlistClientRelation[i].Trim());
  623. this.AddClinetCount++;
  624. }
  625. }
  626. }
  627. #endregion
  628. this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
  629. }));
  630. }
  631. catch { }
  632. }
  633. });
  634. this.tabControl.SelectedIndex = 0;
  635. }
  636. /// <summary>
  637. /// 赋婚期值
  638. /// </summary>
  639. /// <param name="StrValue"></param>
  640. /// <param name="StrLunar"></param>
  641. void SetMarriageValue(string StrValue, string StrLunar)
  642. {
  643. switch (this.OrdType)
  644. {
  645. case EnumPublic.OrderType.婚纱订单:
  646. case EnumPublic.OrderType.婚庆订单:
  647. case EnumPublic.OrderType.服务订单:
  648. this.mskMarriage.StrValue = StrValue;
  649. this.chkMarriage.Checked = LYFZ.Command.Command_Validate.DateLunar(StrLunar);
  650. break;
  651. }
  652. }
  653. /// <summary>
  654. /// 获取前缀
  655. /// </summary>
  656. /// <returns></returns>
  657. private string GetOrderCustomPrefix()
  658. {
  659. string StrCustomPrefix = "";
  660. if (this.OrdType == LYFZ.EnumPublic.OrderType.婚纱订单)
  661. { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚纱订单).Trim(); }
  662. else if (this.OrdType == LYFZ.EnumPublic.OrderType.儿童订单)
  663. { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.儿童订单).Trim(); }
  664. else if (this.OrdType == LYFZ.EnumPublic.OrderType.写真订单)
  665. { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.写真订单).Trim(); }
  666. else if (this.OrdType == LYFZ.EnumPublic.OrderType.服务订单)
  667. { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.服务订单).Trim(); }
  668. else if (this.OrdType == LYFZ.EnumPublic.OrderType.婚庆订单)
  669. { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚庆订单).Trim(); }
  670. return StrCustomPrefix;
  671. }
  672. /// <summary>
  673. /// 填充客户层的高
  674. /// </summary>
  675. void FillClientDataPanelHeight()
  676. {
  677. if (this.panelVice1.Height < (this.tap1.Height - 12))
  678. {
  679. this.panelVice1.Height = this.tap1.Height - 12;
  680. this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
  681. }
  682. }
  683. /// <summary>
  684. /// 检查数据是否被修改过
  685. /// </summary>
  686. /// <returns></returns>
  687. bool CheckDataIsUpdate()
  688. {
  689. bool IsUpdateSaveed = false;
  690. if (this.OrdType == EnumPublic.OrderType.服务订单)
  691. { }
  692. else
  693. {
  694. ComboBoxTreeViewEx cmbtreevTaoXiName = OrderEx.CmbtreevTaoXi;
  695. if (cmbtreevTaoXiName.Tag != null)
  696. {
  697. DataRow[] dtRow0 = null;
  698. DataRow[] dtRow1 = null;
  699. DataRow[] dtRow2 = null;
  700. DataTable tbl0 = null;
  701. DataTable tbl1 = null;
  702. DataTable tbl2 = null;
  703. string ExecuteSql = "select tb_ErpPackagesGiftMerchandise.ID,Sc_ClassName,Pgm_GiveType,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity " +
  704. "from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
  705. "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
  706. ExecuteSql += "select tb_ErpPackagesGiftMerchandise.ID,Prod_Batch,Pgm_Quantity,Pgm_GiveType from tb_ErpPackagesGiftMerchandise " +
  707. "Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
  708. ExecuteSql += "select Pak_UnitPrice from tb_ErpPackages where Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
  709. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  710. DataTable dt0 = dsData.Tables["ds"];
  711. DataTable dt1 = dsData.Tables["ds1"];
  712. DataTable dt2 = dsData.Tables["ds2"];
  713. switch (this.OrdType)
  714. {
  715. case EnumPublic.OrderType.儿童订单:
  716. case EnumPublic.OrderType.婚纱订单:
  717. case EnumPublic.OrderType.写真订单:
  718. case EnumPublic.OrderType.婚庆订单:
  719. #region 判断价格
  720. if (dt2.Rows.Count > 0)
  721. {
  722. if (Convert.ToDecimal(dt2.Rows[0]["Pak_UnitPrice"]) != Convert.ToDecimal(this.OrderEx.TaoXiPrice))
  723. { IsUpdateSaveed = true; }
  724. }
  725. #endregion
  726. #region 判断入底入册
  727. switch (this.OrdType)
  728. {
  729. case EnumPublic.OrderType.写真订单:
  730. case EnumPublic.OrderType.婚庆订单:
  731. try
  732. {
  733. DataTable dt = orbll.GetView_Custom("tb_ErpPackages", StrWhere: "Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "'", ShowColumnName: "Pak_IntoTheArchive,Pak_IntoTheBook").Tables[0];
  734. Hashtable htDataPackages = this.OrderEx.GetIntoRegisterAndIntoBottom();
  735. if (dt.Rows.Count == 0 && htDataPackages.Count > 0)
  736. { IsUpdateSaveed = true; }
  737. else if (Convert.ToInt32(dt.Rows[0]["Pak_IntoTheArchive"]) != Convert.ToInt32(htDataPackages["IntoBottom"].ToString()) || Convert.ToInt32(dt.Rows[0]["Pak_IntoTheBook"]) != Convert.ToInt32(htDataPackages["IntoRegister"].ToString()))
  738. { IsUpdateSaveed = true; }
  739. }
  740. catch
  741. { }
  742. break;
  743. }
  744. #endregion
  745. #region 商品与服务
  746. if (!IsUpdateSaveed)
  747. {
  748. dtRow0 = dt1.Select("Pgm_GiveType = '0'");
  749. tbl0 = this.OrderProductEx.GetListViewData();
  750. if (dtRow0.Length != tbl0.Rows.Count)
  751. { IsUpdateSaveed = true; }
  752. else if (dtRow0.Length > 0 && tbl0.Rows.Count > 0)
  753. {
  754. for (int j = 0; j < tbl0.Rows.Count; j++)
  755. {
  756. if (string.IsNullOrEmpty(tbl0.Rows[j]["PgmID"].ToString().Trim()))
  757. {
  758. IsUpdateSaveed = true;
  759. break;
  760. }
  761. }
  762. if (!IsUpdateSaveed)
  763. {
  764. for (int i = 0; i < dtRow0.Length; i++)
  765. {
  766. DataRow[] dtRow = tbl0.Select("PgmID = '" + dtRow0[i]["ID"].ToString().Trim() + "'");
  767. if (dtRow0.Length <= 0)
  768. { IsUpdateSaveed = true; }
  769. else
  770. {
  771. if (Convert.ToInt32(dtRow[0]["商品P数"]) != Convert.ToInt32(dtRow0[i]["Prod_Batch"]) || Convert.ToInt32(dtRow[0]["商品数量"]) != Convert.ToInt32(dtRow0[i]["Pgm_Quantity"]))
  772. {
  773. IsUpdateSaveed = true;
  774. break;
  775. }
  776. }
  777. }
  778. }
  779. }
  780. }
  781. if (!IsUpdateSaveed)
  782. {
  783. dtRow1 = dt1.Select("Pgm_GiveType = '1'");
  784. tbl1 = this.OrderServiceEx.GetListViewData();
  785. if (dtRow1.Length != tbl1.Rows.Count)
  786. { IsUpdateSaveed = true; }
  787. else if (dtRow1.Length > 0 && tbl1.Rows.Count > 0)
  788. {
  789. for (int j = 0; j < tbl1.Rows.Count; j++)
  790. {
  791. if (string.IsNullOrEmpty(tbl1.Rows[j]["PgmID"].ToString().Trim()))
  792. {
  793. IsUpdateSaveed = true;
  794. break;
  795. }
  796. }
  797. if (!IsUpdateSaveed)
  798. {
  799. for (int i = 0; i < dtRow1.Length; i++)
  800. {
  801. DataRow[] dtRow = tbl1.Select("PgmID = '" + dtRow1[i]["ID"].ToString().Trim() + "'");
  802. if (dtRow1.Length <= 0)
  803. { IsUpdateSaveed = true; }
  804. else
  805. {
  806. if (Convert.ToInt32(dtRow[0]["服务数量"]) != Convert.ToInt32(dtRow1[i]["Pgm_Quantity"]))
  807. {
  808. IsUpdateSaveed = true;
  809. break;
  810. }
  811. }
  812. }
  813. }
  814. }
  815. }
  816. #endregion
  817. #region 景点与拍摄次数
  818. if (!IsUpdateSaveed)
  819. {
  820. switch (this.OrdType)
  821. {
  822. case EnumPublic.OrderType.婚纱订单:
  823. case EnumPublic.OrderType.写真订单:
  824. dtRow2 = dt0.Select("Pgm_GiveType = '2'");
  825. tbl2 = this.OrderSightsEx.GetListViewData();
  826. break;
  827. case EnumPublic.OrderType.儿童订单:
  828. dtRow2 = dt0.Select("Pgm_GiveType = '3'");
  829. tbl2 = this.OrderStagesEx.GetListViewData();
  830. break;
  831. }
  832. if (dtRow2.Length != tbl2.Rows.Count)
  833. { IsUpdateSaveed = true; }
  834. else if (dtRow2.Length > 0 && tbl2.Rows.Count > 0)
  835. {
  836. for (int j = 0; j < tbl2.Rows.Count; j++)
  837. {
  838. if (string.IsNullOrEmpty(tbl2.Rows[j]["PgmID"].ToString().Trim()))
  839. {
  840. IsUpdateSaveed = true;
  841. break;
  842. }
  843. }
  844. if (!IsUpdateSaveed)
  845. {
  846. for (int i = 0; i < dtRow2.Length; i++)
  847. {
  848. DataRow[] dtRow = tbl2.Select("PgmID = '" + dtRow2[i]["ID"].ToString().Trim() + "'");
  849. if (dtRow2.Length <= 0)
  850. { IsUpdateSaveed = true; }
  851. else
  852. {
  853. if (dtRow[0]["拍摄级别"].ToString().Trim() != dtRow2[i]["Sc_ClassName"].ToString().Trim() || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
  854. {
  855. IsUpdateSaveed = true;
  856. break;
  857. }
  858. if (!IsUpdateSaveed)
  859. {
  860. switch (this.OrdType)
  861. {
  862. case EnumPublic.OrderType.儿童订单:
  863. if (Convert.ToInt32(dtRow[0]["入册"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoRegisterQuantity"]) || Convert.ToInt32(dtRow[0]["入底"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoBottomQuantity"]) || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
  864. {
  865. IsUpdateSaveed = true;
  866. break;
  867. }
  868. break;
  869. }
  870. }
  871. }
  872. }
  873. }
  874. }
  875. }
  876. #endregion
  877. break;
  878. }
  879. }
  880. }
  881. return IsUpdateSaveed;
  882. }
  883. /// <summary>
  884. /// 保存意向
  885. /// </summary>
  886. /// <param name="sender"></param>
  887. /// <param name="e"></param>
  888. void btnSaveIntent_Click(object sender, EventArgs e)
  889. {
  890. SaveOrderData("0");
  891. }
  892. /// <summary>
  893. /// 保存意向订单和真实订单数据
  894. /// </summary>
  895. /// <param name="saveClass">0意向订单,1开单</param>
  896. void SaveOrderData(string saveClass)
  897. {
  898. Api_ErpOrderModel apiErpModel = new Api_ErpOrderModel()
  899. {
  900. OrderID = modelId,
  901. strTime = SDateTime.Now,
  902. strUserName = StrUserName,
  903. dividedShop = strInfoID,
  904. strUserID = strUserID,
  905. User_IP = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP,
  906. strMskMarriage = this.mskMarriage.StrValue,
  907. bChkCheckBox = this.chkMarriage.Checked,
  908. chkTransactmemberCard = this.chkTransactmemberCard.Checked,
  909. StrSaveClass = saveClass,
  910. strStyle = this.GetStyle(),
  911. StrClientSource = this.GetClientSource(),
  912. dec_OrderDiscounts = this.dec_OrderDiscounts,
  913. strOldTaoXiName=this.strOldTaoXiName,
  914. strOldTaoXiCode = this.strOldTaoXiCode,
  915. strOldTaoXiPrice = this.strOldTaoXiPrice,
  916. UploadPath = this._UploadPath,
  917. CommissionRatio = this.strPersonData,
  918. strOrderPerson = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Tag.ToString(),
  919. strOrderPersonName = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Text.ToString(),
  920. ComeSingleLotNumber = this.ComeSingleLotNumber,
  921. StrNewOrderNumber = (modelId > 0 ? this.StrNumber : null),
  922. OrderGroupNumber = this.OrderGroupNumber,
  923. customerData = new List<Api_CustomerModel>(),
  924. OrderSightData = new List<Api_StagesModel>(),
  925. OrderServiceData = new List<Api_ServiceModel>(),
  926. OrderProductData = new List<Api_ProductModel>(),
  927. modelFriends = new Model.Model_ErpCustomer(),
  928. modelViceCard = new Model.Model_ErpMemberCardViceCard(),
  929. IsMagess = true
  930. };
  931. if (this.modelFriends != null)
  932. {
  933. apiErpModel.friend_CustomerNumber = this.modelFriends.Cus_CustomerNumber;
  934. }
  935. else
  936. {
  937. apiErpModel.friend_CustomerNumber = "";
  938. }
  939. apiErpModel.orderType = this.OrdType;
  940. ///会员副卡
  941. apiErpModel.modelViceCard = this.modelViceCard;
  942. if (apiErpModel.modelViceCard != null)
  943. {
  944. if (apiErpModel.modelViceCard.Mvc_CreateDatetime == new DateTime())
  945. {
  946. apiErpModel.modelViceCard.Mvc_CreateDatetime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  947. }
  948. if (apiErpModel.modelViceCard.Mvc_UpdateDateTime == new DateTime())
  949. {
  950. apiErpModel.modelViceCard.Mvc_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  951. }
  952. }
  953. //朋友介绍
  954. apiErpModel.modelFriends = this.modelFriends;
  955. if (apiErpModel.modelFriends != null)
  956. {
  957. if (apiErpModel.modelFriends.Cus_CreateDateTime == new DateTime())
  958. {
  959. apiErpModel.modelFriends.Cus_CreateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  960. }
  961. if (apiErpModel.modelFriends.Cus_UpdateDateTime == new DateTime())
  962. {
  963. apiErpModel.modelFriends.Cus_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  964. }
  965. }
  966. string ChildCilentRelation = "";
  967. string MainCilentRelation = "";
  968. foreach (Control control in this.flowPanel1.Controls)
  969. {
  970. ///成人客户信息
  971. if (control is SetCustomControls.OrderClientParentsControlsEx)
  972. {
  973. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  974. tmp.GetClientValueData(apiErpModel, ref MainCilentRelation);
  975. }
  976. ///儿童客户信息
  977. if (control is SetCustomControls.OrderClientChildrenControlsEx)
  978. {
  979. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  980. tmp.GetClientValueData(apiErpModel, ref ChildCilentRelation);
  981. }
  982. }
  983. if (this.OrderEx != null)
  984. {
  985. ///获取订单数据
  986. this.OrderEx.BindApiData(apiErpModel);
  987. }
  988. if( this.ServiceOrderEx!=null)
  989. {
  990. this.ServiceOrderEx.BindApiData(apiErpModel);
  991. }
  992. ///获取拍摄场景数据
  993. switch (this.OrdType)
  994. {
  995. case EnumPublic.OrderType.婚纱订单:
  996. case EnumPublic.OrderType.写真订单:
  997. if (this.OrderSightsEx != null)
  998. {
  999. this.OrderSightsEx.GetOrderSightsValueData(apiErpModel);
  1000. }
  1001. break;
  1002. case EnumPublic.OrderType.儿童订单:
  1003. if (this.OrderStagesEx != null)
  1004. {
  1005. this.OrderStagesEx.GetOrderStagesValueData(apiErpModel);
  1006. }
  1007. break;
  1008. }
  1009. ///服务的数据信息
  1010. if (this.OrderServiceEx != null)
  1011. {
  1012. this.OrderServiceEx.GetOrderServiceValueData(apiErpModel);
  1013. }
  1014. if (this.OrderProductEx != null)
  1015. {
  1016. this.OrderProductEx.GetOrderProductValueData(apiErpModel);
  1017. }
  1018. int indx = 0;
  1019. bool bSelect = false;
  1020. LYFZ.BLL.BLL_ErpOrder erpOrder = new BLL.BLL_ErpOrder();
  1021. // string json = Json.JsonTool.ObjectToJson(apiErpModel);
  1022. 数据检查队列:
  1023. LYFZ.Command.Result result = erpOrder.SaveErpOrderDataByCheck(apiErpModel, ref indx, ref bSelect);
  1024. if (!result.Status)
  1025. {
  1026. if(result.StatusMsg=="手机号码重复,请核实客户数据!")
  1027. {
  1028. MessageBoxCustom.Show(result.StatusMsg);
  1029. return;
  1030. }
  1031. LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg> resultMsg = ((LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg>)result);
  1032. if (resultMsg.Data == Command.EnumReturnMsg.ReturnMsg)
  1033. {
  1034. MessageBoxCustom.Show(resultMsg.StatusMsg);
  1035. return;
  1036. }
  1037. else if (resultMsg.Data == Command.EnumReturnMsg.SelectMsg)
  1038. {
  1039. if (MessageBoxCustom.Show(resultMsg.StatusMsg, "温馨提示",
  1040. MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
  1041. {
  1042. return;
  1043. }
  1044. else
  1045. {
  1046. bSelect = true;
  1047. goto 数据检查队列;
  1048. }
  1049. }
  1050. else if (resultMsg.Data == Command.EnumReturnMsg.CostAuthorization)
  1051. {
  1052. if (MessageBoxCustom.Show(resultMsg.StatusMsg, "温馨提示",
  1053. MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
  1054. {
  1055. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm(null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 1);
  1056. frm.ShowDialog();
  1057. if (!frm.IsSaveed)
  1058. {
  1059. return;
  1060. }
  1061. else
  1062. {
  1063. decimal Ord_SeriesPrice = 0;
  1064. decimal.TryParse(apiErpModel.strTaoXiPrice, out Ord_SeriesPrice);
  1065. decimal Old_PackagesAmount = apiErpModel.ProductAmount();
  1066. Old_PackagesAmount += apiErpModel.ServiceAmount();
  1067. if (apiErpModel.orderType == EnumPublic.OrderType.儿童订单)
  1068. {
  1069. Old_PackagesAmount += apiErpModel.SightOrStageAmount();
  1070. }
  1071. else if (apiErpModel.orderType != EnumPublic.OrderType.婚庆订单)
  1072. {
  1073. Old_PackagesAmount += apiErpModel.SightOrStageAmount();
  1074. }
  1075. if (Ord_SeriesPrice < (Old_PackagesAmount * frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType))))
  1076. {
  1077. frm.SetAuthorizationResult(String.Format("授权失败,授权人成本管控权限不够"));
  1078. MessageBoxCustom.Show("授权帐号:" + frm.StrUserAccount + ",授权后的套系价格低于订单总成本,无法保存!"); return; }
  1079. else
  1080. {
  1081. frm.SetAuthorizationResult();
  1082. bSelect = true;
  1083. goto 数据检查队列;
  1084. }
  1085. }
  1086. }
  1087. else
  1088. {
  1089. return;
  1090. }
  1091. }
  1092. else
  1093. {
  1094. MessageBoxCustom.Show(resultMsg.StatusMsg);
  1095. return;
  1096. }
  1097. }
  1098. else
  1099. {
  1100. //string strOrderPrefix = LYFZ.BLL.Common.BLL_Com_Data.GetOrderCustomPrefix(apiErpModel.orderType);
  1101. //if (apiErpModel.OrderID == 0)
  1102. //{
  1103. // if (apiErpModel.bIsShowSinceOrderNumber)
  1104. // {
  1105. // apiErpModel.SinceOrderNumber
  1106. // }
  1107. //}
  1108. bool isAddOrder = false;
  1109. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  1110. {
  1111. backgroundWorker.ReportProgress(0, "正在提交数据... ");
  1112. result = erpOrder.SaveErpOrderData(apiErpModel, ref isAddOrder);
  1113. });
  1114. if (result.Status)
  1115. {
  1116. object obj;
  1117. try
  1118. {
  1119. obj = ((LYFZ.Command.Result<object>)result).Data;
  1120. }
  1121. catch
  1122. {
  1123. MessageBoxCustom.Show("保存失败", "提示");
  1124. return;
  1125. }
  1126. Model.Model_ErpOrder modelOrder = (Model.Model_ErpOrder)(obj.GetType().GetProperty("modelOrder").GetValue(obj, null));
  1127. LYFZ.Model.Model_ErpCustomer modelCilentMain = (Model.Model_ErpCustomer)(obj.GetType().GetProperty("modelCilentMain").GetValue(obj, null));
  1128. this.StrNumber = modelOrder.Ord_Number;
  1129. this.IsSaveed = true;
  1130. switch (this.OrdType)
  1131. {
  1132. case EnumPublic.OrderType.婚纱订单:
  1133. case EnumPublic.OrderType.儿童订单:
  1134. case EnumPublic.OrderType.写真订单:
  1135. case EnumPublic.OrderType.婚庆订单:
  1136. if (this.OrderEx != null)
  1137. { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
  1138. break;
  1139. case EnumPublic.OrderType.服务订单:
  1140. if (this.ServiceOrderEx != null)
  1141. { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
  1142. break;
  1143. }
  1144. this.IsUpdateOrderLoad = true;
  1145. //LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber);
  1146. //if (modelOrder.Ord_Number.Trim().Length > 0)
  1147. //{ LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单); }
  1148. if (apiErpModel.StrSaveClass == "1")
  1149. {
  1150. #region 收款 并 积分
  1151. bool IsPayment = true;
  1152. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, LYFZ.CustomAttributes.OperatingAuthority.OrdersReceivables))
  1153. {
  1154. if (modelOrder.Ord_SeriesPrice > 0)
  1155. {
  1156. if (ptbll.GetRecordCount("Pay_OrdNumber = '" + modelOrder.Ord_Number + "'") <= 0)
  1157. {
  1158. LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmPrePayment frm = new FinancialManagement.OrdersReceivables.FrmPrePayment();
  1159. //frm.StrOrdType = this.OrdType.ToString();
  1160. frm.StrOrdNumber = this.StrNumber;
  1161. //frm.StrCope = modelOrder.Ord_SeriesPrice;
  1162. frm.IsShowButtonPayment = true;
  1163. //frm.StrPaid = 0;
  1164. //frm.StrArrears = modelOrder.Ord_SeriesPrice;
  1165. frm.ShowDialog();
  1166. IsPayment = false;
  1167. }
  1168. }
  1169. }
  1170. #endregion
  1171. this.OpenSingleLoad();
  1172. if (IsPayment)
  1173. {
  1174. MessageBoxCustom.Show(result.StatusMsg);
  1175. }
  1176. #region 短信发送操作
  1177. LYFZ.BLL.BLL_SMSRecord smsRecord = new BLL.BLL_SMSRecord();
  1178. smsRecord.SMSSend(orbll,
  1179. sgbll,
  1180. mcbcsetbll,
  1181. apiErpModel,
  1182. modelOrder,
  1183. isAddOrder,
  1184. apiErpModel.StrSaveClass == "0",
  1185. modelCilentMain.Cus_CustomerNumber);
  1186. #endregion
  1187. //MessageBoxCustom.Show("保存成功!");
  1188. }
  1189. else
  1190. {
  1191. this.StrNumber = modelOrder.Ord_Number;
  1192. this.IsSaveed = true;
  1193. switch (this.OrdType)
  1194. {
  1195. case EnumPublic.OrderType.婚纱订单:
  1196. case EnumPublic.OrderType.儿童订单:
  1197. case EnumPublic.OrderType.写真订单:
  1198. case EnumPublic.OrderType.婚庆订单:
  1199. if (this.OrderEx != null)
  1200. { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
  1201. break;
  1202. case EnumPublic.OrderType.服务订单:
  1203. if (this.ServiceOrderEx != null)
  1204. { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
  1205. break;
  1206. }
  1207. this.IsUpdateOrderLoad = true;
  1208. LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber);
  1209. if (modelOrder.Ord_Number.Trim().Length > 0)
  1210. {
  1211. new System.Threading.Thread(new System.Threading.ThreadStart(delegate ()
  1212. {
  1213. LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单);
  1214. })).Start();
  1215. }
  1216. this.OpenSingleLoad();
  1217. MessageBoxCustom.Show("保存成功!");
  1218. }
  1219. }
  1220. else
  1221. {
  1222. MessageBoxCustom.Show(result.StatusMsg);
  1223. }
  1224. }
  1225. }
  1226. /// <summary>
  1227. /// 保存
  1228. /// </summary>
  1229. /// <param name="sender"></param>
  1230. /// <param name="e"></param>
  1231. void btnSave_Click(object sender, EventArgs e)
  1232. {
  1233. #region 检查授权
  1234. if (this.StrNumber.Trim() == "")
  1235. {
  1236. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder))
  1237. {
  1238. if (!this.IsSaveedHadAuthorized)
  1239. {
  1240. bool IsCheckDataIsUpdate = this.CheckDataIsUpdate();
  1241. string strWindowText = "开订单";
  1242. if (IsCheckDataIsUpdate)
  1243. { strWindowText += "、修改新订单"; }
  1244. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
  1245. frm.StrWindowText = strWindowText;
  1246. frm.ShowDialog();
  1247. if (!frm.IsSaveed)
  1248. { return; }
  1249. else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder, frm.User_BelongRoles))
  1250. {
  1251. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'开订单'权限"));
  1252. MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'开订单'权限。"); return; }
  1253. else {
  1254. frm.SetAuthorizationResult();
  1255. }
  1256. this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
  1257. #region 检测套系是否被修改过
  1258. if (IsCheckDataIsUpdate)
  1259. {
  1260. if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
  1261. {
  1262. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
  1263. MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return; }
  1264. else {
  1265. frm.SetAuthorizationResult();
  1266. }
  1267. }
  1268. #endregion
  1269. }
  1270. }
  1271. else
  1272. {
  1273. #region 检测套系是否被修改过
  1274. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder))
  1275. {
  1276. if (this.CheckDataIsUpdate())
  1277. {
  1278. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder);
  1279. frm.StrWindowText = "修改新订单";
  1280. frm.ShowDialog();
  1281. if (!frm.IsSaveed)
  1282. { return; }
  1283. else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
  1284. {
  1285. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
  1286. MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return; }
  1287. else {
  1288. frm.SetAuthorizationResult();
  1289. }
  1290. }
  1291. }
  1292. #endregion
  1293. this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
  1294. }
  1295. }
  1296. else
  1297. {
  1298. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder))
  1299. {
  1300. if (!this.IsSaveedHadAuthorized)
  1301. {
  1302. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
  1303. frm.StrWindowText = "修改已订单";
  1304. frm.ShowDialog();
  1305. if (!frm.IsSaveed)
  1306. { return; }
  1307. else
  1308. {
  1309. if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder, frm.User_BelongRoles))
  1310. {
  1311. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改已订单'权限"));
  1312. MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改已订单'权限。"); return; }
  1313. else {
  1314. frm.SetAuthorizationResult();
  1315. }
  1316. this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
  1317. }
  1318. }
  1319. }
  1320. else
  1321. { this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType)); }
  1322. }
  1323. this.IsSaveedHadAuthorized = true;
  1324. #endregion
  1325. SaveOrderData("1");
  1326. }
  1327. void test(List<Helper.CommandInfo> clist, string newOrderNumber)
  1328. {
  1329. foreach (Helper.CommandInfo commd in clist)
  1330. {
  1331. foreach (System.Data.SqlClient.SqlParameter Par in commd.Parameters)
  1332. {
  1333. if ("orderNuber,eddiid,iiii,dddd".Contains(Par.ParameterName))
  1334. {
  1335. Par.Value = newOrderNumber;
  1336. }
  1337. }
  1338. }
  1339. }
  1340. /// <summary>
  1341. /// 获取订单数码表的摄次数种子值
  1342. /// </summary>
  1343. /// <param name="dlist"></param>
  1344. /// <returns></returns>
  1345. int GetDigitalNumber(List<LYFZ.Model.Model_ErpOrderDigital> dlist)
  1346. {
  1347. int DigitalNumber = 0;
  1348. if (dlist != null && dlist.Count > 0)
  1349. {
  1350. DigitalNumber = Convert.ToInt32(dlist[dlist.Count - 1].Ordv_DigitalNumber);
  1351. while (ViceNumberEquals(dlist, DigitalNumber))
  1352. { DigitalNumber++; }
  1353. DigitalNumber--;
  1354. }
  1355. return DigitalNumber;
  1356. }
  1357. /// <summary>
  1358. /// 栓检查DigitalNumber是否存在
  1359. /// </summary>
  1360. /// <param name="dlist"></param>
  1361. /// <param name="DigitalNumber"></param>
  1362. /// <returns></returns>
  1363. bool ViceNumberEquals(List<LYFZ.Model.Model_ErpOrderDigital> dlist, int DigitalNumber)
  1364. {
  1365. bool bl = false;
  1366. if (dlist != null)
  1367. {
  1368. int tempMaxNumber = 0;
  1369. foreach (LYFZ.Model.Model_ErpOrderDigital modelDig in dlist)
  1370. {
  1371. string tempViceNumer = modelDig.Ordv_Number + "_" + LYFZ.Command.Command_Validate.GetBeforeAddZero(DigitalNumber, 3);
  1372. if (modelDig.Ordv_ViceNumber.Equals(tempViceNumer))
  1373. {
  1374. bl = true;
  1375. break;
  1376. }
  1377. else
  1378. {
  1379. int tempNu = 0;
  1380. try
  1381. { tempNu = Convert.ToInt32(modelDig.Ordv_ViceNumber.Split('_')[1]); }
  1382. catch
  1383. { tempNu = dlist.Count + modelDig.Ordv_DigitalNumber; }
  1384. if (tempNu > tempMaxNumber)
  1385. { tempMaxNumber = tempNu; }
  1386. }
  1387. }
  1388. if (tempMaxNumber >= DigitalNumber)
  1389. { bl = true; }
  1390. }
  1391. return bl;
  1392. }
  1393. /// <summary>
  1394. /// 打印
  1395. /// </summary>
  1396. /// <param name="sender"></param>
  1397. /// <param name="e"></param>
  1398. void btnPrint_Click(object sender, EventArgs e)
  1399. {
  1400. if (this.StrNumber.Trim() != "")
  1401. {
  1402. Hashtable htData = new Hashtable();
  1403. htData["strNumber"] = this.StrNumber.Trim();
  1404. htData["strOrdType"] = this.OrdType.ToString().Trim();
  1405. // 获取全部景点;
  1406. List<PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null;
  1407. if (this.OrdType == EnumPublic.OrderType.儿童订单)
  1408. {
  1409. listScenicSpot = new List<PrintPreviewSmallForm.ScenicSpot2>();
  1410. for(int i = 0; i < this.OrderStagesEx.listViewData_Stages.Items.Count; i++)
  1411. {
  1412. PrintPreviewSmallForm.ScenicSpot2 scenic = new PrintPreviewSmallForm.ScenicSpot2();
  1413. scenic.strScenicName = this.OrderStagesEx.listViewData_Stages.Items[i].Text;
  1414. scenic.strViceNumber = ((SetCustomControls.SetCustomControls_StagesColumnHeaderModel)this.OrderStagesEx.listViewData_Stages.Items[i].Tag).StagesViceNumber;
  1415. listScenicSpot.Add(scenic);
  1416. }
  1417. }
  1418. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot);
  1419. }
  1420. }
  1421. /// <summary>
  1422. /// 新订单
  1423. /// </summary>
  1424. /// <param name="sender"></param>
  1425. /// <param name="e"></param>
  1426. void btnNewOrder_Click(object sender, EventArgs e)
  1427. {
  1428. if (MessageBoxCustom.Show("重置后将清空所有数据,您确定要重置订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  1429. {
  1430. this.IsGoForm = true;
  1431. this.EnumLoadFormType = LoadFormType.开单选择;
  1432. this.Close();
  1433. }
  1434. }
  1435. /// <summary>
  1436. /// 清空数据重置
  1437. /// </summary>
  1438. void ClearDataReset()
  1439. {
  1440. this.btnSaveIntent.Visible = true;
  1441. this.btnSaveIntent.Enabled = true;
  1442. this.StrNumber = "";
  1443. this.txtOrderPerson.Text = "";
  1444. this.txtOrderPerson.Tag = null;
  1445. this.mskMarriage.Text = "";
  1446. this.chkMarriage.Checked = false;
  1447. this.StyleSetAdd();
  1448. this.ClearClientSource();
  1449. this.mskMarriage.StrValue = "";
  1450. this.chkMarriage.Checked = false;
  1451. this.flowPanel2.Controls.Clear();
  1452. this.tabControl.SelectedIndex = 0;
  1453. this.tabControl.TabPages["tap2"].Tag = null;
  1454. this.lblYiXiangClient.Enabled = true;
  1455. this.IsUpdateOrderLoad = false;
  1456. this.IsSaveedHadAuthorized = false;
  1457. this.FillClientDataPanelHeight();
  1458. this.GetTransactmemberCard();
  1459. OrderEx = null;
  1460. ServiceOrderEx = null;
  1461. OrderProductEx = null;
  1462. OrderServiceEx = null;
  1463. OrderStagesEx = null;
  1464. OrderSightsEx = null;
  1465. }
  1466. /// <summary>
  1467. /// 获取是否自动办理会员卡
  1468. /// </summary>
  1469. void GetTransactmemberCard()
  1470. {
  1471. this.panelTransactmemberCard.Visible = true;
  1472. this.chkTransactmemberCard.Checked = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OrderAutoOpenMemberCard;
  1473. }
  1474. /// <summary>
  1475. /// 关闭
  1476. /// </summary>
  1477. /// <param name="sender"></param>
  1478. /// <param name="e"></param>
  1479. void btnOrderClose_Click(object sender, EventArgs e)
  1480. {
  1481. isClose = false;
  1482. if (!isClose)
  1483. {
  1484. if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1485. { return; }
  1486. }
  1487. this.Close();
  1488. }
  1489. /// <summary>
  1490. /// 关闭窗体之前发生
  1491. /// </summary>
  1492. /// <param name="sender"></param>
  1493. /// <param name="e"></param>
  1494. void OnSingleFormMain_FormClosing(object sender, FormClosingEventArgs e)
  1495. {
  1496. if (!this.IsGoForm)
  1497. {
  1498. if (this.isClose)
  1499. {
  1500. if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1501. { e.Cancel = true; }
  1502. }
  1503. }
  1504. }
  1505. bool IsGoForm = false;
  1506. /// <summary>
  1507. /// 关闭窗体之后发生
  1508. /// </summary>
  1509. /// <param name="sender"></param>
  1510. /// <param name="e"></param>
  1511. void OnSingleFormMain_FormClosed(object sender, FormClosedEventArgs e)
  1512. {
  1513. if (this.IsGoForm)
  1514. {
  1515. this.Hide();
  1516. switch (this.EnumLoadFormType)
  1517. {
  1518. case LoadFormType.开单选择:
  1519. LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFirstFormMain frm = new OnSingleFirstFormMain();
  1520. frm.StartPosition = FormStartPosition.CenterScreen;
  1521. frm.Show();
  1522. break;
  1523. }
  1524. }
  1525. }
  1526. /// <summary>
  1527. /// 窗体大小 发生变化
  1528. /// </summary>
  1529. /// <param name="sender"></param>
  1530. /// <param name="e"></param>
  1531. void OnSingleFormMain_Resize(object sender, EventArgs e)
  1532. {
  1533. this.FillClientDataPanelHeight();
  1534. this.SetButtonPostionData();
  1535. }
  1536. #endregion
  1537. #region 第一页
  1538. #region 添加成年人客户控件
  1539. /// <summary>
  1540. /// 添加客户控件
  1541. /// </summary>
  1542. /// <param name="sender"></param>
  1543. /// <param name="e"></param>
  1544. void pictAddClient_Click(object sender, EventArgs e)
  1545. {
  1546. if (this.OrdType == EnumPublic.OrderType.婚纱订单)
  1547. {
  1548. if (this.AddClinetCount >= 2)
  1549. { MessageBoxCustom.Show("婚纱订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
  1550. this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
  1551. }
  1552. else if (this.OrdType == EnumPublic.OrderType.儿童订单)
  1553. {
  1554. if (this.AddClinetCount >= 5)
  1555. { MessageBoxCustom.Show("儿童订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
  1556. this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsShowRelation: true, lblRelation: "与宝贝关系:", IsPhoneSymbol: false);
  1557. }
  1558. else
  1559. {
  1560. if (this.AddClinetCount >= 5)
  1561. { MessageBoxCustom.Show("写真订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
  1562. this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
  1563. }
  1564. this.AddClinetCount++;
  1565. }
  1566. /// <summary>
  1567. /// 客户成年人资料
  1568. /// </summary>
  1569. /// <param name="lblClentName">层标题名称</param>
  1570. /// <param name="PanelName">层Name</param>
  1571. /// <param name="IsShowRemove">是否显示移除按钮</param>
  1572. /// <param name="IsShowRelation">是否显示关系控件</param>
  1573. /// <param name="lblRelation">关系控件lable的名称</param>
  1574. void ClientAdultPanelAdd(string lblClentName = "", string PanelName = "Adult_", bool IsShowRemove = true, bool IsShowRelation = true, string lblRelation = "与客户关系:", LYFZ.Model.Model_ErpCustomer model = null, string MainClientRelation = "", bool IsPhoneSymbol = true)
  1575. {
  1576. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx Client = new SetCustomControls.OrderClientParentsControlsEx();
  1577. Client.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
  1578. Client.Name = PanelName + ClientAdultNameCount;
  1579. Client.StrClientAttribute = PanelName;
  1580. Client.IsPictDeleteShow = IsShowRemove;
  1581. if (model != null)
  1582. {
  1583. Client.SetClientValue(model, true, MainClientRelation: MainClientRelation);
  1584. Client.IsPictResetShow = true;
  1585. Client.IsPictEditShow = true;
  1586. }
  1587. else
  1588. {
  1589. Client.IsPictEditShow = false;
  1590. Client.IsPictResetShow = false;
  1591. }
  1592. Client.LblClientName = lblClentName;
  1593. Client.IsShowRelation = IsShowRelation;
  1594. Client.LblRelationText = lblRelation;
  1595. Client.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
  1596. Client.IsExistClient += Client_IsExistClient;
  1597. Client.DeleteClick += Client_DeleteClick;
  1598. Client.RelationSet += Client_RelationSet;
  1599. Client.RegionSet += Client_RegionSet;
  1600. Client.PhoneLeave += Client_PhoneLeave;
  1601. Client.UpdateOrderGroup += Client_UpdateOrderGroup;
  1602. Client.isShowPhoneSymbol(IsPhoneSymbol);
  1603. this.flowPanel1.Controls.Add(Client);
  1604. this.ClientAdultNameCount++;
  1605. this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Client.Location.Y + Client.Height + 6);
  1606. if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Client.Height))
  1607. {
  1608. this.panelVice1.Height = this.panelVice1.Height + ((panelAddClient.Location.Y + (panelAddClient.Height * 2) + Client.Height) - this.flowPanel1.Height);
  1609. this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
  1610. }
  1611. this.panelAddClient.SendToBack();
  1612. this.PanelMain1_Click(this, null);
  1613. }
  1614. /// <summary>
  1615. /// 判断当前客户在其他资料是否存在,一个订单不能同时存在两个相同的客户
  1616. /// </summary>
  1617. /// <param name="StrControlsName"></param>
  1618. /// <param name="StrClientNumber"></param>
  1619. /// <returns></returns>
  1620. string Client_IsExistClient(string StrControlsName, string StrClientNumber)
  1621. {
  1622. foreach (Control control in this.flowPanel1.Controls)
  1623. {
  1624. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1625. {
  1626. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1627. if (tmp.Name.Trim() != StrControlsName.Trim())
  1628. {
  1629. if (tmp.modelCilent != null)
  1630. {
  1631. if (tmp.modelCilent.Cus_CustomerNumber.Trim() != "")
  1632. {
  1633. if (tmp.modelCilent.Cus_CustomerNumber.Trim() == StrClientNumber.Trim())
  1634. { return tmp.LblClientName.Trim(); }
  1635. }
  1636. }
  1637. }
  1638. }
  1639. }
  1640. return "";
  1641. }
  1642. /// <summary>
  1643. /// 移除客户控件
  1644. /// </summary>
  1645. void Client_DeleteClick(SetCustomControls.OrderClientParentsControlsEx senderEx)
  1646. {
  1647. if (this.modelOldClient != null)
  1648. {
  1649. if (senderEx.modelCilent != null)
  1650. {
  1651. if (this.modelOldClient.Cus_CustomerNumber == senderEx.modelCilent.Cus_CustomerNumber)
  1652. { this.modelOldClient = null; }
  1653. }
  1654. }
  1655. if ((this.flowPanel1.Height + this.flowPanel1.Location.Y - this.panelAddClient.Height) >= this.PanelMain1.Height)
  1656. {
  1657. this.panelVice1.Height = this.panelVice1.Height - senderEx.Height;
  1658. if (this.PanelMain1.Height > (this.panelVice1.Height + 6))
  1659. { this.panelVice1.Height = this.PanelMain1.Height - 6; }
  1660. this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
  1661. }
  1662. this.AddClinetCount--;
  1663. }
  1664. /// <summary>
  1665. /// 客户关系
  1666. /// </summary>
  1667. /// <param name="obj"></param>
  1668. void Client_RelationSet(object obj)
  1669. {
  1670. foreach (Control control in this.flowPanel1.Controls)
  1671. {
  1672. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1673. {
  1674. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1675. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("BFABDBAJBJCEBDJCJ", tmp.CmbtreevRelation);
  1676. }
  1677. }
  1678. }
  1679. /// <summary>
  1680. /// 客户地区设置
  1681. /// </summary>
  1682. /// <param name="obj"></param>
  1683. void Client_RegionSet(object obj)
  1684. {
  1685. foreach (Control control in this.flowPanel1.Controls)
  1686. {
  1687. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1688. {
  1689. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1690. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("AAAAAAC", tmp.CmbtreevRegion, true);
  1691. }
  1692. }
  1693. }
  1694. /// <summary>
  1695. /// 客户电话输入后离开事件,去检测是否有相同电话的
  1696. /// </summary>
  1697. /// <param name="objForm"></param>
  1698. void Client_PhoneLeave(object objForm)
  1699. {
  1700. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx ClientEx = (SetCustomControls.OrderClientParentsControlsEx)objForm;
  1701. foreach (Control control in this.flowPanel1.Controls)
  1702. {
  1703. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1704. {
  1705. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1706. if (!ClientEx.Equals(tmp))
  1707. {
  1708. if (ClientEx.StrClientPhone.Trim() != "" && tmp.StrClientPhone.Trim() != "")
  1709. {
  1710. if (ClientEx.StrClientPhone.Trim() == tmp.StrClientPhone.Trim())
  1711. { MessageBoxCustom.Show("'" + ClientEx.LblClientName.Trim() + "' 与 '" + tmp.LblClientName.Trim() + "' 的手机号码不能一样!"); ClientEx.StrClientPhone = ""; }
  1712. }
  1713. }
  1714. }
  1715. }
  1716. }
  1717. /// <summary>
  1718. /// 电话输入事件——模糊查询
  1719. /// </summary>
  1720. /// <param name="obj"></param>
  1721. /// <param name="senderEx"></param>
  1722. void Client_UpdateOrderGroup(object obj)
  1723. {
  1724. if (obj != null && obj.ToString().Trim().Length > 0)
  1725. {
  1726. string[] StrArray = obj.ToString().Trim().Split('|');
  1727. switch (StrArray[0].Trim())
  1728. {
  1729. case "ClientGroup":
  1730. if (string.IsNullOrEmpty(StrNumber))
  1731. {
  1732. this.OrderGroupNumber = StrArray[1].Trim();
  1733. }
  1734. break;
  1735. case "OrderNumber":
  1736. this.UpdateOrderIsUpdateClientData = true;
  1737. this.StrNumber = StrArray[1].Trim();
  1738. this.OpenSingleLoad();
  1739. this.UpdateOrderIsUpdateClientData = true;
  1740. break;
  1741. case "IntentClient":
  1742. string[] StrList = StrArray[1].Trim().Split(',');
  1743. this.UpdateOrderIsUpdateClientData = false;
  1744. this.SelectIntentClient(StrList[0].Trim(), StrList[1].Trim());
  1745. this.UpdateOrderIsUpdateClientData = true;
  1746. break;
  1747. }
  1748. }
  1749. }
  1750. #endregion
  1751. #region 添加儿童客户资料
  1752. /// <summary>
  1753. /// 添加儿童客户资料
  1754. /// </summary>
  1755. /// <param name="lbClentName"></param>
  1756. /// <param name="PanelName"></param>
  1757. /// <param name="IsShowRemove"></param>
  1758. void ClientChildPanelAdd(string lbClentName = "宝贝资料", string PanelName = "Child_", bool IsShowRemove = true)
  1759. {
  1760. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientChildrenControlsEx Children = new SetCustomControls.OrderClientChildrenControlsEx();
  1761. Children.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
  1762. Children.Name = PanelName + ClientAdultNameCount;
  1763. Children.StrClientAttribute = PanelName;
  1764. Children.IsPictDeleteShow = IsShowRemove;
  1765. Children.LblClientName = lbClentName;
  1766. Children.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
  1767. Children.DeleteClick += Children_DeleteClick;
  1768. this.flowPanel1.Controls.Add(Children);
  1769. this.ClientChildNameCount++;
  1770. this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Children.Location.Y + Children.Height + 6);
  1771. if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Children.Height))
  1772. { this.panelVice1.Height += Children.Height; }
  1773. this.panelAddClient.SendToBack();
  1774. }
  1775. /// <summary>
  1776. /// 移除客户控件
  1777. /// </summary>
  1778. /// <param name="sender"></param>
  1779. /// <param name="e"></param>
  1780. void Children_DeleteClick(SetCustomControls.OrderClientChildrenControlsEx senderEx)
  1781. {
  1782. if (this.panelVice1.Height >= this.PanelMain1.Height)
  1783. { this.panelVice1.Height = this.panelVice1.Height - senderEx.Height; }
  1784. this.AddClinetCount--;
  1785. }
  1786. #endregion
  1787. #region 开单类型
  1788. /// <summary>
  1789. /// 开单类型选择
  1790. /// </summary>
  1791. /// <param name="sender"></param>
  1792. /// <param name="e"></param>
  1793. void chBox_Click()
  1794. {
  1795. List<SetCustomControls.OrderClientParentsControlsEx> ClistA = new List<SetCustomControls.OrderClientParentsControlsEx>();
  1796. List<SetCustomControls.OrderClientChildrenControlsEx> ClistB = new List<SetCustomControls.OrderClientChildrenControlsEx>();
  1797. foreach (Control control in this.flowPanel1.Controls)
  1798. {
  1799. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1800. {
  1801. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1802. ClistA.Add(tmp);
  1803. }
  1804. if (control is SetCustomControls.OrderClientChildrenControlsEx)
  1805. {
  1806. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  1807. ClistB.Add(tmp);
  1808. }
  1809. }
  1810. for (int i = 0; i < ClistA.Count; i++)
  1811. { this.flowPanel1.Controls.Remove(ClistA[i]); }
  1812. for (int i = 0; i < ClistB.Count; i++)
  1813. { this.flowPanel1.Controls.Remove(ClistB[i]); }
  1814. this.ClientAdultNameCount = 1;
  1815. this.ClientChildNameCount = 1;
  1816. this.AddClinetCount = 0;
  1817. this.AddClinetCount++;
  1818. this.panelMarriage.Visible = false;
  1819. switch (this.OrdType)
  1820. {
  1821. case EnumPublic.OrderType.婚纱订单:
  1822. this.panelHospitalClient.Visible = false;
  1823. this.panelMarriage.Visible = true;
  1824. this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
  1825. break;
  1826. case EnumPublic.OrderType.儿童订单:
  1827. this.AddClinetCount++;
  1828. this.panelHospitalClient.Visible = true;
  1829. this.ClientChildPanelAdd(IsShowRemove: false);
  1830. this.ClientAdultPanelAdd("家长资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: true, lblRelation: "与宝贝关系:");
  1831. break;
  1832. case EnumPublic.OrderType.写真订单:
  1833. this.panelHospitalClient.Visible = true;
  1834. this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
  1835. break;
  1836. case EnumPublic.OrderType.婚庆订单:
  1837. this.panelHospitalClient.Visible = false;
  1838. this.panelMarriage.Visible = true;
  1839. this.panelEx3.Visible = false;
  1840. this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
  1841. break;
  1842. case EnumPublic.OrderType.服务订单:
  1843. this.panelHospitalClient.Visible = true;
  1844. this.panelMarriage.Visible = true;
  1845. this.panelEx3.Visible = false;
  1846. this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
  1847. break;
  1848. }
  1849. if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 || LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版)
  1850. { this.pictAddClient.Visible = true; }
  1851. else
  1852. { this.panelHospitalClient.Visible = false; }
  1853. SetCustomControls.OrderClientParentsControlsEx frmClient = (SetCustomControls.OrderClientParentsControlsEx)flowPanel1.Controls["Man_1"];
  1854. if (this.modelOldClient != null)
  1855. {
  1856. frmClient.SetClientValue(this.modelOldClient, true);
  1857. frmClient.IsPictEditShow = true;
  1858. frmClient.IsPictResetShow = true;
  1859. }
  1860. else
  1861. {
  1862. frmClient.SetClientValue(null);
  1863. frmClient.IsPictEditShow = false;
  1864. frmClient.IsPictResetShow = false;
  1865. }
  1866. //this.CurrentClickCount = Convert.ToInt32(chk.Tag);
  1867. }
  1868. #endregion
  1869. #region 客户来源
  1870. /// <summary>
  1871. /// 客户来源设置
  1872. /// </summary>
  1873. /// <param name="sender"></param>
  1874. /// <param name="e"></param>
  1875. void btnSourceSet_Click(object sender, EventArgs e)
  1876. {
  1877. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  1878. frm.TypeName = "AAAAAAF";
  1879. frm.Version = "Version";
  1880. if (frm.ShowDialog() == DialogResult.OK)
  1881. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT"); }
  1882. }
  1883. /// <summary>
  1884. /// 老客户
  1885. /// </summary>
  1886. /// <param name="sender"></param>
  1887. /// <param name="e"></param>
  1888. void chkOldClient_Click(object sender, EventArgs e)
  1889. {
  1890. if (string.IsNullOrEmpty(this.StrNumber))
  1891. {
  1892. if (!this.chkOldClient.Checked)
  1893. { return; }
  1894. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ClientGroupSelectSuperSmallForm frm = new SuperSmallForm.ClientGroupSelectSuperSmallForm();
  1895. frm.ShowDialog();
  1896. if (frm.IsSaveed)
  1897. {
  1898. #region
  1899. this.chBox_Click();
  1900. if (frm.mlist.Count > 0)
  1901. {
  1902. if (frm.mlist.Count == 1)
  1903. {
  1904. foreach (Control control in this.flowPanel1.Controls)
  1905. {
  1906. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1907. {
  1908. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1909. if (tmp.StrClientAttribute == "Man_")
  1910. {
  1911. tmp.SetClientValue(frm.mlist[0], true);
  1912. tmp.IsPictResetShow = true;
  1913. tmp.IsPictEditShow = true;
  1914. break;
  1915. }
  1916. }
  1917. else if (control is SetCustomControls.OrderClientChildrenControlsEx)
  1918. {
  1919. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  1920. if (frm.mlist[0].Cus_Telephone == "")
  1921. {
  1922. tmp.SetClientValue(frm.mlist[0], true);
  1923. tmp.IsPictResetShow = true;
  1924. tmp.IsPictEditShow = true;
  1925. break;
  1926. }
  1927. }
  1928. }
  1929. }
  1930. else
  1931. {
  1932. foreach (Control control in this.flowPanel1.Controls)
  1933. {
  1934. if (control is SetCustomControls.OrderClientParentsControlsEx)
  1935. {
  1936. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  1937. if (tmp.StrClientAttribute == "Man_")
  1938. {
  1939. for (int i = 0; i < frm.mlist.Count; i++)
  1940. {
  1941. if (frm.mlist[i].Cus_CustomerNumber == frm.htData["MainClientNumber"].ToString().Trim())
  1942. {
  1943. tmp.SetClientValue(frm.mlist[i], true);
  1944. tmp.IsPictResetShow = true;
  1945. tmp.IsPictEditShow = true;
  1946. frm.mlist.RemoveAt(i);
  1947. break;
  1948. }
  1949. }
  1950. }
  1951. else
  1952. {
  1953. for (int i = 0; i < frm.mlist.Count; i++)
  1954. {
  1955. if (frm.mlist[i].Cus_CustomerNumber != frm.htData["MainClientNumber"].ToString().Trim() && frm.mlist[i].Cus_Telephone.Trim() != "")
  1956. {
  1957. tmp.SetClientValue(frm.mlist[i], true);
  1958. tmp.IsPictResetShow = true;
  1959. tmp.IsPictEditShow = true;
  1960. frm.mlist.RemoveAt(i);
  1961. break;
  1962. }
  1963. }
  1964. }
  1965. }
  1966. else if (control is SetCustomControls.OrderClientChildrenControlsEx)
  1967. {
  1968. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  1969. for (int i = 0; i < frm.mlist.Count; i++)
  1970. {
  1971. if (frm.mlist[i].Cus_Telephone == "")
  1972. {
  1973. tmp.SetClientValue(frm.mlist[i], true);
  1974. tmp.IsPictResetShow = true;
  1975. tmp.IsPictEditShow = true;
  1976. frm.mlist.RemoveAt(i);
  1977. break;
  1978. }
  1979. }
  1980. }
  1981. }
  1982. if (frm.mlist.Count > 0)
  1983. {
  1984. for (int i = 0; i < frm.mlist.Count; i++)
  1985. {
  1986. ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: frm.mlist[i]);
  1987. this.AddClinetCount++;
  1988. }
  1989. }
  1990. }
  1991. if (frm.htData["Ord_Number"].ToString().Trim() == "")
  1992. { this.OrderGroupNumber = frm.htData["GP_CustomerGroupID"].ToString().Trim(); }
  1993. }
  1994. #endregion
  1995. }
  1996. this.chkFriends.Enabled = true;
  1997. }
  1998. this.chkOldClient.Checked = true;
  1999. this.chkOther.Checked = false;
  2000. this.chkFriends.Checked = false;
  2001. this.modelViceCard = null;
  2002. this.toolTip1.SetToolTip(this.chkFriends, "");
  2003. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2004. this.cmbtreevClientSource.Text = "";
  2005. this.cmbtreevClientSource.Tag = "";
  2006. this.cmbtreevClientSource.StrGetName = "";
  2007. this.cmbtreevClientSource.Enabled = false;
  2008. this.chkHospitalClient.Checked = false;
  2009. this.modelFriends = null;
  2010. this.ComeSingleLotNumber = "";
  2011. }
  2012. /// <summary>
  2013. /// 朋友介绍
  2014. /// </summary>
  2015. /// <param name="sender"></param>
  2016. /// <param name="e"></param>
  2017. void chkFriends_Click(object sender, EventArgs e)
  2018. {
  2019. if (!this.chkFriends.Checked)
  2020. {
  2021. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2022. return;
  2023. }
  2024. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.FriendIntroducedSuperSmallForm frm = new SuperSmallForm.FriendIntroducedSuperSmallForm();
  2025. frm.ShowDialog();
  2026. this.toolTip1.SetToolTip(this.chkFriends, "");
  2027. this.modelViceCard = null;
  2028. if (frm.IsSaveed)
  2029. {
  2030. this.StrReferralsClientPhone = frm.StrReferralsClientPhone;
  2031. this.StrReferralsMemberCardNumber = frm.StrReferralsMemberCardNumber;
  2032. string StrCardType = "";
  2033. string StrCardTypeShow = "";
  2034. DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + frm.model.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
  2035. if (dt.Rows.Count > 0)
  2036. {
  2037. StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
  2038. if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
  2039. { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
  2040. }
  2041. this.modelFriends = frm.model;
  2042. if (frm.modelVice != null)
  2043. {
  2044. this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + " - 副卡)";
  2045. this.modelViceCard = frm.modelVice;
  2046. this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ";副卡卡号:" + frm.modelVice.Mvc_ViceCardNumber + ")");
  2047. }
  2048. else
  2049. {
  2050. this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + ")";
  2051. this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ")");
  2052. }
  2053. }
  2054. else
  2055. {
  2056. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2057. this.modelFriends = null;
  2058. }
  2059. this.chkFriends.Checked = true;
  2060. this.chkOldClient.Checked = false;
  2061. this.chkOldClient.Enabled = true;
  2062. this.cmbtreevClientSource.Text = "";
  2063. this.cmbtreevClientSource.Tag = "";
  2064. this.cmbtreevClientSource.StrGetName = "";
  2065. this.ComeSingleLotNumber = "";
  2066. this.chkOther.Checked = false;
  2067. this.chkHospitalClient.Checked = false;
  2068. this.cmbtreevClientSource.Enabled = false;
  2069. }
  2070. /// <summary>
  2071. /// 医院跟踪客户
  2072. /// </summary>
  2073. /// <param name="sender"></param>
  2074. /// <param name="e"></param>
  2075. void chkHospitalClient_Click(object sender, EventArgs e)
  2076. {
  2077. if (!this.chkHospitalClient.Checked)
  2078. { return; }
  2079. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.SelectHospitalClientSuperSmallForm frm = new SuperSmallForm.SelectHospitalClientSuperSmallForm();
  2080. frm.ShowDialog();
  2081. if (frm.IsSaveed)
  2082. {
  2083. this.chBox_Click();
  2084. LYFZ.Model.Model_ErpHospitalClient model = frm.model;
  2085. this.ComeSingleLotNumber = model.Hct_Oddnumber;
  2086. foreach (Control control in this.flowPanel1.Controls)
  2087. {
  2088. if (control is SetCustomControls.OrderClientParentsControlsEx)
  2089. {
  2090. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  2091. if (tmp.StrClientAttribute == "Man_")
  2092. {
  2093. tmp.setHospitalClientValue(model);
  2094. tmp.IsPictResetShow = true;
  2095. tmp.IsPictEditShow = true;
  2096. }
  2097. }
  2098. else if (control is SetCustomControls.OrderClientChildrenControlsEx)
  2099. {
  2100. if (this.OrdType == EnumPublic.OrderType.儿童订单)
  2101. {
  2102. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  2103. tmp.setHospitalClientValue(model);
  2104. tmp.IsPictResetShow = true;
  2105. tmp.IsPictEditShow = true;
  2106. }
  2107. }
  2108. }
  2109. }
  2110. this.chkOldClient.Checked = false;
  2111. this.chkOldClient.Enabled = true;
  2112. this.cmbtreevClientSource.Text = "";
  2113. this.cmbtreevClientSource.Tag = "";
  2114. this.cmbtreevClientSource.StrGetName = "";
  2115. this.cmbtreevClientSource.Enabled = false;
  2116. this.chkOther.Checked = false;
  2117. this.chkFriends.Checked = false;
  2118. this.modelViceCard = null;
  2119. this.toolTip1.SetToolTip(this.chkFriends, "");
  2120. this.modelFriends = null;
  2121. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2122. }
  2123. /// <summary>
  2124. /// 其他
  2125. /// </summary>
  2126. /// <param name="sender"></param>
  2127. /// <param name="e"></param>
  2128. void chkOther_Click(object sender, EventArgs e)
  2129. {
  2130. if (this.chkOther.Checked)
  2131. {
  2132. this.chkOther.Checked = true;
  2133. this.cmbtreevClientSource.Enabled = true;
  2134. }
  2135. else
  2136. {
  2137. this.chkOther.Checked = false;
  2138. this.cmbtreevClientSource.Text = "";
  2139. this.cmbtreevClientSource.Tag = "";
  2140. this.cmbtreevClientSource.StrGetName = "";
  2141. this.cmbtreevClientSource.Enabled = false;
  2142. }
  2143. this.modelFriends = null;
  2144. this.chkFriends.Checked = false;
  2145. this.modelViceCard = null;
  2146. this.toolTip1.SetToolTip(this.chkFriends, "");
  2147. this.chkOldClient.Checked = false;
  2148. this.chkHospitalClient.Checked = false;
  2149. this.chkFriends.Enabled = true;
  2150. this.chkOldClient.Enabled = true;
  2151. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2152. this.ComeSingleLotNumber = "";
  2153. }
  2154. /// <summary>
  2155. /// 意向客户点击选择
  2156. /// </summary>
  2157. /// <param name="sender"></param>
  2158. /// <param name="e"></param>
  2159. void lblYiXiangClient_Click(object sender, EventArgs e)
  2160. {
  2161. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderSelectSuperSmallForm frm = new SuperSmallForm.OrderSelectSuperSmallForm();
  2162. frm.Text = "选择订单(双击选择)";
  2163. frm.ShowDialog();
  2164. if (frm.IsSaveed)
  2165. {
  2166. this.chkFriends.Checked = false;
  2167. this.chkOldClient.Checked = false;
  2168. this.chkFriends.Enabled = true;
  2169. this.chkOldClient.Enabled = true;
  2170. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2171. this.ComeSingleLotNumber = "";
  2172. this.modelOldClient = null;
  2173. this.SelectIntentClient(frm.SelectOrderNumber, frm.SelectClientGroupNumber);
  2174. }
  2175. }
  2176. /// <summary>
  2177. /// 选择意向订单或意向客户组
  2178. /// </summary>
  2179. /// <param name="SelectOrderNumber"></param>
  2180. /// <param name="SelectClientGroupNumber"></param>
  2181. void SelectIntentClient(string SelectOrderNumber, string SelectClientGroupNumber)
  2182. {
  2183. if (this.IsUpdateOrderLoad)
  2184. { return; }
  2185. if (!string.IsNullOrEmpty(SelectOrderNumber))
  2186. {
  2187. this.StrNumber = SelectOrderNumber;
  2188. this.OrderGroupNumber = SelectClientGroupNumber;
  2189. this.OpenSingleLoad();
  2190. }
  2191. else
  2192. {
  2193. DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_CustomerGroupID = '" + SelectClientGroupNumber + "'", ShowColumnName: "GP_CustomerType").Tables[0];
  2194. this.OrdType = (LYFZ.EnumPublic.OrderType)Convert.ToInt32(tblGroup.Rows[0]["GP_CustomerType"]);
  2195. this.Text = "开单(" + this.OrdType.ToString() + ")";
  2196. this.ClearDataReset();
  2197. this.OrderGroupNumber = SelectClientGroupNumber;
  2198. DataTable tbl = orbll.GetView_Custom("tb_ErpCustomerGroupMembers", StrWhere: "GM_CustomerGroupID = '" + this.OrderGroupNumber + "'", ShowColumnName: "GM_CustomerID,GM_Master,GM_ProtagonistCustomer,GM_RelatedPersonID").Tables[0];
  2199. if (tbl.Rows.Count > 0)
  2200. {
  2201. List<SetCustomControls.OrderClientParentsControlsEx> AdultList = new List<SetCustomControls.OrderClientParentsControlsEx>();
  2202. List<SetCustomControls.OrderClientChildrenControlsEx> ChildList = new List<SetCustomControls.OrderClientChildrenControlsEx>();
  2203. foreach (Control control in this.flowPanel1.Controls)
  2204. {
  2205. if (control is SetCustomControls.OrderClientParentsControlsEx)
  2206. {
  2207. SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
  2208. bool Isbl = true;
  2209. if (tbl.Rows.Count > 0)
  2210. {
  2211. if (tmp.StrClientAttribute == "Man_")
  2212. {
  2213. for (int i = 0; i < tbl.Rows.Count; i++)
  2214. {
  2215. if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "1")
  2216. {
  2217. tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
  2218. tmp.IsPictResetShow = true;
  2219. tmp.IsPictEditShow = true;
  2220. Isbl = false;
  2221. tbl.Rows.RemoveAt(i);
  2222. break;
  2223. }
  2224. }
  2225. }
  2226. else
  2227. {
  2228. for (int i = 0; i < tbl.Rows.Count; i++)
  2229. {
  2230. if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && !tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
  2231. {
  2232. tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
  2233. tmp.IsPictResetShow = true;
  2234. tmp.IsPictEditShow = true;
  2235. Isbl = false;
  2236. tbl.Rows.RemoveAt(i);
  2237. break;
  2238. }
  2239. }
  2240. }
  2241. }
  2242. if (Isbl)
  2243. { AdultList.Add(tmp); }
  2244. }
  2245. else if (control is SetCustomControls.OrderClientChildrenControlsEx)
  2246. {
  2247. SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
  2248. bool Isbl = true;
  2249. if (tbl.Rows.Count > 0)
  2250. {
  2251. for (int i = 0; i < tbl.Rows.Count; i++)
  2252. {
  2253. if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
  2254. {
  2255. tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
  2256. tmp.IsPictResetShow = true;
  2257. tmp.IsPictEditShow = true;
  2258. Isbl = false;
  2259. tbl.Rows.RemoveAt(i);
  2260. break;
  2261. }
  2262. }
  2263. }
  2264. if (Isbl)
  2265. { ChildList.Add(tmp); }
  2266. }
  2267. }
  2268. //移除多余的客户组件
  2269. for (int i = 0; i < AdultList.Count; i++)
  2270. { this.flowPanel1.Controls.Remove(AdultList[i]); }
  2271. if (this.OrdType != EnumPublic.OrderType.儿童订单)
  2272. {
  2273. for (int i = 0; i < ChildList.Count; i++)
  2274. { this.flowPanel1.Controls.Remove(ChildList[i]); }
  2275. }
  2276. else if(this.OrdType == EnumPublic.OrderType.儿童订单)
  2277. {
  2278. if (ChildList.Count>0)
  2279. {
  2280. if(this.flowPanel1.Controls.IndexOf(ChildList[0])==-1)
  2281. {
  2282. this.flowPanel1.Controls.Add(ChildList[0]);
  2283. }
  2284. }
  2285. else
  2286. {
  2287. List<Control> controlLists = new List<Control>();
  2288. foreach (Control control in this.flowPanel1.Controls)
  2289. {
  2290. controlLists.Add(control);
  2291. }
  2292. this.flowPanel1.Controls.Clear();
  2293. SetCustomControls.OrderClientChildrenControlsEx children = new SetCustomControls.OrderClientChildrenControlsEx();
  2294. children.LblClientName = "宝宝资料";
  2295. children.IsPictDeleteShow = false;
  2296. this.flowPanel1.Controls.Add(children);
  2297. foreach(Control control in controlLists)
  2298. {
  2299. this.flowPanel1.Controls.Add(control);
  2300. }
  2301. }
  2302. }
  2303. }
  2304. }
  2305. }
  2306. /// <summary>
  2307. /// 清空客户来源
  2308. /// </summary>
  2309. void ClearClientSource()
  2310. {
  2311. this.chkOldClient.Checked = false;
  2312. this.chkFriends.Checked = false;
  2313. this.chkFriends.Text = this.chkFriends.Tag.ToString();
  2314. this.chkOther.Checked = false;
  2315. this.cmbtreevClientSource.SetTextAndTag_ValueNull();
  2316. this.modelOldClient = null;
  2317. this.modelFriends = null;
  2318. this.OrderGroupNumber = "";
  2319. this.ComeSingleLotNumber = "";
  2320. }
  2321. /// <summary>
  2322. /// 获取客户来源
  2323. /// </summary>
  2324. /// <returns></returns>
  2325. private string GetClientSource()
  2326. {
  2327. string StrClientSource = "";
  2328. foreach (Control control in this.flowPanelClientSource.Controls)
  2329. {
  2330. foreach (Control control2 in control.Controls)
  2331. {
  2332. if (control2 is CheckBoxEx)
  2333. {
  2334. CheckBoxEx tmp = (CheckBoxEx)control2;
  2335. if (tmp.Checked)
  2336. {
  2337. if (tmp.Tag.ToString().Trim() == "其他")
  2338. { StrClientSource = this.cmbtreevClientSource.Text.Trim(); }
  2339. else
  2340. { StrClientSource = tmp.Tag.ToString().Trim(); }
  2341. }
  2342. }
  2343. }
  2344. }
  2345. return StrClientSource;
  2346. }
  2347. #endregion
  2348. #region 喜爱格调
  2349. /// <summary>
  2350. /// 喜爱格调设置
  2351. /// </summary>
  2352. /// <param name="sender"></param>
  2353. /// <param name="e"></param>
  2354. void btnStyleSet_Click(object sender, EventArgs e)
  2355. {
  2356. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleSetSmallForm frm = new SetSmallForm.StyleSetSmallForm();
  2357. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2358. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2359. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2360. frm.ShowDialog();
  2361. if (frm.IsSaveed)
  2362. { this.StyleSetAdd(); }
  2363. }
  2364. /// <summary>
  2365. /// 添加Check控件
  2366. /// </summary>
  2367. private void StyleSetAdd()
  2368. {
  2369. List<CheckBoxEx> chklist = new List<CheckBoxEx>();
  2370. foreach (Control control in this.panelEx3.Controls)
  2371. {
  2372. if (control is CheckBoxEx)
  2373. {
  2374. CheckBoxEx tmp = (CheckBoxEx)control;
  2375. chklist.Add(tmp);
  2376. }
  2377. }
  2378. for (int i = 0; i < chklist.Count; i++)
  2379. { this.panelEx3.Controls.Remove(chklist[i]); }
  2380. DataTable tbl = stbll.GetAllList(" ID ASC").Tables[0];
  2381. if (tbl.Rows.Count > 0)
  2382. {
  2383. int StrTablIndex = 11;
  2384. int LocationY = this.lblStyle.Location.Y + this.lblStyle.Height + 11;
  2385. CheckBoxEx chBox = null;
  2386. int[] Str1 = { 0, 5, 10, 15 };
  2387. int[] Str2 = { 1, 6, 11, 16 };
  2388. int[] Str3 = { 2, 7, 12, 17 };
  2389. int[] Str4 = { 3, 8, 13, 18 };
  2390. int[] Str5 = { 4, 9, 14, 19 };
  2391. for (int i = 0; i < tbl.Rows.Count; i++)
  2392. {
  2393. chBox = new CheckBoxEx();
  2394. if (Array.IndexOf(Str1, i) != -1)
  2395. { chBox.Location = new Point(20, LocationY); }
  2396. else if (Array.IndexOf(Str2, i) != -1)
  2397. { chBox.Location = new Point(180, LocationY); }
  2398. else if (Array.IndexOf(Str3, i) != -1)
  2399. { chBox.Location = new Point(340, LocationY); }
  2400. else if (Array.IndexOf(Str4, i) != -1)
  2401. { chBox.Location = new Point(500, LocationY); }
  2402. else if (Array.IndexOf(Str5, i) != -1)
  2403. { chBox.Location = new Point(670, LocationY); LocationY += 25; }
  2404. chBox.Name = "chk_" + tbl.Rows[i]["ID"].ToString();
  2405. chBox.Tag= tbl.Rows[i]["ID"].ToString();
  2406. chBox.Text = tbl.Rows[i]["Style_Name"].ToString();
  2407. chBox.TabIndex = StrTablIndex;
  2408. StrTablIndex++;
  2409. this.panelEx3.Controls.Add(chBox);
  2410. }
  2411. }
  2412. }
  2413. /// <summary>
  2414. /// 获取喜爱格调
  2415. /// </summary>
  2416. /// <returns></returns>
  2417. private string GetStyle()
  2418. {
  2419. String strStyle = "";
  2420. foreach (Control control in this.panelEx3.Controls)//订单资料
  2421. {
  2422. if (control is CheckBoxEx)
  2423. {
  2424. CheckBoxEx tmp = (CheckBoxEx)control;
  2425. if (tmp.Checked)
  2426. { strStyle += tmp.Name.Trim() + "|"; }
  2427. }
  2428. }
  2429. return strStyle.TrimEnd('|');
  2430. }
  2431. /// <summary>
  2432. /// 获取喜爱格调
  2433. /// </summary>
  2434. /// <returns></returns>
  2435. private List<string> GetStyleList()
  2436. {
  2437. List<string> ListID = new List<string>();
  2438. foreach (Control control in this.panelEx3.Controls)//订单资料
  2439. {
  2440. if (control is CheckBoxEx)
  2441. {
  2442. CheckBoxEx tmp = (CheckBoxEx)control;
  2443. if (tmp.Checked)
  2444. {
  2445. string[] strArray = tmp.Name.Trim().Split('_');
  2446. ListID.Add(strArray[1].Trim());
  2447. }
  2448. }
  2449. }
  2450. return ListID;
  2451. }
  2452. /// <summary>
  2453. /// 喜爱风格—浏览选择
  2454. /// </summary>
  2455. /// <param name="sender"></param>
  2456. /// <param name="e"></param>
  2457. void lblBrowseSelect_Click(object sender, EventArgs e)
  2458. {
  2459. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
  2460. frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.风格浏览;
  2461. frm.OldSelectStyleList = GetStyleList();
  2462. frm.WindowState = FormWindowState.Maximized;
  2463. frm.ShowDialog();
  2464. if (frm.IsSaveed)
  2465. {
  2466. List<string> strList = frm.SelectStyleList;
  2467. foreach (Control control in this.panelEx3.Controls)//订单资料
  2468. {
  2469. if (control is CheckBoxEx)
  2470. {
  2471. CheckBoxEx tmp = (CheckBoxEx)control;
  2472. bool IsFind = false;
  2473. for (int i = 0; i < strList.Count; i++)
  2474. {
  2475. // string[] strArray = tmp.Name.Trim().Split('_');
  2476. //if (strArray[1].Trim() == strList[i].Trim())
  2477. if ( tmp.Text.ToLower().Trim() == strList[i].ToLower().Trim() )
  2478. {
  2479. IsFind = true;
  2480. tmp.Checked = true;
  2481. strList.RemoveAt(i);
  2482. break;
  2483. }
  2484. }
  2485. if (!IsFind)
  2486. { tmp.Checked = false; }
  2487. }
  2488. }
  2489. }
  2490. }
  2491. #endregion
  2492. #region 选择接单人员
  2493. /// <summary>
  2494. /// 选择接单人员
  2495. /// </summary>
  2496. /// <param name="sender"></param>
  2497. /// <param name="e"></param>
  2498. void btnSelectUser_Click(object sender, EventArgs e)
  2499. {
  2500. strPersonData = new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses().txtOrdersPerson(this.txtOrderPerson, this.strPersonData);
  2501. }
  2502. #endregion
  2503. #region 点击让滚动条获取焦点
  2504. /// <summary>
  2505. /// 点击让滚动条获取焦点
  2506. /// </summary>
  2507. /// <param name="sender"></param>
  2508. /// <param name="e"></param>
  2509. void panelEx3_Click(object sender, EventArgs e)
  2510. {
  2511. this.PanelMain1_Click(this, null);
  2512. }
  2513. /// <summary>
  2514. /// 点击让滚动条获取焦点
  2515. /// </summary>
  2516. /// <param name="sender"></param>
  2517. /// <param name="e"></param>
  2518. void panelEx2_Click(object sender, EventArgs e)
  2519. {
  2520. this.PanelMain1_Click(this, null);
  2521. }
  2522. /// <summary>
  2523. /// 点击让滚动条获取焦点
  2524. /// </summary>
  2525. /// <param name="sender"></param>
  2526. /// <param name="e"></param>
  2527. void panelVice1_Click(object sender, EventArgs e)
  2528. {
  2529. this.PanelMain1_Click(this, null);
  2530. }
  2531. /// <summary>
  2532. /// 点击让滚动条获取焦点
  2533. /// </summary>
  2534. /// <param name="sender"></param>
  2535. /// <param name="e"></param>
  2536. void PanelMain1_Click(object sender, EventArgs e)
  2537. {
  2538. this.PanelMain1.Focus();
  2539. }
  2540. #endregion
  2541. #endregion
  2542. #region 第二页
  2543. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoOneControlsEx OrderEx = null;
  2544. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoTwoControlsEx ServiceOrderEx = null;
  2545. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProductControlsEx OrderProductEx = null;
  2546. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderServiceControlsEx OrderServiceEx = null;
  2547. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderStagesControlsEx OrderStagesEx = null;
  2548. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderSightsControlsEx OrderSightsEx = null;
  2549. LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx OrderProcessesEx = null;
  2550. /// <summary>
  2551. /// 选项卡选择事件
  2552. /// </summary>
  2553. /// <param name="sender"></param>
  2554. /// <param name="e"></param>
  2555. void tabControl_SelectedIndexChanged(object sender, EventArgs e)
  2556. {
  2557. if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap2"].Name.Trim())
  2558. {
  2559. if (this.tabControl.TabPages["tap2"].Tag == null)
  2560. {
  2561. int PanelVice2Height = 0;
  2562. Hashtable htData = new Hashtable();
  2563. htData["IsShowSinceOrderNumber"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsCustomOrderNumber();
  2564. htData["IsOrderNumber"] = "";
  2565. htData["StrPrefix"] = this.GetOrderCustomPrefix();
  2566. htData["StrOrderType"] = this.OrdType.ToString().Trim();
  2567. switch (this.OrdType)
  2568. {
  2569. case EnumPublic.OrderType.服务订单:
  2570. if (this.ServiceOrderEx == null)
  2571. {
  2572. this.ServiceOrderEx = new SetCustomControls.OrderInfoTwoControlsEx(htData);
  2573. this.flowPanel2.Controls.Add(this.ServiceOrderEx);
  2574. }
  2575. PanelVice2Height += this.ServiceOrderEx.Height;
  2576. break;
  2577. default:
  2578. if (this.OrderEx == null)
  2579. {
  2580. this.OrderEx = new SetCustomControls.OrderInfoOneControlsEx(htData);
  2581. this.OrderEx.SeriesUpgradeEvent += OrderEx_SeriesUpgradeEvent;
  2582. switch (this.OrdType)
  2583. {
  2584. case EnumPublic.OrderType.婚庆订单:
  2585. this.OrderEx.IsHotelInfo = true;
  2586. break;
  2587. case EnumPublic.OrderType.儿童订单:
  2588. this.OrderEx.IsShowIntoRegisterAndIntoBottom = false;
  2589. break;
  2590. }
  2591. this.OrderEx.OrderTaoXiNodeMouseClick += OrderEx_OrderTaoXiNodeMouseClick;
  2592. this.flowPanel2.Controls.Add(this.OrderEx);
  2593. #region 权限
  2594. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderPackagesNameSet))
  2595. { this.OrderEx.IsShowTaoXiNameSet = false; }
  2596. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClsssSet))
  2597. { this.OrderEx.IsOrderClsssSet = false; }
  2598. #endregion
  2599. }
  2600. PanelVice2Height += this.OrderEx.Height;
  2601. break;
  2602. }
  2603. switch (this.OrdType)
  2604. {
  2605. case EnumPublic.OrderType.婚纱订单:
  2606. case EnumPublic.OrderType.写真订单:
  2607. if (this.OrderSightsEx == null)
  2608. {
  2609. this.OrderSightsEx = new SetCustomControls.OrderSightsControlsEx();
  2610. this.flowPanel2.Controls.Add(this.OrderSightsEx);
  2611. #region 权限
  2612. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
  2613. { this.OrderSightsEx.IsShowSightsSet = false; }
  2614. #endregion
  2615. }
  2616. this.OrderSightsEx.StrOrdNumber = this.StrNumber;
  2617. PanelVice2Height += this.OrderSightsEx.Height;
  2618. break;
  2619. case EnumPublic.OrderType.儿童订单:
  2620. if (this.OrderStagesEx == null)
  2621. {
  2622. this.OrderStagesEx = new SetCustomControls.OrderStagesControlsEx();
  2623. this.flowPanel2.Controls.Add(this.OrderStagesEx);
  2624. #region 权限
  2625. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
  2626. { this.OrderStagesEx.IsShowStagesSet = false; }
  2627. #endregion
  2628. }
  2629. this.OrderStagesEx.StrOrdNumber = this.StrNumber;
  2630. PanelVice2Height += this.OrderStagesEx.Height;
  2631. break;
  2632. }
  2633. switch (this.OrdType)
  2634. {
  2635. case EnumPublic.OrderType.婚纱订单:
  2636. case EnumPublic.OrderType.儿童订单:
  2637. case EnumPublic.OrderType.婚庆订单:
  2638. case EnumPublic.OrderType.写真订单:
  2639. case EnumPublic.OrderType.服务订单:
  2640. if (this.OrderProductEx == null)
  2641. {
  2642. this.OrderProductEx = new SetCustomControls.OrderProductControlsEx();
  2643. this.OrderProductEx.bSelectFilm = _bSelectFilm;
  2644. this.OrderProductEx.OrdType = this.OrdType;
  2645. this.flowPanel2.Controls.Add(this.OrderProductEx);
  2646. if (this.OrderStagesEx != null)
  2647. { this.OrderStagesEx.OrderProductEx = this.OrderProductEx; }
  2648. }
  2649. this.OrderProductEx.StrNumber = this.StrNumber;
  2650. PanelVice2Height += this.OrderProductEx.Height;
  2651. break;
  2652. }
  2653. if (this.OrderServiceEx == null)
  2654. {
  2655. this.OrderServiceEx = new SetCustomControls.OrderServiceControlsEx();
  2656. this.OrderServiceEx.OrdType = this.OrdType;
  2657. this.flowPanel2.Controls.Add(this.OrderServiceEx);
  2658. if (this.OrderStagesEx != null)
  2659. { this.OrderStagesEx.OrderServiceEx = this.OrderServiceEx; }
  2660. }
  2661. PanelVice2Height += this.OrderServiceEx.Height;
  2662. this.panelVice2.Height = PanelVice2Height + 40;
  2663. }
  2664. this.PanelClick(this.panelVice2, 2);
  2665. this.PanelMain2_Click(this, null);
  2666. }
  2667. else
  2668. {
  2669. if (this.tap3.Parent != null)
  2670. {
  2671. if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap3"].Name.Trim())
  2672. {
  2673. if (this.OrderProcessesEx == null)
  2674. {
  2675. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  2676. {
  2677. try
  2678. {
  2679. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  2680. {
  2681. this.OrderProcessesEx = new SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx(this.StrNumber, Convert.ToInt32(this.OrdType).ToString());
  2682. //this.OrderProcessesEx.Dock = DockStyle.Fill;
  2683. this.panelVice3.Controls.Add(this.OrderProcessesEx);
  2684. if (this.panelVice3.Height < this.OrderProcessesEx.Height)
  2685. { this.panelVice3.Height = this.OrderProcessesEx.Height; }
  2686. //else
  2687. //{ this.panelVice3.Height = this.PanelMain3.Height; }
  2688. this.PanelClick(this.panelVice3, 3);
  2689. this.PanelMain3_Click(this, null);
  2690. }));
  2691. }
  2692. catch
  2693. { }
  2694. });
  2695. }
  2696. }
  2697. }
  2698. }
  2699. }
  2700. /// <summary>
  2701. /// 升级套系事件
  2702. /// </summary>
  2703. void OrderEx_SeriesUpgradeEvent()
  2704. {
  2705. if (string.IsNullOrEmpty(strOldTaoXiName))
  2706. {
  2707. this.strOldTaoXiName = this.OrderEx.cmbtreevTaoXiName.Text;
  2708. this.strOldTaoXiCode = this.OrderEx.cmbtreevTaoXiName.Tag.ToString();
  2709. this.strOldTaoXiPrice = decimal.Parse(this.OrderEx.txtTaoXiPrice.Text);
  2710. }
  2711. //throw new NotImplementedException();
  2712. if (this.OrderProductEx != null)
  2713. {
  2714. this.OrderProductEx.DeleteSightByNotAction();
  2715. }
  2716. if (OrderServiceEx!=null)
  2717. {
  2718. OrderServiceEx.DeleteSightByNotAction();
  2719. }
  2720. if(this.OrderSightsEx!=null)
  2721. {
  2722. this.OrderSightsEx.DeleteSightByNotAction();
  2723. }
  2724. else if (this.OrderStagesEx != null)
  2725. {
  2726. this.OrderStagesEx.DeleteSightByNotAction();
  2727. }
  2728. }
  2729. /// <summary>
  2730. ///
  2731. /// </summary>
  2732. /// <param name="Panelcontrol"></param>
  2733. void PanelClick(Control Panelcontrol, int LoadType)
  2734. {
  2735. if (Panelcontrol.Controls.Count > 0)
  2736. {
  2737. foreach (Control control in Panelcontrol.Controls)
  2738. {
  2739. if (control is LYFZ.ComponentLibrary.PanelEx || control is UserControl || control is FlowLayoutPanel)
  2740. {
  2741. if (LoadType == 2)
  2742. { control.Click += PanelMain2_Click; }
  2743. else if (LoadType == 3)
  2744. { control.Click += PanelMain3_Click; }
  2745. if (control.Controls.Count > 0)
  2746. {
  2747. this.PanelClick(control, LoadType);
  2748. }
  2749. }
  2750. }
  2751. }
  2752. }
  2753. /// <summary>
  2754. /// 点击让滚动条获取焦点
  2755. /// </summary>
  2756. /// <param name="sender"></param>
  2757. /// <param name="e"></param>
  2758. void PanelMain2_Click(object sender, EventArgs e)
  2759. { this.PanelMain2.Focus(); }
  2760. /// <summary>
  2761. /// 点击让滚动条获取焦点
  2762. /// </summary>
  2763. /// <param name="sender"></param>
  2764. /// <param name="e"></param>
  2765. void PanelMain3_Click(object sender, EventArgs e)
  2766. {
  2767. this.PanelMain3.Focus();
  2768. }
  2769. /// <summary>
  2770. /// 套系选择
  2771. /// </summary>
  2772. /// <param name="objTaoXiNameTag">套系编号</param>
  2773. /// <param name="IsActivity">是否可以操作</param>
  2774. /// <param name="PackagesType">类型,判断是礼包还是套系</param>
  2775. /// <param name="dtPackages">礼包几选几数据</param>
  2776. void OrderEx_OrderTaoXiNodeMouseClick(object objTaoXiNameTag, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType, Hashtable htData)
  2777. {
  2778. if (objTaoXiNameTag != null)
  2779. {
  2780. string StrWhere = " And Pgm_PackagesCode = '" + objTaoXiNameTag.ToString().Trim() + "'";
  2781. if (htData.ContainsKey("OptionalSeveral") && htData["OptionalSeveral"].ToString().Trim().Length > 0 && Convert.ToInt32(htData["OptionalSeveral"]) >= 0)
  2782. {
  2783. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxPackageListViewSamllForm frm = new SetSmallForm.ToolboxPackageListViewSamllForm();
  2784. frm.intOptionalSeveral = Convert.ToInt32(htData["OptionalSeveral"]);
  2785. frm.StrPackageCode = objTaoXiNameTag.ToString().Trim();
  2786. frm.StrOrderType = this.OrdType;
  2787. frm.ShowDialog();
  2788. if (frm.IsSaveed)
  2789. {
  2790. List<int> listID = frm.listID;
  2791. string StrIDing = "";
  2792. for (int i = 0; i < listID.Count; i++)
  2793. { StrIDing += listID[i].ToString().Trim() + ","; }
  2794. if (!string.IsNullOrEmpty(StrIDing))
  2795. { StrWhere = " And tb_ErpPackagesGiftMerchandise.ID in (" + StrIDing.TrimEnd(',') + ")"; }
  2796. }
  2797. else
  2798. { OrderEx.RemovePackageItem(); return; }
  2799. }
  2800. string strMagess = "";
  2801. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  2802. {
  2803. if (!string.IsNullOrEmpty(objTaoXiNameTag.ToString().Trim()))
  2804. {
  2805. string StrSource = "'' AS TaoXiNameSource,";
  2806. if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
  2807. { StrSource = "'礼包' AS TaoXiNameSource,"; }
  2808. string ExecuteSql = "select tb_ErpTheScenery.ID," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Tsc_Rating,Sc_ClassName,Tcs_Category,case when Tcs_Category = 0 then '内景' else '外景' end AS Tcs_CategoryText,Tsc_CostPrice,Tsc_SalesPrice,Tsc_Remark,Pgm_ProductName,Pgm_GiveType," +
  2809. "Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
  2810. "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') " + StrWhere + ";";
  2811. ExecuteSql += "select Prod_Number," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Pgm_ProductNumber,Prod_Name,Prod_Batch,Prod_CostPrice,Prod_SalesPrice,Prod_Class,Prod_Unit,Prod_Thumbnail,Pgm_ProductNumber,Pgm_ProductName,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_GiveType," +
  2812. "Pgm_Quantity,Pgm_GiveType,Pgm_ProductGroupName from tb_ErpPackagesGiftMerchandise Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') " + StrWhere + ";";
  2813. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  2814. DataTable dtSights = dsData.Tables["ds"];
  2815. DataTable dtProduct = dsData.Tables["ds1"];
  2816. try
  2817. {
  2818. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  2819. {
  2820. if (this.OrderSightsEx != null)
  2821. {
  2822. DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '2'");
  2823. if (this.OrderSightsEx.bUpgrade)
  2824. {
  2825. this.OrderSightsEx.DeleteSightByNotAction();
  2826. }
  2827. strMagess += this.OrderSightsEx.SetOrderSightsValue(dtRow, IsActivity, PackagesType);
  2828. }
  2829. if (this.OrderStagesEx != null)
  2830. {
  2831. DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '3'");
  2832. if (this.OrderStagesEx.bUpgrade)
  2833. {
  2834. this.OrderStagesEx.DeleteSightByNotAction();
  2835. }
  2836. strMagess += this.OrderStagesEx.SetOrderStagesValue(dtRow, IsActivity, PackagesType);
  2837. }
  2838. if (this.OrderServiceEx != null)
  2839. {
  2840. DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '1'");
  2841. strMagess += this.OrderServiceEx.SetOrderServiceValue(dtRow, IsActivity, PackagesType);
  2842. }
  2843. if (this.OrderProductEx != null)
  2844. {
  2845. DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '0'");
  2846. strMagess += this.OrderProductEx.SetOrderProductValue(dtRow, IsActivity, PackagesType);
  2847. }
  2848. }));
  2849. }
  2850. catch { }
  2851. }
  2852. else if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
  2853. {
  2854. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  2855. {
  2856. if (this.OrderSightsEx != null)
  2857. {
  2858. try
  2859. { this.OrderSightsEx.RemovePackageItem(); }
  2860. catch { }
  2861. }
  2862. if (this.OrderStagesEx != null)
  2863. {
  2864. try
  2865. { this.OrderStagesEx.RemovePackageItem(); }
  2866. catch { }
  2867. }
  2868. if (this.OrderServiceEx != null)
  2869. {
  2870. try
  2871. { this.OrderServiceEx.RemovePackageItem(); }
  2872. catch { }
  2873. }
  2874. if (this.OrderProductEx != null)
  2875. {
  2876. try
  2877. { this.OrderProductEx.RemovePackageItem(); }
  2878. catch { }
  2879. }
  2880. }));
  2881. }
  2882. });
  2883. if (strMagess.Trim() != "")
  2884. { MessageBoxCustom.Show(strMagess); }
  2885. }
  2886. }
  2887. #endregion
  2888. }
  2889. }