IntentionsEntered.cs 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using System.IO;
  11. using LYFZ.ComponentLibrary;
  12. using LYFZ.Helper;
  13. namespace LYFZ.Software.MainBusiness.HospitalTrackingSystem
  14. {
  15. public partial class IntentionsEntered : LYFZ.Software.UI.HospitalTrackingSystem.IntentionsEntered
  16. {
  17. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  18. LYFZ.BLL.BLL_ErpHospitalClient hctbll = new BLL.BLL_ErpHospitalClient();
  19. LYFZ.BLL.BLL_ErpHospitalProduct hptbll = new BLL.BLL_ErpHospitalProduct();
  20. LYFZ.BLL.BLL_ErpHospitalDispatchDoor hddrbll = new BLL.BLL_ErpHospitalDispatchDoor();
  21. LYFZ.BLL.BLL_ErpHospitalContactRecord ambll1 = new BLL.BLL_ErpHospitalContactRecord();
  22. public IntentionsEntered()
  23. {
  24. this.btnDelete.Click += btnDelete_Click;
  25. this.btnclose.Click += btnclose_Click;
  26. this.btnSavedData.Click += btnSavedData_Click;
  27. this.butnSet2.Click += butnSet2_Click;
  28. this.buttonForm1.Click += buttonForm1_Click;
  29. this.buttonForm3.Click += buttonForm3_Click;
  30. this.buttonForm2.Click += buttonForm2_Click;
  31. this.Load += IntentionsEntered_Load;
  32. this.txtQQ.KeyPress += txtQQ_KeyPress;
  33. this.txtCus_Telephone.KeyPress += txtCus_Telephone_KeyPress;
  34. this.txtCus_Telephone.Leave += txtCus_Telephone_Leave;
  35. this.txtHusbandMobile.KeyPress += txtHusbandMobile_KeyPress;
  36. this.txtHomePhone.KeyPress += txtHomePhone_KeyPress;
  37. this.txtFamilyPhone.KeyPress += txtFamilyPhone_KeyPress;
  38. this.txtMaidenCalls.KeyPress += txtMaidenCalls_KeyPress;
  39. this.Shown += IntentionsEntered_Shown;
  40. this.buttonForm4.Click += buttonForm4_Click;
  41. this.buttonForm5.Click += buttonForm5_Click;
  42. this.txtHomeZip.KeyPress += txtHomeZip_KeyPress;
  43. this.txtHusbandZip.KeyPress += txtHusbandZip_KeyPress;
  44. this.txtParentsZip.KeyPress += txtParentsZip_KeyPress;
  45. this.txtPregnantday.KeyPress += txtPregnantday_KeyPress;
  46. this.btnQQCall.Click += btnQQCall_Click;
  47. this.btnDial.Click += btnDial_Click;
  48. this.buttonTel1.Click += buttonTel1_Click;
  49. this.dateBabyBirthday.Leave += dateBabyBirthday_Leave;
  50. this.dateExpectedDate.Leave += dateExpectedDate_Leave;
  51. this.txtPregnantday.Leave += txtPregnantday_Leave;
  52. this.cbxBabyProfile.CheckedChanged += cbxBabyProfile_CheckedChanged;
  53. this.cbxPregnant.CheckedChanged += cbxPregnant_CheckedChanged;
  54. this.btnAdding.Click += btnAdding_Click;
  55. this.dgvTrackRecord.CellDoubleClick += dgvTrackRecord_CellDoubleClick;
  56. this.bntReset.Click += bntReset_Click;
  57. this.btnAddingSingle.Click += btnAddingSingle_Click;
  58. this.btnUpdate.Click += btnUpdate_Click;
  59. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  60. this.cmbtreevLostStatus.ComboBoxTree_NodeMouseClick += cmbtreevLostStatus_ComboBoxTree_NodeMouseClick;
  61. this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
  62. this.btnPhotoImport.Click += btnPhotoImport_Click;
  63. this.btnPhotoExport.Click += btnPhotoExport_Click;
  64. this.btnProductToolbox.Click += btnProductToolbox_Click;
  65. this.btnAllSendOut.Click += btnAllSendOut_Click;
  66. this.btnAllCompleted.Click += btnAllCompleted_Click;
  67. this.btnAllPickup.Click += btnAllPickup_Click;
  68. this.listViewData_Product.MouseDoubleClick += listViewData_Product_MouseDoubleClick;
  69. this.listViewData_Product.MouseDown += listViewData_Product_MouseDown;
  70. this.listViewData_Product.Scroll += listViewData_Product_Scroll;
  71. this.listViewData_Photo.MouseDoubleClick += listViewData_Photo_MouseDoubleClick;
  72. this.cmbtreevText.Leave += cmbtreevText_Leave;
  73. this.txtText.Leave += txtText_Leave;
  74. this.btnSavedData.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.Add);
  75. this.btnDelete.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.Delete);
  76. this.btnAddingSingle.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.AddSendSingleTask);
  77. this.btnUpdate.Enabled = this.btnAddingSingle.Enabled;
  78. this.btnAdding.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.AddCommunicateRecord);
  79. this.btnDelete.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.DelCommunicateRecord);
  80. }
  81. /// <summary>
  82. /// 登录者ID
  83. /// </summary>
  84. string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  85. /// <summary>
  86. /// 来单批号
  87. /// </summary>
  88. public string StrOrdNumber = "";
  89. /// <summary>
  90. /// 是否保存
  91. /// </summary>
  92. public bool IsSaveed = false;
  93. private bool IsBirthday = true;
  94. /// <summary>
  95. /// 相片集合
  96. /// </summary>
  97. ImageList mlistImage = new ImageList();
  98. /// <summary>
  99. /// 相片集合
  100. /// </summary>
  101. ImageList mlistImagePhoto = new ImageList();
  102. /// <summary>
  103. /// 用于排序的类
  104. /// </summary>
  105. LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
  106. DataTable dtVendor = new DataTable();
  107. /// <summary>
  108. /// 双击记录表
  109. /// </summary>
  110. /// <param name="sender"></param>
  111. /// <param name="e"></param>
  112. void dgvTrackRecord_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  113. {
  114. if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
  115. {
  116. if (this.dgvTrackRecord.Rows.Count > 0)
  117. {
  118. if (this.dgvTrackRecord.CurrentRow != null)
  119. {
  120. if (this.dgvTrackRecord.CurrentRow.Index >= 0 && this.dgvTrackRecord.CurrentCell.RowIndex >= 0)
  121. {
  122. AddingTrackRecord frn = new AddingTrackRecord();
  123. frn.StrOrderRecordID = this.dgvTrackRecord.CurrentRow.Cells["ID"].Value.ToString();
  124. frn.StrOrderNumber = this.txtsingle.Text.Trim();
  125. frn.IsGoForm = false;
  126. frn.ShowDialog();
  127. }
  128. }
  129. }
  130. }
  131. }
  132. /// <summary>
  133. /// 预产期离开事件
  134. /// </summary>
  135. /// <param name="sender"></param>
  136. /// <param name="e"></param>
  137. void dateExpectedDate_Leave(object sender, EventArgs e)
  138. {
  139. if (this.dateBabyBirthday.Text != "")
  140. { this.dateBabyBirthday.Text = ""; }
  141. if (!string.IsNullOrEmpty(this.dateExpectedDate.DateValue.Trim()))
  142. {
  143. int IntDay = Convert.ToInt32("-" + (40 * 7));
  144. this.txtPregnantday.Text = ((SDateTime.Now - Convert.ToDateTime(this.dateExpectedDate.DateValue).AddDays(IntDay)).Days / 7).ToString();
  145. }
  146. }
  147. /// <summary>
  148. /// 怀孕周数离开事件
  149. /// </summary>
  150. /// <param name="sender"></param>
  151. /// <param name="e"></param>
  152. void txtPregnantday_Leave(object sender, EventArgs e)
  153. {
  154. if (!string.IsNullOrEmpty(this.txtPregnantday.Text.Trim()))
  155. {
  156. int IntDay = (40 - Convert.ToInt32(this.txtPregnantday.Text.Trim())) * 7;
  157. this.dateExpectedDate.DateValue = SDateTime.Now.AddDays(IntDay).ToString();
  158. }
  159. }
  160. /// <summary>
  161. /// 窗体加载时事件
  162. /// </summary>
  163. /// <param name="sender"></param>
  164. /// <param name="e"></param>
  165. void IntentionsEntered_Load(object sender, EventArgs e)
  166. {
  167. this.panelEx3.Visible = true;
  168. this.dateExpectedDate.DateValue = "";
  169. this.btnDelete.Visible = false;
  170. this.btnAddingSingle.Visible = false;
  171. this.btnUpdate.Visible = false;
  172. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAL", this.cbxCustomerGroups);
  173. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAM", this.comboBoxTreeViewEx9);
  174. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAK", this.cbxHospital);
  175. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAO", this.cmbtreevBusinessIntent);
  176. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAC", this.cbxArea);
  177. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAN", this.cbxFeeding);
  178. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cbxRetail);
  179. this.listViewData_Product.View = View.Details;
  180. this.listViewData_Product.GridLines = true;
  181. string[] StrColumns = "商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注".Split(',');
  182. for (int i = 0; i < StrColumns.Length; i++)
  183. {
  184. ColumnHeader ch = new ColumnHeader();
  185. ch.Text = StrColumns[i].Trim();
  186. switch (StrColumns[i].Trim())
  187. {
  188. case "商品名称":
  189. case "发出厂商":
  190. ch.Width = 200; break;
  191. case "发出人员":
  192. case "完成人员":
  193. case "取件人员":
  194. ch.Width = 120; break;
  195. case "商品价格":
  196. case "商品数量":
  197. ch.Width = 70; break;
  198. case "完成状态":
  199. case "取件状态":
  200. ch.Width = 80; break;
  201. case "备注": ch.Width = 500; break;
  202. }
  203. ch.TextAlign = HorizontalAlignment.Left;
  204. this.listViewData_Product.Columns.Add(ch);
  205. }
  206. this.mlistImage.ImageSize = new Size(25, 25);
  207. this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
  208. this.listViewData_Product.SmallImageList = mlistImage;
  209. this.lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
  210. this.listViewData_Product.ListViewItemSorter = this.lvwColumnSorter;
  211. this.mlistImagePhoto.ImageSize = new Size(110, 120);
  212. this.mlistImagePhoto.ColorDepth = ColorDepth.Depth32Bit;
  213. this.listViewData_Photo.LargeImageList = this.mlistImagePhoto;
  214. }
  215. /// <summary>
  216. /// 窗体加载后事件
  217. /// </summary>
  218. /// <param name="sender"></param>
  219. /// <param name="e"></param>
  220. void IntentionsEntered_Shown(object sender, EventArgs e)
  221. {
  222. this.lblPrompt.Visible = false;
  223. this.datasingletime.DateValue = SDateTime.Now.ToString("yyyy-MM-dd");
  224. if (this.StrOrdNumber != "")
  225. {
  226. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_Telephone);
  227. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtFamilyPhone);
  228. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtHomePhone);
  229. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtMaidenCalls);
  230. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtHusband);
  231. DataTable tbl = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_Oddnumber='" + this.StrOrdNumber + "'", ShowColumnName: "*").Tables[0];
  232. this.btnDelete.Visible = true;
  233. this.btnAdding.Visible = true;
  234. this.panelEx5.Visible = true;
  235. this.btnAddingSingle.Visible = true;
  236. this.btnUpdate.Visible = false;
  237. // 老公姓名;
  238. this.txtHusbandName.Text = tbl.Rows[0]["Hct_HusbandName"].ToString().Trim();
  239. this.txtName.Text = tbl.Rows[0]["Hct_CustomerName"].ToString().Trim();
  240. this.txtBabyName.Text = tbl.Rows[0]["Hct_BabyName"].ToString().Trim();
  241. this.txtCus_Telephone.Text = tbl.Rows[0]["Hct_MyselfMobile"].ToString().Trim();
  242. this.txtsingle.Text = tbl.Rows[0]["Hct_Oddnumber"].ToString().Trim();
  243. this.txtHusbandMobile.Text = tbl.Rows[0]["Hct_HusbandMobile"].ToString().Trim();
  244. this.cmbtreevBusinessIntent.Text = tbl.Rows[0]["Hct_BusinessIntention"].ToString().Trim();
  245. this.comboBoxTreeViewEx9.Text = tbl.Rows[0]["Hcr_BusinessType"].ToString().Trim();
  246. this.cbxRetail.Text = tbl.Rows[0]["Hct_Retail"].ToString().Trim();
  247. this.cbxCustomerGroups.Text = tbl.Rows[0]["Hct_CustomerGroups"].ToString().Trim();
  248. this.cbxArea.Text = tbl.Rows[0]["Hct_CustomerRegions"].ToString().Trim();
  249. this.cbxHospital.Text = tbl.Rows[0]["Hct_SingleHospital"].ToString().Trim();
  250. this.txtPregnantday.Text = tbl.Rows[0]["Hct_PregnantDay"].ToString().Trim();
  251. this.txtQQ.Text = tbl.Rows[0]["Hct_QQ"].ToString().Trim();
  252. this.txtHome.Text = tbl.Rows[0]["Hct_HomeAddress"].ToString().Trim();
  253. this.txtHomeZip.Text = tbl.Rows[0]["Hct_HomePostcode"].ToString().Trim();
  254. this.txtHomePhone.Text = tbl.Rows[0]["Hct_FamilyPhone"].ToString().Trim();
  255. this.txtHusband.Text = tbl.Rows[0]["Hct_HusbandAddress"].ToString().Trim();
  256. this.txtHusbandZip.Text = tbl.Rows[0]["Hct_HusbandPostcode"].ToString().Trim();
  257. this.txtFamilyPhone.Text = tbl.Rows[0]["Hct_Husbandphone"].ToString().Trim();
  258. this.txtParents.Text = tbl.Rows[0]["Hct_MaidenAddress"].ToString().Trim();
  259. this.txtParentsZip.Text = tbl.Rows[0]["Hct_MaidenPostcode"].ToString().Trim();
  260. this.txtMaidenCalls.Text = tbl.Rows[0]["Hct_Maidenphone"].ToString().Trim();
  261. this.txtRemark.Text = tbl.Rows[0]["Hct_Remarks"].ToString().Trim();
  262. this.datasingletime.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Hct_CreateDatetime"]);
  263. if (!string.IsNullOrEmpty(tbl.Rows[0]["Hct_BabyFeeding"].ToString().Trim()))
  264. { this.cbxFeeding.TextFindTag(tbl.Rows[0]["Hct_BabyFeeding"].ToString().Trim()); }
  265. if (tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "1")
  266. {
  267. TreeNode root = new TreeNode();
  268. root.Text = "已成交";
  269. root.Tag = "1";
  270. root.Name = "1";
  271. this.cmbtreevLostStatus.Nodes.Add(root);
  272. this.cmbtreevLostStatus.Enabled = false;
  273. }
  274. else
  275. {
  276. TreeNode root = new TreeNode();
  277. root.Text = "未成交";
  278. root.Tag = "0";
  279. root.Name = "0";
  280. this.cmbtreevLostStatus.Nodes.Add(root);
  281. root = new TreeNode();
  282. root.Text = "已流失";
  283. root.Tag = "2";
  284. root.Name = "2";
  285. this.cmbtreevLostStatus.Nodes.Add(root);
  286. if (tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "2")
  287. {
  288. this.panelLostRemark.Visible = true;
  289. this.txtLostRemark.Text = tbl.Rows[0]["Hct_LostRemark"].ToString().Trim();
  290. }
  291. }
  292. this.cmbtreevLostStatus.TagFindText(tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim());
  293. //this.cmbDealStatus.Text = tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "0" ? "未成交" : "已成交";
  294. this.chkLunar.Checked = Convert.ToBoolean(tbl.Rows[0]["Hct_AreLunar"]);
  295. if (tbl.Rows[0]["Hct_BabySex"].ToString().Trim() == "男")
  296. { this.radioButtonEx1.Checked = true; }
  297. else
  298. { this.radioButtonEx2.Checked = true; }
  299. this.panelEx2.Visible = true;
  300. if (tbl.Rows[0]["Hct_BirthdayType"].ToString().Trim() == "0")
  301. {
  302. this.cbxBabyProfile.Checked = true;
  303. this.dateExpectedDate.DateValue = "";
  304. if (!string.IsNullOrEmpty(tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim()))
  305. { this.dateBabyBirthday.Text = LYFZ.Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim(), IsLunar: this.chkLunar.Checked); }
  306. }
  307. else
  308. {
  309. this.cbxPregnant.Checked = true;
  310. this.dateBabyBirthday.Text = "";
  311. this.dateExpectedDate.DateValue = tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim();
  312. }
  313. this.PublicFunctionRows3();
  314. this.PublicFunctionRows4();
  315. }
  316. else
  317. {
  318. TreeNode root = new TreeNode();
  319. root.Text = "未成交";
  320. root.Tag = "0";
  321. root.Name = "0";
  322. this.cmbtreevLostStatus.Nodes.Add(root);
  323. this.cmbtreevLostStatus.TagFindText("0");
  324. }
  325. this.PublicFunctionRows();
  326. this.PublicFunctionRows2();
  327. dtVendor = orbll.GetView_Custom("tb_ErpVendor", StrWhere: "", ShowColumnName: "Vd_Name", filedOrder: "ID").Tables[0];
  328. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(
  329. VersionControl.VersionFunctionEnum.医院跟踪系统意向单录入);
  330. if (!b)
  331. {
  332. this.Close();
  333. }
  334. }
  335. /// <summary>
  336. /// 重置按钮
  337. /// </summary>
  338. /// <param name="sender"></param>
  339. /// <param name="e"></param>
  340. void bntReset_Click(object sender, EventArgs e)
  341. {
  342. this.StrOrdNumber = "";
  343. this.txtLostRemark.Text = "";
  344. this.txtName.Text = "";
  345. this.txtCus_Telephone.Text = "";
  346. this.txtHusbandMobile.Text = "";
  347. this.txtQQ.Text = "";
  348. this.cbxRetail.Text = "";
  349. this.cbxCustomerGroups.Text = "";
  350. this.cmbtreevBusinessIntent.Text = "";
  351. this.cbxHospital.Text = "";
  352. this.cbxArea.Text = "";
  353. this.comboBoxTreeViewEx9.Text = "";
  354. this.txtsingle.Text = "";
  355. this.cmbtreevLostStatus.SetTextAndTag_ValueNull();
  356. this.dateExpectedDate.DateValue = "";
  357. this.txtPregnantday.Text = "";
  358. this.cbxFeeding.Text = "";
  359. this.txtBabyName.Text = "";
  360. this.dateBabyBirthday.Text = "";
  361. this.txtHome.Text = "";
  362. this.txtHomeZip.Text = "";
  363. this.txtHomePhone.Text = "";
  364. this.txtHusband.Text = "";
  365. this.txtHusbandZip.Text = "";
  366. this.txtFamilyPhone.Text = "";
  367. this.txtParents.Text = "";
  368. this.txtParentsZip.Text = "";
  369. this.txtMaidenCalls.Text = "";
  370. this.txtRemark.Text = "";
  371. this.cbxMessage.Checked = false;
  372. this.panelEx2.Visible = false;
  373. this.panelEx5.Visible = false;
  374. this.datasingletime.DateValue = SDateTime.Now.ToString("yyyy-MM-dd");
  375. this.radioButtonEx1.Checked = true;
  376. this.cbxBabyProfile.Checked = true;
  377. this.dgvTrackRecord.Rows.Clear();
  378. }
  379. /// <summary>
  380. /// 添加记录
  381. /// </summary>
  382. /// <param name="sender"></param>
  383. /// <param name="e"></param>
  384. void btnAdding_Click(object sender, EventArgs e)
  385. {
  386. AddingTrackRecord frm = new AddingTrackRecord();
  387. frm.StrOrderNumber = this.txtsingle.Text;
  388. frm.ShowDialog();
  389. if (frm.IsSaveed)
  390. {
  391. this.tabControlEx1.SelectedIndex = 0;
  392. this.PublicFunctionRows();
  393. }
  394. }
  395. /// <summary>
  396. /// 选择预产期事件
  397. /// </summary>
  398. /// <param name="sender"></param>
  399. /// <param name="e"></param>
  400. void cbxPregnant_CheckedChanged(object sender, EventArgs e)
  401. {
  402. if (this.cbxPregnant.Checked == true)
  403. {
  404. this.panelEx4.Visible = true;
  405. this.panelEx3.Visible = false;
  406. this.cbxBabyProfile.Checked = false;
  407. this.panelEx4.Location = new Point(1, 91);
  408. }
  409. else
  410. { this.cbxBabyProfile.Checked = true; }
  411. }
  412. /// <summary>
  413. /// 选择宝宝资料事件
  414. /// </summary>
  415. /// <param name="sender"></param>
  416. /// <param name="e"></param>
  417. void cbxBabyProfile_CheckedChanged(object sender, EventArgs e)
  418. {
  419. if (this.cbxBabyProfile.Checked == true)
  420. {
  421. this.panelEx3.Visible = true;
  422. this.panelEx4.Visible = false;
  423. this.cbxPregnant.Checked = false;
  424. this.panelEx3.Location = new Point(1, 91);
  425. }
  426. else
  427. { this.cbxPregnant.Checked = true; }
  428. }
  429. /// <summary>
  430. /// 老公手机拨打电话按钮
  431. /// </summary>
  432. /// <param name="sender"></param>
  433. /// <param name="e"></param>
  434. void buttonTel1_Click(object sender, EventArgs e)
  435. {
  436. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtHusbandMobile); //手机
  437. }
  438. /// <summary>
  439. /// 本人手机拨打电话按钮
  440. /// </summary>
  441. /// <param name="sender"></param>
  442. /// <param name="e"></param>
  443. void btnDial_Click(object sender, EventArgs e)
  444. {
  445. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtCus_Telephone); //手机
  446. }
  447. /// <summary>
  448. /// QQ按钮
  449. /// </summary>
  450. /// <param name="sender"></param>
  451. /// <param name="e"></param>
  452. void btnQQCall_Click(object sender, EventArgs e)
  453. {
  454. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(this.txtQQ.Text.Trim()); //QQ
  455. }
  456. /// <summary>
  457. /// 生日离开事件
  458. /// </summary>
  459. /// <param name="sender"></param>
  460. /// <param name="e"></param>
  461. void dateBabyBirthday_Leave(object sender, EventArgs e)
  462. {
  463. int intMasse = this.dateBabyBirthday.CheckDateValue(this.dateBabyBirthday, chkLunar);
  464. if (intMasse == 1)
  465. { MessageBoxCustom.Show("宝贝生日日期格式输入错误"); this.IsBirthday = false; return; }
  466. else if (intMasse == 2)
  467. { MessageBoxCustom.Show("宝贝生日:" + this.dateBabyBirthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历"); this.IsBirthday = false; return; }
  468. this.IsBirthday = true;
  469. //if (this.dateBabyBirthday.DateValue != "")
  470. //{ this.dateBabyBirthday.DateValue = ""; }
  471. }
  472. /// <summary>
  473. /// QQ号只能输入数字事件
  474. /// </summary>
  475. /// <param name="sender"></param>
  476. /// <param name="e"></param>
  477. void txtQQ_KeyPress(object sender, KeyPressEventArgs e)
  478. {
  479. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  480. { e.Handled = true; }
  481. }
  482. /// <summary>
  483. /// 设置本人手机号只能为数字
  484. /// </summary>
  485. /// <param name="sender"></param>
  486. /// <param name="e"></param>
  487. void txtCus_Telephone_KeyPress(object sender, KeyPressEventArgs e)
  488. {
  489. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  490. { e.Handled = true; }
  491. }
  492. /// <summary>
  493. /// 本人电话离开事件
  494. /// </summary>
  495. /// <param name="sender"></param>
  496. /// <param name="e"></param>
  497. void txtCus_Telephone_Leave(object sender, EventArgs e)
  498. {
  499. string CusTelephone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
  500. if (CusTelephone.Trim().Length == 11)
  501. {
  502. DataTable dt = orbll.GetView_Custom("tb_ErpCustomer", StrWhere: "Cus_Telephone = '" + CusTelephone.Trim() + "'", ShowColumnName: "ID,Cus_Name").Tables[0];
  503. if (dt.Rows.Count > 0)
  504. {
  505. //this.lblPrompt.Text = "温馨提示:电话[" + CusTelephone.Trim() + "],已有成交的订单,请核对!";
  506. //this.lblPrompt.Visible = true;
  507. if (MessageBoxCustom.Show("电话[" + CusTelephone.Trim() + "],已有成交的订单,是否要继续录入新的订单", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  508. {
  509. this.txtCus_Telephone.Text = CusTelephone.Substring(0, CusTelephone.Length - 1);
  510. this.txtCus_Telephone.ForCharMaskedTextBox();
  511. }
  512. else
  513. { this.txtName.Text = dt.Rows[0]["Cus_Name"].ToString().Trim(); }
  514. return;
  515. }
  516. DataTable dt2 = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_MyselfMobile = '" + CusTelephone.Trim() + "'", ShowColumnName: "ID,Hct_CustomerName").Tables[0];
  517. if (dt2.Rows.Count > 0)
  518. {
  519. //this.lblPrompt.Text = "温馨提示:电话[" + CusTelephone.Trim() + "],医院意向已有录好的订单,请核对!";
  520. //this.lblPrompt.Visible = true;
  521. if (MessageBoxCustom.Show("电话[" + CusTelephone.Trim() + "],医院意向已有录好的订单,是否要继续录入新的订单", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  522. {
  523. this.txtCus_Telephone.Text = CusTelephone.Substring(0, CusTelephone.Length - 1);
  524. this.txtCus_Telephone.ForCharMaskedTextBox();
  525. }
  526. else
  527. { this.txtName.Text = dt2.Rows[0]["Hct_CustomerName"].ToString().Trim(); }
  528. return;
  529. }
  530. }
  531. this.lblPrompt.Visible = false;
  532. }
  533. /// <summary>
  534. /// 设置老公手机只能输入数字
  535. /// </summary>
  536. /// <param name="sender"></param>
  537. /// <param name="e"></param>
  538. void txtHusbandMobile_KeyPress(object sender, KeyPressEventArgs e)
  539. {
  540. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  541. { e.Handled = true; }
  542. }
  543. /// <summary>
  544. /// 设置家庭电话只能为数字
  545. /// </summary>
  546. /// <param name="sender"></param>
  547. /// <param name="e"></param>
  548. void txtHomePhone_KeyPress(object sender, KeyPressEventArgs e)
  549. {
  550. if (e.KeyChar == '-')
  551. { }
  552. else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  553. { e.Handled = true; }
  554. }
  555. /// <summary>
  556. /// 设置婆家电话只能为数字
  557. /// </summary>
  558. /// <param name="sender"></param>
  559. /// <param name="e"></param>
  560. void txtFamilyPhone_KeyPress(object sender, KeyPressEventArgs e)
  561. {
  562. if (e.KeyChar == '-')
  563. { }
  564. else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  565. { e.Handled = true; }
  566. }
  567. /// <summary>
  568. /// 设置娘家手机只能为数字
  569. /// </summary>
  570. /// <param name="sender"></param>
  571. /// <param name="e"></param>
  572. void txtMaidenCalls_KeyPress(object sender, KeyPressEventArgs e)
  573. {
  574. if (e.KeyChar == '-')
  575. { }
  576. else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  577. { e.Handled = true; }
  578. }
  579. /// <summary>
  580. /// 自家邮编只能位数字
  581. /// </summary>
  582. /// <param name="sender"></param>
  583. /// <param name="e"></param>
  584. void txtHomeZip_KeyPress(object sender, KeyPressEventArgs e)
  585. {
  586. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  587. { e.Handled = true; }
  588. }
  589. /// <summary>
  590. /// 娘家邮编只为数字
  591. /// </summary>
  592. /// <param name="sender"></param>
  593. /// <param name="e"></param>
  594. void txtParentsZip_KeyPress(object sender, KeyPressEventArgs e)
  595. {
  596. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  597. { e.Handled = true; }
  598. }
  599. /// <summary>
  600. /// 婆家邮编只为数字
  601. /// </summary>
  602. /// <param name="sender"></param>
  603. /// <param name="e"></param>
  604. void txtHusbandZip_KeyPress(object sender, KeyPressEventArgs e)
  605. {
  606. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  607. { e.Handled = true; }
  608. }
  609. /// <summary>
  610. /// 设置怀孕天数只能为数字
  611. /// </summary>
  612. /// <param name="sender"></param>
  613. /// <param name="e"></param>
  614. void txtPregnantday_KeyPress(object sender, KeyPressEventArgs e)
  615. {
  616. if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
  617. { e.Handled = true; }
  618. }
  619. /// <summary>
  620. /// 喂养方式设置按钮
  621. /// </summary>
  622. /// <param name="sender"></param>
  623. /// <param name="e"></param>
  624. void buttonForm5_Click(object sender, EventArgs e)
  625. {
  626. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  627. frm.TypeName = "AAAAAAN";
  628. frm.Version = "Version";
  629. if (frm.ShowDialog() == DialogResult.OK)
  630. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAN", this.cbxFeeding); }
  631. }
  632. /// <summary>
  633. /// 业务意向设置按钮
  634. /// </summary>
  635. /// <param name="sender"></param>
  636. /// <param name="e"></param>
  637. void buttonForm2_Click(object sender, EventArgs e)
  638. {
  639. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  640. frm.TypeName = "AAAAAAO";
  641. frm.Version = "Version";
  642. if (frm.ShowDialog() == DialogResult.OK)
  643. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAO", this.cmbtreevBusinessIntent); }
  644. }
  645. /// <summary>
  646. /// 客户区域设置按钮
  647. /// </summary>
  648. /// <param name="sender"></param>
  649. /// <param name="e"></param>
  650. void buttonForm4_Click(object sender, EventArgs e)
  651. {
  652. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  653. frm.TypeName = "AAAAAAC";
  654. frm.Version = "Version";
  655. if (frm.ShowDialog() == DialogResult.OK)
  656. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAC", this.cbxArea); }
  657. }
  658. /// <summary>
  659. /// 业务种类设置按钮
  660. /// </summary>
  661. /// <param name="sender"></param>
  662. /// <param name="e"></param>
  663. void buttonForm3_Click(object sender, EventArgs e)
  664. {
  665. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  666. frm.TypeName = "AAAAAAM";
  667. frm.Version = "Version";
  668. if (frm.ShowDialog() == DialogResult.OK)
  669. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAM", this.comboBoxTreeViewEx9); }
  670. }
  671. /// <summary>
  672. /// 来单医院设置按钮
  673. /// </summary>
  674. /// <param name="sender"></param>
  675. /// <param name="e"></param>
  676. void buttonForm1_Click(object sender, EventArgs e)
  677. {
  678. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  679. frm.TypeName = "AAAAAAK";
  680. frm.Version = "Version";
  681. if (frm.ShowDialog() == DialogResult.OK)
  682. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAK", this.cbxHospital); }
  683. }
  684. /// <summary>
  685. /// 客户类别设置按钮
  686. /// </summary>
  687. /// <param name="sender"></param>
  688. /// <param name="e"></param>
  689. void butnSet2_Click(object sender, EventArgs e)
  690. {
  691. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  692. frm.TypeName = "AAAAAAL";
  693. frm.Version = "Version";
  694. if (frm.ShowDialog() == DialogResult.OK)
  695. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAL", this.cbxCustomerGroups); }
  696. }
  697. /// <summary>
  698. /// 删除
  699. /// </summary>
  700. /// <param name="sender"></param>
  701. /// <param name="e"></param>
  702. void btnDelete_Click(object sender, EventArgs e)
  703. {
  704. try
  705. {
  706. if (this.tabControlEx1.SelectedIndex == 0)
  707. {
  708. if (this.dgvTrackRecord.Rows.Count > 0 && this.dgvTrackRecord.CurrentCell.RowIndex >= 0 && this.dgvTrackRecord.CurrentCell.ColumnIndex >= 0 && this.dgvTrackRecord.SelectedRows.Count > 0)
  709. {
  710. if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  711. {
  712. if (ambll1.Delete(Convert.ToInt32(this.dgvTrackRecord.SelectedRows[0].Cells["ID"].Value)))
  713. {
  714. MessageBoxCustom.Show("删除成功!");
  715. this.dgvTrackRecord.Rows.Remove(this.dgvTrackRecord.SelectedRows[0]);
  716. }
  717. else
  718. { MessageBoxCustom.Show("删除失败!"); }
  719. }
  720. }
  721. }
  722. else if (this.tabControlEx1.SelectedIndex == 1)
  723. {
  724. if (this.dgvData.Rows.Count > 0 && this.dgvData.CurrentCell.RowIndex >= 0 && this.dgvData.CurrentCell.ColumnIndex >= 0 && this.dgvData.SelectedRows.Count > 0)
  725. {
  726. if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  727. {
  728. if (hddrbll.Delete(Convert.ToInt32(this.dgvData.SelectedRows[0].Cells["ID"].Value)))
  729. {
  730. MessageBoxCustom.Show("删除成功!");
  731. this.dgvData.Rows.Remove(this.dgvData.SelectedRows[0]);
  732. }
  733. else
  734. { MessageBoxCustom.Show("删除失败!"); }
  735. }
  736. }
  737. }
  738. else if (this.tabControlEx1.SelectedIndex == 2)
  739. {
  740. if (this.listViewData_Product.Items.Count > 0 && this.listViewData_Product.SelectedItems.Count > 0)
  741. {
  742. if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  743. {
  744. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
  745. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  746. {
  747. if (hptbll.Delete(Convert.ToInt32(ColumnModel.ProductOrderID)))
  748. {
  749. MessageBoxCustom.Show("删除成功!");
  750. //this.dgvData.Rows.Remove(this.dgvData.SelectedRows[0]);
  751. this.listViewData_Product.Items.Remove(this.listViewData_Product.SelectedItems[0]);
  752. }
  753. else
  754. { MessageBoxCustom.Show("删除失败!"); }
  755. }
  756. else
  757. { this.listViewData_Product.Items.Remove(this.listViewData_Product.SelectedItems[0]); }
  758. }
  759. }
  760. }
  761. else if (this.tabControlEx1.SelectedIndex == 3)
  762. {
  763. if (this.listViewData_Photo.Items.Count > 0)
  764. {
  765. if (this.listViewData_Photo.SelectedItems.Count > 0)
  766. {
  767. List<string> delList = new List<string>();
  768. List<ListViewItem> listItem = new List<ListViewItem>();
  769. for (int i = 0; i < this.listViewData_Photo.SelectedItems.Count; i++)
  770. {
  771. if (this.listViewData_Photo.SelectedItems[i].ForeColor != Color.Red)
  772. { delList.Add(this.listViewData_Photo.SelectedItems[i].Tag.ToString().Trim()); }
  773. listItem.Add(this.listViewData_Photo.SelectedItems[i]);
  774. }
  775. if (MessageBoxCustom.Show("您确定要删除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  776. { return; }
  777. if (delList.Count > 0)
  778. {
  779. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  780. {
  781. for (int i = 0; i < delList.Count; i++)
  782. {
  783. backgroundWorker.ReportProgress(0, "正在删除" + System.IO.Path.GetFileNameWithoutExtension(delList[i].Trim()) + "...");
  784. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteHospitalPhoto(System.IO.Path.GetFileNameWithoutExtension(delList[i].Trim()) + ".jpg", this.StrOrdNumber, IsRecursion: true, DeleteDressType: 0);
  785. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteHospitalPhoto(System.IO.Path.GetFileName(delList[i].Trim()), this.StrOrdNumber, IsRecursion: true, DeleteDressType: 1);
  786. }
  787. });
  788. }
  789. for (int i = 0; i < listItem.Count; i++)
  790. { this.listViewData_Photo.Items.Remove(listItem[i]); }
  791. LYFZ.Model.Model_ErpHospitalClient model = hctbll.GetModel("Hct_Oddnumber", this.StrOrdNumber);
  792. if (model.ID > 0)
  793. {
  794. if (!string.IsNullOrEmpty(model.Hct_PhotoNames.Trim()))
  795. {
  796. List<string> StrArray = model.Hct_PhotoNames.Trim().Split('|').ToList();
  797. for (int j = 0; j < delList.Count; j++)
  798. {
  799. for (int i = 0; i < StrArray.Count; i++)
  800. {
  801. if (!string.IsNullOrEmpty(StrArray[i].Trim()))
  802. {
  803. if (StrArray[i].Trim() == System.IO.Path.GetFileName(delList[j].Trim()))
  804. {
  805. StrArray.Remove(StrArray[i]);
  806. break;
  807. }
  808. }
  809. }
  810. }
  811. string StrNewPhotoName = "";
  812. for (int i = 0; i < StrArray.Count; i++)
  813. {
  814. StrNewPhotoName += StrArray[i].Trim() + "|";
  815. }
  816. model.Hct_PhotoNames = StrNewPhotoName.TrimEnd('|');
  817. hctbll.Update(model);
  818. }
  819. }
  820. }
  821. }
  822. }
  823. }
  824. catch (Exception ex)
  825. { MessageBoxCustom.Show(ex.Message); }
  826. }
  827. /// <summary>
  828. /// 关闭窗体
  829. /// </summary>
  830. /// <param name="sender"></param>
  831. /// <param name="e"></param>
  832. void btnclose_Click(object sender, EventArgs e)
  833. {
  834. if (MessageBoxCustom.Show("你确定要关闭吗?", "关闭提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  835. { this.Close(); }
  836. }
  837. /// <summary>
  838. /// 添加派单
  839. /// </summary>
  840. /// <param name="sender"></param>
  841. /// <param name="e"></param>
  842. void btnAddingSingle_Click(object sender, EventArgs e)
  843. {
  844. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  845. {
  846. AddingSendSingle frm = new AddingSendSingle();
  847. frm.StrOrderNumber = this.StrOrdNumber;
  848. frm.ShowDialog();
  849. if (frm.IsSaveed)
  850. {
  851. this.tabControlEx1.SelectedIndex = 1;
  852. this.PublicFunctionRows2();
  853. }
  854. }
  855. else
  856. { MessageBoxCustom.Show("请选择客户进行添加!"); }
  857. }
  858. /// <summary>
  859. /// 修改派单
  860. /// </summary>
  861. /// <param name="sender"></param>
  862. /// <param name="e"></param>
  863. void btnUpdate_Click(object sender, EventArgs e)
  864. {
  865. if (this.dgvData.Rows.Count > 0 && this.dgvData.SelectedRows.Count > 0)
  866. {
  867. if (this.btnUpdate.Enabled)
  868. {
  869. AddingSendSingle frm = new AddingSendSingle();
  870. frm.TeskRow = this.dgvData.CurrentRow;
  871. frm.ShowDialog();
  872. if (frm.IsSaveed)
  873. {
  874. this.tabControlEx1.SelectedIndex = 1;
  875. this.PublicFunctionRows2();
  876. }
  877. }
  878. }
  879. }
  880. /// <summary>
  881. /// 双击修改上门派单
  882. /// </summary>
  883. /// <param name="sender"></param>
  884. /// <param name="e"></param>
  885. void dgvData_MouseDoubleClick(object sender, MouseEventArgs e)
  886. {
  887. if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
  888. { this.btnUpdate_Click(this, null); }
  889. }
  890. /// <summary>
  891. /// 选项卡选择事件
  892. /// </summary>
  893. /// <param name="sender"></param>
  894. /// <param name="e"></param>
  895. void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e)
  896. {
  897. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  898. {
  899. this.btnDelete.Visible = true;
  900. this.btnUpdate.Visible = false;
  901. this.btnAddingSingle.Visible = false;
  902. this.btnAdding.Visible = false;
  903. this.btnPhotoExport.Visible = false;
  904. this.btnPhotoImport.Visible = false;
  905. this.btnAllSendOut.Visible = false;
  906. this.btnAllCompleted.Visible = false;
  907. this.btnAllPickup.Visible = false;
  908. this.btnProductToolbox.Visible = false;
  909. if (this.tabControlEx1.SelectedIndex == 0)
  910. {
  911. this.btnAdding.Visible = true;
  912. this.btnAddingSingle.Visible = true;
  913. }
  914. else if (this.tabControlEx1.SelectedIndex == 1)
  915. {
  916. this.btnAdding.Visible = true;
  917. this.btnAddingSingle.Visible = true; this.btnUpdate.Visible = true;
  918. }
  919. else if (this.tabControlEx1.SelectedIndex == 2)
  920. {
  921. this.btnAllPickup.Visible = true;
  922. this.btnAllCompleted.Visible = true;
  923. this.btnAllSendOut.Visible = true;
  924. this.btnProductToolbox.Visible = true;
  925. }
  926. else if (this.tabControlEx1.SelectedIndex == 3)
  927. {
  928. this.btnPhotoExport.Visible = true;
  929. this.btnPhotoImport.Visible = true;
  930. }
  931. }
  932. }
  933. /// <summary>
  934. /// 成效状态选择事件
  935. /// </summary>
  936. /// <param name="sender"></param>
  937. /// <param name="e"></param>
  938. void cmbtreevLostStatus_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  939. {
  940. if (e.Node.Tag != null)
  941. {
  942. if (e.Node.Tag.ToString().Trim() == "2")
  943. { this.panelLostRemark.Visible = true; }
  944. else
  945. { this.panelLostRemark.Visible = false; }
  946. }
  947. }
  948. /// <summary>
  949. /// 定义显示
  950. /// </summary>
  951. void PublicFunctionRows()
  952. {
  953. DataTable tbl = orbll.GetView_Custom("tb_ErpHospitalContactRecord", StrWhere: "Hcr_Number='" + this.StrOrdNumber + "'", ShowColumnName: "ID,Hcr_Number as 来单批号,dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hcr_CallTime)) as 通话时间,Hcr_CallDuration as 通话时长,Hcr_Homeaddress as 具体事项,Hcr_CallStaff as 通话人员,Hcr_CallMode as 通话方式,dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hcr_RemindTime)) as 下次提醒时间,Hcr_Remarks as 沟通备注").Tables[0];
  954. if (tbl.Rows.Count > 0 && !string.IsNullOrEmpty(this.StrOrdNumber))
  955. {
  956. this.dgvTrackRecord.DataSource(tbl, strHideField: "ID");
  957. this.dgvTrackRecord.Columns["来单批号"].Width = 100;
  958. this.dgvTrackRecord.Columns["通话时间"].Width = 80;
  959. this.dgvTrackRecord.Columns["通话时长"].Width = 70;
  960. this.dgvTrackRecord.Columns["具体事项"].Width = 100;
  961. this.dgvTrackRecord.Columns["通话人员"].Width = 70;
  962. this.dgvTrackRecord.Columns["通话方式"].Width = 70;
  963. this.dgvTrackRecord.Columns["下次提醒时间"].Width = 90;
  964. }
  965. else
  966. { this.dgvTrackRecord.DataColumns(tbl.Columns, strHideField: "ID"); }
  967. this.dgvTrackRecord.FillLastColumn();
  968. }
  969. void PublicFunctionRows2()
  970. {
  971. string StrColumnName = "ID,dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hdr_DoorTime))+' '+ Hdr_DoorPeriod AS 上门时间,case when Hdr_HomeState = 0 then '未上门' else 'OK' end as 上门状态,Hdr_DoorPersonOne as 上门人员1,Hdr_DoorPersonTwo as 上门人员2,Hdr_DoorPersonThree as 上门人员3,Hdr_DoorPersonFour as 上门人员4,Hdr_Vehicle as 车辆,Hdr_DispatchDoorRemark AS 备注";
  972. DataTable dt = orbll.GetView_Custom("tb_ErpHospitalDispatchDoor", StrWhere: "Hdr_Number = '" + this.StrOrdNumber + "'", ShowColumnName: StrColumnName).Tables[0];
  973. if (dt.Rows.Count > 0 && !string.IsNullOrEmpty(this.StrOrdNumber))
  974. {
  975. this.dgvData.DataSource(dt, strHideField: "ID");
  976. this.dgvData.Columns["上门时间"].Width = 110;
  977. this.dgvData.Columns["上门状态"].Width = 70;
  978. this.dgvData.Columns["上门人员1"].Width = 70;
  979. this.dgvData.Columns["上门人员2"].Width = 70;
  980. this.dgvData.Columns["上门人员3"].Width = 70;
  981. this.dgvData.Columns["上门人员4"].Width = 70;
  982. this.dgvData.Columns["车辆"].Width = 90;
  983. }
  984. else
  985. { this.dgvData.DataColumns(dt.Columns, strHideField: "ID"); }
  986. this.dgvData.FillLastColumn();
  987. }
  988. void PublicFunctionRows3()
  989. {
  990. this.listViewData_Product.Items.Clear();
  991. string StrColumnName = "tb_ErpHospitalProduct.ID,Hpt_ProductSalesPrice,Hpt_ProductLessInventory,Hpt_ProductNumber,Hpt_ProductName,Hpt_ProductQuantity,Hpt_SendOutVendor,Hpt_SendOutName AS Hpt_SendOutNameNumber," +
  992. "dbo.fn_CheckUserIDGetUserName(Hpt_SendOutName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_SendOutDateTime)) AS Hpt_SendOutName," +
  993. "dbo.fn_CheckProductCompletedStatus(Hpt_CompletedStatus) AS Hpt_CompletedStatus,Hpt_CompletedName AS Hpt_CompletedNameNumber," +
  994. "dbo.fn_CheckUserIDGetUserName(Hpt_CompletedName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_CompletedDateTime)) AS Hpt_CompletedName," +
  995. "dbo.fn_CheckProductTakePiecesStatus(Hpt_PickupStatus) AS Hpt_PickupStatus,Hpt_PickupName AS Hpt_PickupNameNumber," +
  996. "dbo.fn_CheckUserIDGetUserName(Hpt_PickupName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_PickupDateTime)) AS Hpt_PickupName," +
  997. "Hpt_Remark,Prod_Thumbnail";
  998. DataTable dt = orbll.GetView_Custom("tb_ErpHospitalProduct Left Join tb_ErpProduct on Prod_Number = Hpt_ProductNumber", StrWhere: "Hpt_OrderNumber = '" + this.StrOrdNumber + "'", ShowColumnName: StrColumnName).Tables[0];
  999. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = null;
  1000. for (int i = 0; i < dt.Rows.Count; i++)
  1001. {
  1002. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetProductImage(dt.Rows[i]["Prod_Thumbnail"].ToString().Trim());
  1003. if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim()))
  1004. { this.mlistImage.Images.Add(dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim(), img); }
  1005. ListViewItem lvItem = new ListViewItem();
  1006. ColumnModel = new SetCustomControls_HospitalProductColumnHeaderModel();
  1007. ColumnModel.ProductOrderID = dt.Rows[i]["ID"].ToString().Trim();
  1008. ColumnModel.ProductLessInventory = dt.Rows[i]["Hpt_ProductLessInventory"].ToString().Trim();
  1009. lvItem.Tag = ColumnModel;
  1010. lvItem.ImageKey = dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim();
  1011. lvItem.Text = dt.Rows[i]["Hpt_ProductName"].ToString().Trim();
  1012. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  1013. ListSubItem.Name = "商品价格";
  1014. ListSubItem.Text = dt.Rows[i]["Hpt_ProductSalesPrice"].ToString().Trim();
  1015. lvItem.SubItems.Add(ListSubItem);
  1016. ListSubItem = new ListViewItem.ListViewSubItem();
  1017. ListSubItem.Name = "商品数量";
  1018. ListSubItem.Text = dt.Rows[i]["Hpt_ProductQuantity"].ToString().Trim();
  1019. lvItem.SubItems.Add(ListSubItem);
  1020. ListSubItem = new ListViewItem.ListViewSubItem();
  1021. ListSubItem.Name = "发出厂商";
  1022. ListSubItem.Text = dt.Rows[i]["Hpt_SendOutVendor"].ToString().Trim();
  1023. lvItem.SubItems.Add(ListSubItem);
  1024. ListSubItem = new ListViewItem.ListViewSubItem();
  1025. ListSubItem.Name = "发出人员";
  1026. ListSubItem.Text = dt.Rows[i]["Hpt_SendOutName"].ToString().Trim();
  1027. ListSubItem.Tag = dt.Rows[i]["Hpt_SendOutNameNumber"].ToString().Trim();
  1028. lvItem.SubItems.Add(ListSubItem);
  1029. ListSubItem = new ListViewItem.ListViewSubItem();
  1030. ListSubItem.Name = "完成状态";
  1031. ListSubItem.Text = dt.Rows[i]["Hpt_CompletedStatus"].ToString().Trim();
  1032. lvItem.SubItems.Add(ListSubItem);
  1033. ListSubItem = new ListViewItem.ListViewSubItem();
  1034. ListSubItem.Name = "完成人员";
  1035. ListSubItem.Text = dt.Rows[i]["Hpt_CompletedName"].ToString().Trim();
  1036. ListSubItem.Tag = dt.Rows[i]["Hpt_CompletedNameNumber"].ToString().Trim();
  1037. lvItem.SubItems.Add(ListSubItem);
  1038. ListSubItem = new ListViewItem.ListViewSubItem();
  1039. ListSubItem.Name = "取件状态";
  1040. ListSubItem.Text = dt.Rows[i]["Hpt_PickupStatus"].ToString().Trim();
  1041. lvItem.SubItems.Add(ListSubItem);
  1042. ListSubItem = new ListViewItem.ListViewSubItem();
  1043. ListSubItem.Name = "取件人员";
  1044. ListSubItem.Text = dt.Rows[i]["Hpt_PickupName"].ToString().Trim();
  1045. ListSubItem.Tag = dt.Rows[i]["Hpt_PickupNameNumber"].ToString().Trim();
  1046. lvItem.SubItems.Add(ListSubItem);
  1047. ListSubItem = new ListViewItem.ListViewSubItem();
  1048. ListSubItem.Name = "备注";
  1049. ListSubItem.Text = dt.Rows[i]["Hpt_Remark"].ToString().Trim();
  1050. lvItem.SubItems.Add(ListSubItem);
  1051. if ((this.listViewData_Product.Items.Count % 2) > 0)
  1052. { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
  1053. else
  1054. { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
  1055. this.listViewData_Product.Items.Add(lvItem);
  1056. }
  1057. }
  1058. void PublicFunctionRows4()
  1059. {
  1060. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  1061. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetHospitalImage_Small(this.listViewData_Photo, this.mlistImagePhoto, this.StrOrdNumber); }
  1062. }
  1063. /// <summary>
  1064. /// 保存资料按钮
  1065. /// </summary>
  1066. /// <param name="sender"></param>
  1067. /// <param name="e"></param>
  1068. void btnSavedData_Click(object sender, EventArgs e)
  1069. {
  1070. LYFZ.Model.Model_ErpHospitalClient model = null;
  1071. DateTime strTime = SDateTime.Now;
  1072. string StrPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
  1073. string StrHusbandPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtHusbandMobile);
  1074. if (StrPhone.Length > 0 && StrPhone.Length < 11)
  1075. { MessageBoxCustom.Show("本人手机输入不完整!"); return; }
  1076. if (StrHusbandPhone.Length > 0 && StrHusbandPhone.Length < 11)
  1077. { MessageBoxCustom.Show("老公手机输入不完整!"); return; }
  1078. if (string.IsNullOrEmpty(this.StrOrdNumber))
  1079. {
  1080. #region 检测数据不能为空
  1081. if (this.txtName.Text == "")
  1082. { MessageBoxCustom.Show("请输入客户姓名!"); return; }
  1083. if (!this.cbxBabyProfile.Checked)
  1084. {
  1085. if (string.IsNullOrEmpty(this.dateExpectedDate.DateValue))
  1086. { MessageBoxCustom.Show("请输入 预产期!"); return; }
  1087. else
  1088. {
  1089. if (this.txtPregnantday.Text == "")
  1090. { MessageBoxCustom.Show("请输入怀孕天数"); return; }
  1091. }
  1092. }
  1093. if (this.datasingletime.Text == "")
  1094. { MessageBoxCustom.Show("请输入来单日期!"); return; }
  1095. if (this.cbxCustomerGroups.Text == "")
  1096. { MessageBoxCustom.Show("请选择客户类别!"); return; }
  1097. if (this.cbxRetail.Text == "")
  1098. { MessageBoxCustom.Show("请输入门市人员"); return; }
  1099. if (this.cbxHospital.Text == "")
  1100. { MessageBoxCustom.Show("请选择来单医院"); return; }
  1101. if (this.cmbtreevLostStatus.Visible)
  1102. {
  1103. if (string.IsNullOrEmpty(this.cmbtreevLostStatus.Text.Trim()))
  1104. { MessageBoxCustom.Show("请选择成交状态"); return; }
  1105. }
  1106. this.dateBabyBirthday_Leave(this, e);
  1107. if (!this.IsBirthday)
  1108. { return; }
  1109. #endregion
  1110. model = new Model.Model_ErpHospitalClient();
  1111. model.Hct_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  1112. model.Hct_CustomerName = this.txtName.Text.ToString().Trim();
  1113. model.Hct_BabyName = this.txtBabyName.Text.ToString().Trim();
  1114. // 老公姓名;
  1115. model.Hct_HusbandName = this.txtHusbandName.Text.ToString().Trim();
  1116. if (this.radioButtonEx1.Checked == true)
  1117. { model.Hct_BabySex = "男"; }
  1118. else
  1119. { model.Hct_BabySex = "女"; }
  1120. if (this.cbxBabyProfile.Checked)
  1121. {
  1122. model.Hct_BirthdayType = 0;
  1123. model.Hct_BabyBirthday = this.dateBabyBirthday.StrValue.Trim();
  1124. model.Hct_AreLunar = this.chkLunar.Checked;
  1125. }
  1126. else if (this.cbxPregnant.Checked)
  1127. {
  1128. model.Hct_BirthdayType = 1;
  1129. model.Hct_BabyBirthday = this.dateExpectedDate.Text.Trim();
  1130. model.Hct_AreLunar = false;
  1131. }
  1132. if (this.cbxMessage.Checked == true)
  1133. { model.Hct_MessageSingle = "是"; }
  1134. else
  1135. { model.Hct_MessageSingle = "否"; }
  1136. model.Hct_CustomerOrders = Convert.ToInt32(this.cmbtreevLostStatus.Tag);
  1137. model.Hct_LostRemark = "";
  1138. model.Hct_OrderNumber = "";
  1139. model.Hct_BabyFeeding = this.cbxFeeding.Text.ToString().Trim();
  1140. model.Hct_SingleDatetime = Convert.ToDateTime(this.datasingletime.DateValue.Trim());
  1141. model.Hct_Oddnumber = hctbll.GenerationNumber();
  1142. model.Hct_CustomerGroups = this.cbxCustomerGroups.Text.ToString().Trim();
  1143. model.Hct_Retail = this.cbxRetail.Text.ToString().Trim();
  1144. model.Hct_CustomerRegions = this.cbxArea.Text.Trim().ToString();
  1145. model.Hct_SingleHospital = this.cbxHospital.Text.ToString().Trim();
  1146. if (this.txtPregnantday.Text == "")
  1147. { model.Hct_PregnantDay = 0; }
  1148. else
  1149. { model.Hct_PregnantDay = Convert.ToInt32(this.txtPregnantday.Text.Trim()); }
  1150. model.Hct_QQ = this.txtQQ.Text.Trim().ToString();
  1151. model.Hct_Remarks = this.txtRemark.Text.ToString().Trim();
  1152. model.Hct_MyselfMobile = StrPhone;
  1153. model.Hct_HusbandMobile = StrHusbandPhone;
  1154. model.Hct_FamilyPhone = this.txtHomePhone.Text.Trim();
  1155. model.Hct_Husbandphone = this.txtFamilyPhone.Text.Trim();
  1156. model.Hct_Maidenphone = this.txtMaidenCalls.Text.Trim();
  1157. model.Hct_HomeAddress = this.txtHome.Text.ToString().Trim();
  1158. model.Hct_HomePostcode = this.txtHomeZip.Text.ToString().Trim();
  1159. model.Hct_HusbandAddress = this.txtHusband.Text.ToString().Trim();
  1160. model.Hct_HusbandPostcode = this.txtHusbandZip.Text.ToString().Trim();
  1161. model.Hct_MaidenAddress = this.txtParents.Text.ToString().Trim();
  1162. model.Hct_MaidenPostcode = this.txtParentsZip.Text.Trim().ToString();
  1163. model.Hcr_BusinessType = this.comboBoxTreeViewEx9.Text.Trim().ToString();
  1164. model.Hct_BusinessIntention = this.cmbtreevBusinessIntent.Text.Trim().ToString();
  1165. string phone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
  1166. model.Hct_CreateDatetime = strTime;
  1167. model.Hct_CreateName = strUserID;
  1168. if (hctbll.Add(model))
  1169. {
  1170. this.StrOrdNumber = model.Hct_Oddnumber;
  1171. MessageBoxCustom.Show("保存成功");
  1172. if (this.cbxMessage.Checked == true)
  1173. { this.SendGenerateEventSMS(model.Hct_Oddnumber); }
  1174. //this.txtsingle.Text = model.Hct_Oddnumber;
  1175. //this.txtsingle.Visible = true;
  1176. string strContent = "本人手机:" + model.Hct_MyselfMobile;
  1177. if (!String.IsNullOrEmpty(model.Hct_HusbandMobile))
  1178. {
  1179. strContent += ",老公手机:" + model.Hct_HusbandMobile;
  1180. }
  1181. if (!String.IsNullOrEmpty(model.Hct_BabyName))
  1182. {
  1183. strContent += ",宝贝姓名:" + model.Hct_BabyName;
  1184. }
  1185. LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog(LYFZ.EnumPublic.SystemLogsType.增加医院跟踪客户, "增加医院跟踪客户,来单批号为:" + model.Hct_Oddnumber + ",客户姓名为:" + this.txtName.Text.Trim().ToString() + "," + strContent, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name);
  1186. this.IntentionsEntered_Shown(this, null);
  1187. }
  1188. else
  1189. { MessageBoxCustom.Show("保存失败"); }
  1190. }
  1191. else
  1192. {
  1193. #region 检测数据不能为空
  1194. if (this.txtName.Text == "")
  1195. { MessageBoxCustom.Show("请输入客户姓名!"); return; }
  1196. if (!this.cbxBabyProfile.Checked)
  1197. {
  1198. if (string.IsNullOrEmpty(this.dateExpectedDate.DateValue))
  1199. { MessageBoxCustom.Show("请输入 预产期!"); return; }
  1200. else
  1201. {
  1202. if (this.txtPregnantday.Text == "")
  1203. { MessageBoxCustom.Show("请输入怀孕天数"); return; }
  1204. }
  1205. }
  1206. if (this.datasingletime.Text == "")
  1207. { MessageBoxCustom.Show("请输入来单日期!"); return; }
  1208. if (this.cbxCustomerGroups.Text == "")
  1209. { MessageBoxCustom.Show("请选择客户类别!"); return; }
  1210. if (this.cbxRetail.Text == "")
  1211. { MessageBoxCustom.Show("请输入门市人员"); return; }
  1212. if (this.cbxHospital.Text == "")
  1213. { MessageBoxCustom.Show("请选择来单医院"); return; }
  1214. if (string.IsNullOrEmpty(this.cmbtreevLostStatus.Text.Trim()))
  1215. { MessageBoxCustom.Show("请选择成交状态"); return; }
  1216. this.dateBabyBirthday_Leave(this, e);
  1217. if (!this.IsBirthday)
  1218. { return; }
  1219. #endregion
  1220. string Strs = this.txtPregnantday.Text.Trim();
  1221. model = hctbll.GetModel("Hct_Oddnumber", this.txtsingle.Text.Trim());
  1222. model.Hct_CustomerName = this.txtName.Text.ToString().Trim();
  1223. model.Hct_BabyName = this.txtBabyName.Text.ToString().Trim();
  1224. model.Hct_CustomerOrders = Convert.ToInt32(this.cmbtreevLostStatus.Tag);
  1225. model.Hct_HusbandName = this.txtHusbandName.Text.ToString().Trim();
  1226. if (this.panelLostRemark.Visible)
  1227. { model.Hct_LostRemark = this.txtLostRemark.Text.Trim(); }
  1228. else
  1229. { model.Hct_LostRemark = ""; }
  1230. if (this.radioButtonEx1.Checked)
  1231. { model.Hct_BabySex = "男"; }
  1232. else
  1233. { model.Hct_BabySex = "女"; }
  1234. if (this.cbxBabyProfile.Checked)
  1235. {
  1236. model.Hct_BirthdayType = 0;
  1237. if (this.dateBabyBirthday.StrValue != "")
  1238. { model.Hct_BabyBirthday = LYFZ.Command.Command_Validate.DateTimeToString(this.dateBabyBirthday.StrValue); }
  1239. else
  1240. { model.Hct_BabyBirthday = ""; }
  1241. model.Hct_AreLunar = this.chkLunar.Checked;
  1242. }
  1243. else if (this.cbxPregnant.Checked)
  1244. {
  1245. model.Hct_BirthdayType = 1;
  1246. model.Hct_BabyBirthday = this.dateExpectedDate.Text.Trim();
  1247. model.Hct_AreLunar = false;
  1248. }
  1249. if (this.cbxMessage.Checked)
  1250. { model.Hct_MessageSingle = "是"; }
  1251. else
  1252. { model.Hct_MessageSingle = "否"; }
  1253. if (this.txtPregnantday.Text == "")
  1254. { model.Hct_PregnantDay = 0; }
  1255. model.Hct_BabyFeeding = this.cbxFeeding.Text.ToString().Trim();
  1256. model.Hct_SingleDatetime = Convert.ToDateTime(this.datasingletime.DateValue.Trim());
  1257. model.Hct_Oddnumber = this.txtsingle.Text.Trim();
  1258. model.Hct_CustomerGroups = this.cbxCustomerGroups.Text.ToString().Trim();
  1259. model.Hct_Retail = this.cbxRetail.Text.ToString().Trim();
  1260. model.Hct_CustomerRegions = this.cbxArea.Text.Trim().ToString();
  1261. model.Hct_SingleHospital = this.cbxHospital.Text.ToString().Trim();
  1262. if (this.txtPregnantday.Text != "")
  1263. { model.Hct_PregnantDay = Convert.ToInt32(this.txtPregnantday.Text); }
  1264. else
  1265. { model.Hct_PregnantDay = Convert.ToInt32(Strs); }
  1266. model.Hct_QQ = this.txtQQ.Text.Trim().ToString();
  1267. model.Hct_Remarks = this.txtRemark.Text.ToString().Trim();
  1268. model.Hct_MyselfMobile = StrPhone;
  1269. model.Hct_HusbandMobile = StrHusbandPhone;
  1270. model.Hct_FamilyPhone = this.txtHomePhone.Text.Trim();
  1271. model.Hct_Husbandphone = this.txtFamilyPhone.Text.Trim();
  1272. model.Hct_Maidenphone = this.txtMaidenCalls.Text.Trim();
  1273. model.Hct_HomeAddress = this.txtHome.Text.ToString().Trim();
  1274. model.Hct_HomePostcode = this.txtHomeZip.Text.ToString().Trim();
  1275. model.Hct_HusbandAddress = this.txtHusband.Text.ToString().Trim();
  1276. model.Hct_HusbandPostcode = this.txtHusbandZip.Text.ToString().Trim();
  1277. model.Hct_MaidenAddress = this.txtParents.Text.ToString().Trim();
  1278. model.Hct_MaidenPostcode = this.txtParentsZip.Text.Trim().ToString();
  1279. model.Hcr_BusinessType = this.comboBoxTreeViewEx9.Text.Trim().ToString();
  1280. model.Hct_BusinessIntention = this.cmbtreevBusinessIntent.Text.Trim().ToString();
  1281. model.Hct_UpdateDatetime = strTime;
  1282. model.Hct_UpdateName = strUserID;
  1283. if (hctbll.Update(model))
  1284. {
  1285. this.IsSaveed = true;
  1286. MessageBoxCustom.Show("更新成功");
  1287. string strContent = "本人手机:" + model.Hct_MyselfMobile;
  1288. if (!String.IsNullOrEmpty(model.Hct_HusbandMobile))
  1289. {
  1290. strContent += ",老公手机:" + model.Hct_HusbandMobile;
  1291. }
  1292. if (!String.IsNullOrEmpty(model.Hct_BabyName))
  1293. {
  1294. strContent += ",宝贝姓名:" + model.Hct_BabyName;
  1295. }
  1296. LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog(LYFZ.EnumPublic.SystemLogsType.修改医院跟踪客户, "更新医院跟踪客户,来单批号为:" + model.Hct_Oddnumber + ",客户姓名为:" + this.txtName.Text.Trim() + "," + strContent, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name);
  1297. PublicFunctionRows();
  1298. }
  1299. else
  1300. { MessageBoxCustom.Show("更新失败"); }
  1301. }
  1302. }
  1303. /// <summary>
  1304. /// 发送来单短信
  1305. /// </summary>
  1306. /// <param name="_OrderNumber"></param>
  1307. void SendGenerateEventSMS(string _OrderNumber)
  1308. {
  1309. LYFZ.BLL.BLL_SMSTemplates smstBll = new BLL.BLL_SMSTemplates();
  1310. Model.SMSParameters sMSParameters = new Model.SMSParameters();
  1311. sMSParameters.OrderNumber = _OrderNumber;
  1312. sMSParameters.IsHospitalTrackingSystem = true;
  1313. smstBll.GenerateEventSMS(EnumPublic.SmsSendEvent.来单录入后X分钟, sMSParameters);
  1314. }
  1315. /// <summary>
  1316. /// 相片导入
  1317. /// </summary>
  1318. /// <param name="sender"></param>
  1319. /// <param name="e"></param>
  1320. void btnPhotoImport_Click(object sender, EventArgs e)
  1321. {
  1322. if (!string.IsNullOrEmpty(this.StrOrdNumber))
  1323. {
  1324. OpenFileDialog fileDialog = new OpenFileDialog();
  1325. fileDialog.Filter = "图片文件(*.jpg)|*.jpg|图片文件(*.bmp)|*.bmp|图片文件(*.png)|*.png";
  1326. fileDialog.FileName = "";
  1327. fileDialog.Multiselect = true;
  1328. if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  1329. {
  1330. List<string> StrPathList = fileDialog.FileNames.ToList();
  1331. string StrPhotoNames = "";
  1332. for (int i = 0; i < StrPathList.Count; i++)
  1333. {
  1334. FileInfo f = new FileInfo(StrPathList[i].Trim());
  1335. if (f.Length > 30000000)
  1336. { MessageBoxCustom.Show("图片过大,建议使用大小在30M以内的图片"); return; }
  1337. StrPhotoNames += System.IO.Path.GetFileName(StrPathList[i].Trim()) + "|";
  1338. }
  1339. LYFZ.Model.Model_ErpHospitalClient model = hctbll.GetModel("Hct_Oddnumber", this.StrOrdNumber);
  1340. if (model.ID > 0)
  1341. {
  1342. if (!string.IsNullOrEmpty(model.Hct_PhotoNames.Trim()))
  1343. {
  1344. string[] StrArray = model.Hct_PhotoNames.Trim().Split('|');
  1345. for (int i = 0; i < StrArray.Length; i++)
  1346. {
  1347. if (!string.IsNullOrEmpty(StrArray[i].Trim()))
  1348. {
  1349. for (int j = 0; j < StrPathList.Count; j++)
  1350. {
  1351. if (System.IO.Path.GetFileNameWithoutExtension(StrArray[i].Trim()) == System.IO.Path.GetFileNameWithoutExtension(StrPathList[j].Trim()))
  1352. { MessageBoxCustom.Show("相片名称‘" + System.IO.Path.GetFileNameWithoutExtension(StrPathList[j].Trim()) + "’已存在,不能重复导入!"); return; }
  1353. }
  1354. }
  1355. }
  1356. model.Hct_PhotoNames += "|" + StrPhotoNames.TrimEnd('|');
  1357. }
  1358. else
  1359. { model.Hct_PhotoNames = StrPhotoNames.TrimEnd('|'); }
  1360. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  1361. {
  1362. for (int i = 0; i < StrPathList.Count; i++)
  1363. {
  1364. backgroundWorker.ReportProgress(0, "正在上传" + (i + 1) + "...");
  1365. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateHospitalPhoto(StrPathList[i].Trim(), this.StrOrdNumber, IsRecursion: true, UpdateDressType: 0);
  1366. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateHospitalPhoto(StrPathList[i].Trim(), this.StrOrdNumber, IsRecursion: true, UpdateDressType: 1);
  1367. }
  1368. });
  1369. hctbll.Update(model);
  1370. }
  1371. this.PublicFunctionRows4();
  1372. }
  1373. }
  1374. }
  1375. /// <summary>
  1376. /// 相片导出
  1377. /// </summary>
  1378. /// <param name="sender"></param>
  1379. /// <param name="e"></param>
  1380. void btnPhotoExport_Click(object sender, EventArgs e)
  1381. {
  1382. if (!string.IsNullOrEmpty(this.StrOrdNumber.Trim()))
  1383. {
  1384. DataTable dt = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_Oddnumber = '" + this.StrOrdNumber + "'", ShowColumnName: "Hct_PhotoNames").Tables[0];
  1385. if (dt.Rows.Count > 0)
  1386. {
  1387. if (!string.IsNullOrEmpty(dt.Rows[0]["Hct_PhotoNames"].ToString().Trim()))
  1388. {
  1389. string[] StrArray = dt.Rows[0]["Hct_PhotoNames"].ToString().Trim().Split('|');
  1390. FolderBrowserDialog fbd = new FolderBrowserDialog();
  1391. if (fbd.ShowDialog() == DialogResult.OK)
  1392. {
  1393. string StrDownPath = "";
  1394. int whileCount = 0;
  1395. bool IsFind = false;
  1396. while (!IsFind)
  1397. {
  1398. StrDownPath = fbd.SelectedPath.ToString().Trim() + "\\" + this.StrOrdNumber;
  1399. if (whileCount > 0)
  1400. { StrDownPath += "_" + whileCount; }
  1401. if (!Directory.Exists(StrDownPath))
  1402. { IsFind = true; }
  1403. whileCount++;
  1404. }
  1405. if (!Directory.Exists(StrDownPath))
  1406. {
  1407. System.IO.Directory.CreateDirectory(StrDownPath);
  1408. }
  1409. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  1410. {
  1411. for (int i = 0; i < StrArray.Length; i++)
  1412. {
  1413. if (!string.IsNullOrEmpty(StrArray[i].Trim()))
  1414. {
  1415. string StrPhotoName = StrArray[i].Trim();
  1416. backgroundWorker.ReportProgress(0, "共" + StrArray.Length + "张,正在导出第" + (i + 1).ToString() + "张...");
  1417. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetHospitalImage_Original(this.StrOrdNumber, StrPhotoName.Trim(), IsShowDefaultPhoto: false);
  1418. if (img != null)
  1419. {
  1420. bool IsShow = false;
  1421. if (i == StrArray.Length - 1)
  1422. { IsShow = true; }
  1423. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadToDirectory(img, StrDownPath + "\\" + StrArray[i].Trim(), IsShowPromptOK: IsShow);
  1424. }
  1425. }
  1426. }
  1427. });
  1428. }
  1429. }
  1430. }
  1431. }
  1432. }
  1433. /// <summary>
  1434. /// 商品工具箱
  1435. /// </summary>
  1436. /// <param name="sender"></param>
  1437. /// <param name="e"></param>
  1438. void btnProductToolbox_Click(object sender, EventArgs e)
  1439. {
  1440. if (!string.IsNullOrEmpty(this.StrOrdNumber.Trim()))
  1441. {
  1442. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm();
  1443. frm.LoadType = "套系包含商品";
  1444. frm.ShowDialog();
  1445. if (frm.IsSaveed)
  1446. {
  1447. List<LYFZ.Model.Model_ErpProduct> mlist = frm.mlist;
  1448. DateTime StrTime = SDateTime.Now;
  1449. List<Helper.CommandInfo> clist = new List<CommandInfo>();
  1450. LYFZ.Model.Model_ErpHospitalProduct model = null;
  1451. for (int i = 0; i < mlist.Count; i++)
  1452. {
  1453. model = new Model.Model_ErpHospitalProduct();
  1454. model.Hpt_Number = "HPT_" + LYFZ.WinAPI.CustomPublicMethod.GenerateId().ToString().Trim();
  1455. model.Hpt_OrderNumber = this.StrOrdNumber;
  1456. model.Hpt_ProductNumber = mlist[i].Prod_Number.Trim();
  1457. model.Hpt_ProductName = mlist[i].Prod_Name.Trim();
  1458. model.Hpt_ProductClass = mlist[i].Prod_Class.ToString().Trim();
  1459. model.Hpt_ProductCostPrice = mlist[i].Prod_CostPrice;
  1460. model.Hpt_ProductSalesPrice = mlist[i].Prod_SalesPrice;
  1461. model.Hpt_ProductBatch = mlist[i].Prod_Batch;
  1462. model.Hpt_ProductUnit = mlist[i].Prod_Unit;
  1463. model.Hpt_ProductQuantity = Convert.ToInt32("1");
  1464. model.Hpt_ProductLessInventory = mlist[i].Prod_Availability;
  1465. model.Hpt_HadLessInventoryQuantity = 0;
  1466. model.Hpt_SendOutVendor = "";
  1467. model.Hpt_SendOutName = "";
  1468. model.Hpt_SendOutStatus = 0;
  1469. model.Hpt_CompletedName = "";
  1470. model.Hpt_CompletedStatus = 0;
  1471. model.Hpt_PickupName = "";
  1472. model.Hpt_PickupStatus = 0;
  1473. model.Hpt_Remark = "";
  1474. model.Hpt_CreateDateTime = StrTime;
  1475. model.Hpt_CreateName = strUserID;
  1476. model.Hpt_UpdateName = "";
  1477. clist.Add(hptbll.GetAddCommandInfo(model));
  1478. }
  1479. if (clist.Count > 0)
  1480. {
  1481. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  1482. { this.PublicFunctionRows3(); }
  1483. else
  1484. { MessageBoxCustom.Show("添加产品失败!"); return; }
  1485. }
  1486. }
  1487. }
  1488. }
  1489. class SetCustomControls_HospitalProductColumnHeaderModel
  1490. {
  1491. private string _ProductOrderID;
  1492. private string _ProductLessInventory;
  1493. /// <summary>
  1494. /// 订单商品ID
  1495. /// </summary>
  1496. public string ProductOrderID
  1497. {
  1498. get { return _ProductOrderID; }
  1499. set { _ProductOrderID = value; }
  1500. }
  1501. /// <summary>
  1502. /// 是否要减库存
  1503. /// </summary>
  1504. public string ProductLessInventory
  1505. {
  1506. get { return _ProductLessInventory; }
  1507. set { _ProductLessInventory = value; }
  1508. }
  1509. }
  1510. /// <summary>
  1511. /// 全部发出
  1512. /// </summary>
  1513. /// <param name="sender"></param>
  1514. /// <param name="e"></param>
  1515. void btnAllSendOut_Click(object sender, EventArgs e)
  1516. {
  1517. if (this.listViewData_Product.Items.Count > 0)
  1518. {
  1519. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm();
  1520. frm.ShowDialog();
  1521. if (frm.DictDataArray.ContainsKey("VendorName"))
  1522. {
  1523. string StrVendor = frm.DictDataArray["VendorName"].ToString().Trim();
  1524. DateTime StrTime = SDateTime.Now;
  1525. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  1526. for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
  1527. {
  1528. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
  1529. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1530. {
  1531. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1532. if (model.Hpt_SendOutStatus == 0)
  1533. {
  1534. model.Hpt_SendOutStatus = 1;
  1535. model.Hpt_SendOutVendor = StrVendor;
  1536. model.Hpt_SendOutDateTime = StrTime;
  1537. model.Hpt_SendOutName = this.strUserID;
  1538. model.Hpt_UpdateDateTime = StrTime;
  1539. model.Hpt_UpdateName = this.strUserID;
  1540. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1541. }
  1542. }
  1543. }
  1544. if (MessageBoxCustom.Show("您确定要发出吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1545. { return; }
  1546. if (clist.Count > 0)
  1547. {
  1548. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  1549. {
  1550. MessageBoxCustom.Show("发出成功!");
  1551. this.PublicFunctionRows3();
  1552. }
  1553. else
  1554. { MessageBoxCustom.Show("发出失败!"); }
  1555. }
  1556. }
  1557. }
  1558. }
  1559. /// <summary>
  1560. /// 全部完成
  1561. /// </summary>
  1562. /// <param name="sender"></param>
  1563. /// <param name="e"></param>
  1564. void btnAllCompleted_Click(object sender, EventArgs e)
  1565. {
  1566. if (this.listViewData_Product.Items.Count > 0)
  1567. {
  1568. DateTime StrTime = SDateTime.Now;
  1569. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  1570. for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
  1571. {
  1572. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
  1573. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1574. {
  1575. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1576. if (model.Hpt_CompletedStatus == 0)
  1577. {
  1578. model.Hpt_CompletedStatus = 1;
  1579. model.Hpt_CompletedDateTime = StrTime;
  1580. model.Hpt_CompletedName = this.strUserID;
  1581. model.Hpt_UpdateDateTime = StrTime;
  1582. model.Hpt_UpdateName = this.strUserID;
  1583. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1584. }
  1585. }
  1586. }
  1587. if (MessageBoxCustom.Show("您确定要完成吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1588. { return; }
  1589. if (clist.Count > 0)
  1590. {
  1591. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  1592. {
  1593. MessageBoxCustom.Show("完成成功!");
  1594. this.PublicFunctionRows3();
  1595. }
  1596. else
  1597. { MessageBoxCustom.Show("完成失败!"); }
  1598. }
  1599. }
  1600. }
  1601. /// <summary>
  1602. /// 全部取走
  1603. /// </summary>
  1604. /// <param name="sender"></param>
  1605. /// <param name="e"></param>
  1606. void btnAllPickup_Click(object sender, EventArgs e)
  1607. {
  1608. if (this.listViewData_Product.Items.Count > 0)
  1609. {
  1610. DateTime StrTime = SDateTime.Now;
  1611. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  1612. for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
  1613. {
  1614. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
  1615. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1616. {
  1617. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1618. if (model.Hpt_PickupStatus == 0)
  1619. {
  1620. model.Hpt_PickupStatus = 1;
  1621. model.Hpt_PickupDateTime = StrTime;
  1622. model.Hpt_PickupName = this.strUserID;
  1623. model.Hpt_UpdateDateTime = StrTime;
  1624. model.Hpt_UpdateName = this.strUserID;
  1625. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1626. }
  1627. }
  1628. }
  1629. if (MessageBoxCustom.Show("您确定要取件吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  1630. { return; }
  1631. if (clist.Count > 0)
  1632. {
  1633. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  1634. {
  1635. MessageBoxCustom.Show("取件成功!");
  1636. this.PublicFunctionRows3();
  1637. }
  1638. else
  1639. { MessageBoxCustom.Show("取件失败!"); }
  1640. }
  1641. }
  1642. }
  1643. /// <summary>
  1644. /// 双击修改
  1645. /// </summary>
  1646. /// <param name="sender"></param>
  1647. /// <param name="e"></param>
  1648. void listViewData_Product_MouseDoubleClick(object sender, MouseEventArgs e)
  1649. {
  1650. //商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注
  1651. this.txtText.Visible = false;
  1652. this.cmbtreevText.Visible = false;
  1653. this.cmbtreevText.Nodes.Clear();
  1654. ListViewHitTestInfo info = this.listViewData_Product.HitTest(e.X, e.Y);
  1655. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1656. {
  1657. TreeNode root = null;
  1658. Rectangle rect = info.SubItem.Bounds;
  1659. switch (info.SubItem.Name.Trim())
  1660. {
  1661. case "发出厂商":
  1662. this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
  1663. this.cmbtreevText.Size = rect.Size;
  1664. root = new TreeNode();
  1665. root.Text = "";
  1666. root.Tag = info.SubItem.Name.Trim();
  1667. this.cmbtreevText.Nodes.Add(root);
  1668. for (int i = 0; i < dtVendor.Rows.Count; i++)
  1669. {
  1670. root = new TreeNode();
  1671. root.Text = dtVendor.Rows[i]["Vd_Name"].ToString().Trim();
  1672. root.Tag = info.SubItem.Name.Trim();
  1673. this.cmbtreevText.Nodes.Add(root);
  1674. }
  1675. this.cmbtreevText.Visible = true;
  1676. this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
  1677. this.cmbtreevText.Focus();
  1678. break;
  1679. case "完成状态":
  1680. this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
  1681. this.cmbtreevText.Size = rect.Size;
  1682. this.cmbtreevText.Visible = true;
  1683. root = new TreeNode();
  1684. root.Text = "完成";
  1685. root.Tag = info.SubItem.Name.Trim();
  1686. this.cmbtreevText.Nodes.Add(root);
  1687. root = new TreeNode();
  1688. root.Text = "未完";
  1689. root.Tag = info.SubItem.Name.Trim();
  1690. this.cmbtreevText.Nodes.Add(root);
  1691. this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
  1692. this.cmbtreevText.Focus();
  1693. break;
  1694. case "取件状态":
  1695. this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
  1696. this.cmbtreevText.Size = rect.Size;
  1697. this.cmbtreevText.Visible = true;
  1698. root = new TreeNode();
  1699. root.Text = "取件";
  1700. root.Tag = info.SubItem.Name.Trim();
  1701. this.cmbtreevText.Nodes.Add(root);
  1702. root = new TreeNode();
  1703. root.Text = "未取";
  1704. root.Tag = info.SubItem.Name.Trim();
  1705. this.cmbtreevText.Nodes.Add(root);
  1706. this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
  1707. this.cmbtreevText.Focus();
  1708. break;
  1709. case "备注":
  1710. this.txtText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 2);
  1711. this.txtText.Size = rect.Size;
  1712. this.txtText.Visible = true;
  1713. this.txtText.Tag = info.SubItem.Name.Trim();
  1714. this.txtText.Text = info.SubItem.Text.Trim();
  1715. this.txtText.Focus();
  1716. break;
  1717. }
  1718. }
  1719. }
  1720. /// <summary>
  1721. /// 滚动条滚动事件
  1722. /// </summary>
  1723. /// <param name="sender"></param>
  1724. /// <param name="e"></param>
  1725. void listViewData_Product_Scroll(object sender, EventArgs e)
  1726. {
  1727. this.txtText.Visible = false;
  1728. this.cmbtreevText.Visible = false;
  1729. }
  1730. /// <summary>
  1731. /// 发出、完成、取件离开事件
  1732. /// </summary>
  1733. /// <param name="sender"></param>
  1734. /// <param name="e"></param>
  1735. void cmbtreevText_Leave(object sender, EventArgs e)
  1736. {
  1737. if (this.cmbtreevText.Tag != null)
  1738. {
  1739. DateTime StrTime = SDateTime.Now;
  1740. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
  1741. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1742. switch (this.cmbtreevText.Tag.ToString().Trim())
  1743. {
  1744. case "发出厂商":
  1745. if (!string.IsNullOrEmpty(this.cmbtreevText.Text.Trim()))
  1746. {
  1747. if (model.Hpt_SendOutStatus == 1)
  1748. { break; }
  1749. model.Hpt_SendOutStatus = 1;
  1750. model.Hpt_SendOutName = this.strUserID;
  1751. model.Hpt_SendOutDateTime = StrTime;
  1752. }
  1753. else
  1754. {
  1755. model.Hpt_SendOutStatus = 0;
  1756. model.Hpt_SendOutName = "";
  1757. model.Hpt_SendOutDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  1758. }
  1759. model.Hpt_SendOutVendor = this.cmbtreevText.Text.Trim();
  1760. model.Hpt_UpdateDateTime = StrTime;
  1761. model.Hpt_UpdateName = this.strUserID;
  1762. hptbll.Update(model);
  1763. break;
  1764. case "完成状态":
  1765. if (this.cmbtreevText.Text.Trim() == "完成")
  1766. {
  1767. if (model.Hpt_CompletedStatus == 1)
  1768. { break; }
  1769. model.Hpt_CompletedStatus = 1;
  1770. model.Hpt_CompletedName = this.strUserID;
  1771. model.Hpt_CompletedDateTime = StrTime;
  1772. }
  1773. else
  1774. {
  1775. model.Hpt_CompletedStatus = 0;
  1776. model.Hpt_CompletedName = "";
  1777. model.Hpt_CompletedDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  1778. }
  1779. model.Hpt_UpdateDateTime = StrTime;
  1780. model.Hpt_UpdateName = this.strUserID;
  1781. hptbll.Update(model);
  1782. break;
  1783. case "取件状态":
  1784. if (this.cmbtreevText.Text.Trim() == "取件")
  1785. {
  1786. if (model.Hpt_PickupStatus == 1)
  1787. { break; }
  1788. model.Hpt_PickupStatus = 1;
  1789. model.Hpt_PickupName = this.strUserID;
  1790. model.Hpt_PickupDateTime = StrTime;
  1791. }
  1792. else
  1793. {
  1794. model.Hpt_PickupStatus = 0;
  1795. model.Hpt_PickupName = "";
  1796. model.Hpt_PickupDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  1797. }
  1798. model.Hpt_UpdateDateTime = SDateTime.Now;
  1799. model.Hpt_UpdateName = this.strUserID;
  1800. hptbll.Update(model);
  1801. break;
  1802. }
  1803. this.PublicFunctionRows3();
  1804. }
  1805. this.cmbtreevText.Visible = false;
  1806. }
  1807. /// <summary>
  1808. /// 备注离开事件
  1809. /// </summary>
  1810. /// <param name="sender"></param>
  1811. /// <param name="e"></param>
  1812. void txtText_Leave(object sender, EventArgs e)
  1813. {
  1814. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
  1815. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1816. model.Hpt_Remark = this.txtText.Text.Trim();
  1817. model.Hpt_UpdateDateTime = SDateTime.Now;
  1818. model.Hpt_UpdateName = this.strUserID;
  1819. hptbll.Update(model);
  1820. this.listViewData_Product.SelectedItems[0].SubItems["备注"].Text = this.txtText.Text.Trim();
  1821. this.txtText.Visible = false;
  1822. }
  1823. /// <summary>
  1824. /// 点击右键
  1825. /// </summary>
  1826. /// <param name="sender"></param>
  1827. /// <param name="e"></param>
  1828. void listViewData_Product_MouseDown(object sender, MouseEventArgs e)
  1829. {
  1830. if (e.Button == MouseButtons.Right)
  1831. {
  1832. if (this.listViewData_Product.Items.Count > 0)
  1833. {
  1834. LYFZ.ComponentLibrary.ContextMenuStripEx contextmenu = new ContextMenuStripEx();
  1835. contextmenu.Name = "Source";
  1836. contextmenu.ItemClicked += contextmenu_ItemClicked;
  1837. //弹出操作菜单
  1838. contextmenu.Items.Clear();
  1839. contextmenu.Show(MousePosition.X, MousePosition.Y);
  1840. ListViewHitTestInfo info = this.listViewData_Product.HitTest(e.X, e.Y);
  1841. if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
  1842. {
  1843. ToolStripMenuItem item = null;
  1844. //商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注
  1845. Rectangle rect = info.SubItem.Bounds;
  1846. switch (info.SubItem.Name.Trim())
  1847. {
  1848. case "发出厂商":
  1849. item = new ToolStripMenuItem();
  1850. item.Text = "发出";
  1851. contextmenu.Items.Add(item);
  1852. item = new ToolStripMenuItem();
  1853. item.Text = "取消发出";
  1854. contextmenu.Items.Add(item);
  1855. break;
  1856. case "完成状态":
  1857. item = new ToolStripMenuItem();
  1858. item.Text = "完成";
  1859. contextmenu.Items.Add(item);
  1860. item = new ToolStripMenuItem();
  1861. item.Text = "取消完成";
  1862. contextmenu.Items.Add(item);
  1863. break;
  1864. case "取件状态":
  1865. item = new ToolStripMenuItem();
  1866. item.Text = "取件";
  1867. contextmenu.Items.Add(item);
  1868. item = new ToolStripMenuItem();
  1869. item.Text = "取消取件";
  1870. contextmenu.Items.Add(item);
  1871. break;
  1872. }
  1873. }
  1874. if (contextmenu.Items.Count > 0)
  1875. {
  1876. ToolStripSeparator tools = new ToolStripSeparator();
  1877. contextmenu.Items.Add(tools);
  1878. contextmenu.Show();
  1879. }
  1880. }
  1881. }
  1882. }
  1883. /// <summary>
  1884. /// 右键选择事件
  1885. /// </summary>
  1886. /// <param name="sender"></param>
  1887. /// <param name="e"></param>
  1888. void contextmenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  1889. {
  1890. ToolStripItem item = e.ClickedItem;
  1891. if (!string.IsNullOrEmpty(item.Text.Trim()))
  1892. {
  1893. DateTime StrTime = SDateTime.Now;
  1894. List<Helper.CommandInfo> clist = new List<CommandInfo>();
  1895. switch (item.Text.Trim())
  1896. {
  1897. case "发出":
  1898. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm();
  1899. frm.ShowDialog();
  1900. if (frm.DictDataArray.ContainsKey("VendorName"))
  1901. {
  1902. string StrVendor = frm.DictDataArray["VendorName"].ToString().Trim();
  1903. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1904. {
  1905. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  1906. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1907. {
  1908. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1909. if (model.Hpt_SendOutStatus == 0)
  1910. {
  1911. model.Hpt_SendOutStatus = 1;
  1912. model.Hpt_SendOutVendor = StrVendor;
  1913. model.Hpt_SendOutDateTime = StrTime;
  1914. model.Hpt_SendOutName = this.strUserID;
  1915. model.Hpt_UpdateDateTime = StrTime;
  1916. model.Hpt_UpdateName = this.strUserID;
  1917. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1918. }
  1919. }
  1920. }
  1921. }
  1922. break;
  1923. case "取消发出":
  1924. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1925. {
  1926. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  1927. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1928. {
  1929. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1930. if (model.Hpt_SendOutStatus == 0)
  1931. {
  1932. model.Hpt_SendOutStatus = 0;
  1933. model.Hpt_SendOutVendor = "";
  1934. model.Hpt_SendOutDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  1935. model.Hpt_SendOutName = "";
  1936. model.Hpt_UpdateDateTime = StrTime;
  1937. model.Hpt_UpdateName = this.strUserID;
  1938. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1939. }
  1940. }
  1941. }
  1942. break;
  1943. case "完成":
  1944. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1945. {
  1946. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  1947. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1948. {
  1949. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1950. if (model.Hpt_CompletedStatus == 0)
  1951. {
  1952. model.Hpt_CompletedStatus = 1;
  1953. model.Hpt_CompletedDateTime = StrTime;
  1954. model.Hpt_CompletedName = this.strUserID;
  1955. model.Hpt_UpdateDateTime = StrTime;
  1956. model.Hpt_UpdateName = this.strUserID;
  1957. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1958. }
  1959. }
  1960. }
  1961. break;
  1962. case "取消完成":
  1963. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1964. {
  1965. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  1966. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1967. {
  1968. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1969. if (model.Hpt_CompletedStatus == 0)
  1970. {
  1971. model.Hpt_CompletedStatus = 0;
  1972. model.Hpt_CompletedDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  1973. model.Hpt_CompletedName = "";
  1974. model.Hpt_UpdateDateTime = StrTime;
  1975. model.Hpt_UpdateName = this.strUserID;
  1976. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1977. }
  1978. }
  1979. }
  1980. break;
  1981. case "取件":
  1982. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  1983. {
  1984. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  1985. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  1986. {
  1987. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  1988. if (model.Hpt_PickupStatus == 0)
  1989. {
  1990. model.Hpt_PickupStatus = 1;
  1991. model.Hpt_PickupDateTime = StrTime;
  1992. model.Hpt_PickupName = this.strUserID;
  1993. model.Hpt_UpdateDateTime = StrTime;
  1994. model.Hpt_UpdateName = this.strUserID;
  1995. clist.Add(hptbll.GetUpdateCommandInfo(model));
  1996. }
  1997. }
  1998. }
  1999. break;
  2000. case "取消取件":
  2001. for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
  2002. {
  2003. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
  2004. if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
  2005. {
  2006. LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
  2007. if (model.Hpt_PickupStatus == 0)
  2008. {
  2009. model.Hpt_PickupStatus = 0;
  2010. model.Hpt_PickupDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  2011. model.Hpt_PickupName = "";
  2012. model.Hpt_UpdateDateTime = StrTime;
  2013. model.Hpt_UpdateName = this.strUserID;
  2014. clist.Add(hptbll.GetUpdateCommandInfo(model));
  2015. }
  2016. }
  2017. }
  2018. break;
  2019. }
  2020. if (MessageBoxCustom.Show("您确定要" + item.Text.Trim() + "吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  2021. { return; }
  2022. if (clist.Count > 0)
  2023. {
  2024. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  2025. {
  2026. MessageBoxCustom.Show(item.Text.Trim() + "成功!");
  2027. this.PublicFunctionRows3();
  2028. }
  2029. else
  2030. { MessageBoxCustom.Show(item.Text.Trim() + "失败!"); }
  2031. }
  2032. }
  2033. }
  2034. /// <summary>
  2035. /// 双击放大
  2036. /// </summary>
  2037. /// <param name="sender"></param>
  2038. /// <param name="e"></param>
  2039. void listViewData_Photo_MouseDoubleClick(object sender, MouseEventArgs e)
  2040. {
  2041. if (this.listViewData_Photo.Items.Count > 0 && this.listViewData_Photo.SelectedItems.Count > 0)
  2042. {
  2043. if (!string.IsNullOrEmpty(this.listViewData_Photo.SelectedItems[0].Tag.ToString().Trim()))
  2044. {
  2045. Image btmp = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetHospitalImage_Original(this.StrOrdNumber, System.IO.Path.GetFileName(this.listViewData_Photo.SelectedItems[0].Tag.ToString().Trim()), IsShowDefaultPhoto: false);
  2046. if (btmp != null)
  2047. {
  2048. LYFZ.Software.MainBusiness.InitialSet.Product.FrmProductPic frm = new InitialSet.Product.FrmProductPic();
  2049. frm.FrmImage = btmp;
  2050. frm.WindowState = FormWindowState.Maximized;
  2051. frm.Show();
  2052. }
  2053. else
  2054. { MessageBoxCustom.Show("未找到相片!"); return; }
  2055. }
  2056. }
  2057. }
  2058. }
  2059. }