12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using System.IO;
- using LYFZ.ComponentLibrary;
- using LYFZ.Helper;
- namespace LYFZ.Software.MainBusiness.HospitalTrackingSystem
- {
- public partial class IntentionsEntered : LYFZ.Software.UI.HospitalTrackingSystem.IntentionsEntered
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpHospitalClient hctbll = new BLL.BLL_ErpHospitalClient();
- LYFZ.BLL.BLL_ErpHospitalProduct hptbll = new BLL.BLL_ErpHospitalProduct();
- LYFZ.BLL.BLL_ErpHospitalDispatchDoor hddrbll = new BLL.BLL_ErpHospitalDispatchDoor();
- LYFZ.BLL.BLL_ErpHospitalContactRecord ambll1 = new BLL.BLL_ErpHospitalContactRecord();
- public IntentionsEntered()
- {
- this.btnDelete.Click += btnDelete_Click;
- this.btnclose.Click += btnclose_Click;
- this.btnSavedData.Click += btnSavedData_Click;
- this.butnSet2.Click += butnSet2_Click;
- this.buttonForm1.Click += buttonForm1_Click;
- this.buttonForm3.Click += buttonForm3_Click;
- this.buttonForm2.Click += buttonForm2_Click;
- this.Load += IntentionsEntered_Load;
- this.txtQQ.KeyPress += txtQQ_KeyPress;
- this.txtCus_Telephone.KeyPress += txtCus_Telephone_KeyPress;
- this.txtCus_Telephone.Leave += txtCus_Telephone_Leave;
- this.txtHusbandMobile.KeyPress += txtHusbandMobile_KeyPress;
- this.txtHomePhone.KeyPress += txtHomePhone_KeyPress;
- this.txtFamilyPhone.KeyPress += txtFamilyPhone_KeyPress;
- this.txtMaidenCalls.KeyPress += txtMaidenCalls_KeyPress;
- this.Shown += IntentionsEntered_Shown;
- this.buttonForm4.Click += buttonForm4_Click;
- this.buttonForm5.Click += buttonForm5_Click;
- this.txtHomeZip.KeyPress += txtHomeZip_KeyPress;
- this.txtHusbandZip.KeyPress += txtHusbandZip_KeyPress;
- this.txtParentsZip.KeyPress += txtParentsZip_KeyPress;
- this.txtPregnantday.KeyPress += txtPregnantday_KeyPress;
- this.btnQQCall.Click += btnQQCall_Click;
- this.btnDial.Click += btnDial_Click;
- this.buttonTel1.Click += buttonTel1_Click;
- this.dateBabyBirthday.Leave += dateBabyBirthday_Leave;
- this.dateExpectedDate.Leave += dateExpectedDate_Leave;
- this.txtPregnantday.Leave += txtPregnantday_Leave;
- this.cbxBabyProfile.CheckedChanged += cbxBabyProfile_CheckedChanged;
- this.cbxPregnant.CheckedChanged += cbxPregnant_CheckedChanged;
- this.btnAdding.Click += btnAdding_Click;
- this.dgvTrackRecord.CellDoubleClick += dgvTrackRecord_CellDoubleClick;
- this.bntReset.Click += bntReset_Click;
- this.btnAddingSingle.Click += btnAddingSingle_Click;
- this.btnUpdate.Click += btnUpdate_Click;
- this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
- this.cmbtreevLostStatus.ComboBoxTree_NodeMouseClick += cmbtreevLostStatus_ComboBoxTree_NodeMouseClick;
- this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
- this.btnPhotoImport.Click += btnPhotoImport_Click;
- this.btnPhotoExport.Click += btnPhotoExport_Click;
- this.btnProductToolbox.Click += btnProductToolbox_Click;
- this.btnAllSendOut.Click += btnAllSendOut_Click;
- this.btnAllCompleted.Click += btnAllCompleted_Click;
- this.btnAllPickup.Click += btnAllPickup_Click;
- this.listViewData_Product.MouseDoubleClick += listViewData_Product_MouseDoubleClick;
- this.listViewData_Product.MouseDown += listViewData_Product_MouseDown;
- this.listViewData_Product.Scroll += listViewData_Product_Scroll;
- this.listViewData_Photo.MouseDoubleClick += listViewData_Photo_MouseDoubleClick;
- this.cmbtreevText.Leave += cmbtreevText_Leave;
- this.txtText.Leave += txtText_Leave;
- this.btnSavedData.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.Add);
- this.btnDelete.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.Delete);
- this.btnAddingSingle.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.AddSendSingleTask);
- this.btnUpdate.Enabled = this.btnAddingSingle.Enabled;
- this.btnAdding.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.AddCommunicateRecord);
- this.btnDelete.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.HospitalTrackingSystem, CustomAttributes.OperatingAuthority.DelCommunicateRecord);
- }
- /// <summary>
- /// 登录者ID
- /// </summary>
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 来单批号
- /// </summary>
- public string StrOrdNumber = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- private bool IsBirthday = true;
- /// <summary>
- /// 相片集合
- /// </summary>
- ImageList mlistImage = new ImageList();
- /// <summary>
- /// 相片集合
- /// </summary>
- ImageList mlistImagePhoto = new ImageList();
- /// <summary>
- /// 用于排序的类
- /// </summary>
- LYFZ.ComponentLibrary.ListViewColumnSorter lvwColumnSorter;
- DataTable dtVendor = new DataTable();
- /// <summary>
- /// 双击记录表
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvTrackRecord_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
- {
- if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
- {
- if (this.dgvTrackRecord.Rows.Count > 0)
- {
- if (this.dgvTrackRecord.CurrentRow != null)
- {
- if (this.dgvTrackRecord.CurrentRow.Index >= 0 && this.dgvTrackRecord.CurrentCell.RowIndex >= 0)
- {
- AddingTrackRecord frn = new AddingTrackRecord();
- frn.StrOrderRecordID = this.dgvTrackRecord.CurrentRow.Cells["ID"].Value.ToString();
- frn.StrOrderNumber = this.txtsingle.Text.Trim();
- frn.IsGoForm = false;
- frn.ShowDialog();
- }
- }
- }
- }
- }
- /// <summary>
- /// 预产期离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dateExpectedDate_Leave(object sender, EventArgs e)
- {
- if (this.dateBabyBirthday.Text != "")
- { this.dateBabyBirthday.Text = ""; }
- if (!string.IsNullOrEmpty(this.dateExpectedDate.DateValue.Trim()))
- {
- int IntDay = Convert.ToInt32("-" + (40 * 7));
- this.txtPregnantday.Text = ((SDateTime.Now - Convert.ToDateTime(this.dateExpectedDate.DateValue).AddDays(IntDay)).Days / 7).ToString();
- }
- }
- /// <summary>
- /// 怀孕周数离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPregnantday_Leave(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.txtPregnantday.Text.Trim()))
- {
- int IntDay = (40 - Convert.ToInt32(this.txtPregnantday.Text.Trim())) * 7;
- this.dateExpectedDate.DateValue = SDateTime.Now.AddDays(IntDay).ToString();
- }
- }
- /// <summary>
- /// 窗体加载时事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void IntentionsEntered_Load(object sender, EventArgs e)
- {
- this.panelEx3.Visible = true;
- this.dateExpectedDate.DateValue = "";
- this.btnDelete.Visible = false;
- this.btnAddingSingle.Visible = false;
- this.btnUpdate.Visible = false;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAL", this.cbxCustomerGroups);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAM", this.comboBoxTreeViewEx9);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAK", this.cbxHospital);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAO", this.cmbtreevBusinessIntent);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAC", this.cbxArea);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAN", this.cbxFeeding);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cbxRetail);
- this.listViewData_Product.View = View.Details;
- this.listViewData_Product.GridLines = true;
- string[] StrColumns = "商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注".Split(',');
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- switch (StrColumns[i].Trim())
- {
- case "商品名称":
- case "发出厂商":
- ch.Width = 200; break;
- case "发出人员":
- case "完成人员":
- case "取件人员":
- ch.Width = 120; break;
- case "商品价格":
- case "商品数量":
- ch.Width = 70; break;
- case "完成状态":
- case "取件状态":
- ch.Width = 80; break;
- case "备注": ch.Width = 500; break;
- }
- ch.TextAlign = HorizontalAlignment.Left;
- this.listViewData_Product.Columns.Add(ch);
- }
- this.mlistImage.ImageSize = new Size(25, 25);
- this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData_Product.SmallImageList = mlistImage;
- this.lvwColumnSorter = new ComponentLibrary.ListViewColumnSorter();
- this.listViewData_Product.ListViewItemSorter = this.lvwColumnSorter;
- this.mlistImagePhoto.ImageSize = new Size(110, 120);
- this.mlistImagePhoto.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData_Photo.LargeImageList = this.mlistImagePhoto;
- }
- /// <summary>
- /// 窗体加载后事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void IntentionsEntered_Shown(object sender, EventArgs e)
- {
- this.lblPrompt.Visible = false;
- this.datasingletime.DateValue = SDateTime.Now.ToString("yyyy-MM-dd");
- if (this.StrOrdNumber != "")
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_Telephone);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtFamilyPhone);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtHomePhone);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtMaidenCalls);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtHusband);
- DataTable tbl = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_Oddnumber='" + this.StrOrdNumber + "'", ShowColumnName: "*").Tables[0];
- this.btnDelete.Visible = true;
- this.btnAdding.Visible = true;
- this.panelEx5.Visible = true;
- this.btnAddingSingle.Visible = true;
- this.btnUpdate.Visible = false;
- // 老公姓名;
- this.txtHusbandName.Text = tbl.Rows[0]["Hct_HusbandName"].ToString().Trim();
- this.txtName.Text = tbl.Rows[0]["Hct_CustomerName"].ToString().Trim();
- this.txtBabyName.Text = tbl.Rows[0]["Hct_BabyName"].ToString().Trim();
- this.txtCus_Telephone.Text = tbl.Rows[0]["Hct_MyselfMobile"].ToString().Trim();
- this.txtsingle.Text = tbl.Rows[0]["Hct_Oddnumber"].ToString().Trim();
- this.txtHusbandMobile.Text = tbl.Rows[0]["Hct_HusbandMobile"].ToString().Trim();
- this.cmbtreevBusinessIntent.Text = tbl.Rows[0]["Hct_BusinessIntention"].ToString().Trim();
- this.comboBoxTreeViewEx9.Text = tbl.Rows[0]["Hcr_BusinessType"].ToString().Trim();
- this.cbxRetail.Text = tbl.Rows[0]["Hct_Retail"].ToString().Trim();
- this.cbxCustomerGroups.Text = tbl.Rows[0]["Hct_CustomerGroups"].ToString().Trim();
- this.cbxArea.Text = tbl.Rows[0]["Hct_CustomerRegions"].ToString().Trim();
- this.cbxHospital.Text = tbl.Rows[0]["Hct_SingleHospital"].ToString().Trim();
- this.txtPregnantday.Text = tbl.Rows[0]["Hct_PregnantDay"].ToString().Trim();
- this.txtQQ.Text = tbl.Rows[0]["Hct_QQ"].ToString().Trim();
- this.txtHome.Text = tbl.Rows[0]["Hct_HomeAddress"].ToString().Trim();
- this.txtHomeZip.Text = tbl.Rows[0]["Hct_HomePostcode"].ToString().Trim();
- this.txtHomePhone.Text = tbl.Rows[0]["Hct_FamilyPhone"].ToString().Trim();
- this.txtHusband.Text = tbl.Rows[0]["Hct_HusbandAddress"].ToString().Trim();
- this.txtHusbandZip.Text = tbl.Rows[0]["Hct_HusbandPostcode"].ToString().Trim();
- this.txtFamilyPhone.Text = tbl.Rows[0]["Hct_Husbandphone"].ToString().Trim();
- this.txtParents.Text = tbl.Rows[0]["Hct_MaidenAddress"].ToString().Trim();
- this.txtParentsZip.Text = tbl.Rows[0]["Hct_MaidenPostcode"].ToString().Trim();
- this.txtMaidenCalls.Text = tbl.Rows[0]["Hct_Maidenphone"].ToString().Trim();
- this.txtRemark.Text = tbl.Rows[0]["Hct_Remarks"].ToString().Trim();
- this.datasingletime.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Hct_CreateDatetime"]);
- if (!string.IsNullOrEmpty(tbl.Rows[0]["Hct_BabyFeeding"].ToString().Trim()))
- { this.cbxFeeding.TextFindTag(tbl.Rows[0]["Hct_BabyFeeding"].ToString().Trim()); }
- if (tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "1")
- {
- TreeNode root = new TreeNode();
- root.Text = "已成交";
- root.Tag = "1";
- root.Name = "1";
- this.cmbtreevLostStatus.Nodes.Add(root);
- this.cmbtreevLostStatus.Enabled = false;
- }
- else
- {
- TreeNode root = new TreeNode();
- root.Text = "未成交";
- root.Tag = "0";
- root.Name = "0";
- this.cmbtreevLostStatus.Nodes.Add(root);
- root = new TreeNode();
- root.Text = "已流失";
- root.Tag = "2";
- root.Name = "2";
- this.cmbtreevLostStatus.Nodes.Add(root);
- if (tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "2")
- {
- this.panelLostRemark.Visible = true;
- this.txtLostRemark.Text = tbl.Rows[0]["Hct_LostRemark"].ToString().Trim();
- }
- }
- this.cmbtreevLostStatus.TagFindText(tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim());
- //this.cmbDealStatus.Text = tbl.Rows[0]["Hct_CustomerOrders"].ToString().Trim() == "0" ? "未成交" : "已成交";
- this.chkLunar.Checked = Convert.ToBoolean(tbl.Rows[0]["Hct_AreLunar"]);
- if (tbl.Rows[0]["Hct_BabySex"].ToString().Trim() == "男")
- { this.radioButtonEx1.Checked = true; }
- else
- { this.radioButtonEx2.Checked = true; }
- this.panelEx2.Visible = true;
- if (tbl.Rows[0]["Hct_BirthdayType"].ToString().Trim() == "0")
- {
- this.cbxBabyProfile.Checked = true;
- this.dateExpectedDate.DateValue = "";
- if (!string.IsNullOrEmpty(tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim()))
- { this.dateBabyBirthday.Text = LYFZ.Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim(), IsLunar: this.chkLunar.Checked); }
- }
- else
- {
- this.cbxPregnant.Checked = true;
- this.dateBabyBirthday.Text = "";
- this.dateExpectedDate.DateValue = tbl.Rows[0]["Hct_BabyBirthday"].ToString().Trim();
- }
- this.PublicFunctionRows3();
- this.PublicFunctionRows4();
- }
- else
- {
- TreeNode root = new TreeNode();
- root.Text = "未成交";
- root.Tag = "0";
- root.Name = "0";
- this.cmbtreevLostStatus.Nodes.Add(root);
- this.cmbtreevLostStatus.TagFindText("0");
- }
- this.PublicFunctionRows();
- this.PublicFunctionRows2();
- dtVendor = orbll.GetView_Custom("tb_ErpVendor", StrWhere: "", ShowColumnName: "Vd_Name", filedOrder: "ID").Tables[0];
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(
- VersionControl.VersionFunctionEnum.医院跟踪系统意向单录入);
- if (!b)
- {
- this.Close();
- }
- }
- /// <summary>
- /// 重置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void bntReset_Click(object sender, EventArgs e)
- {
- this.StrOrdNumber = "";
- this.txtLostRemark.Text = "";
- this.txtName.Text = "";
- this.txtCus_Telephone.Text = "";
- this.txtHusbandMobile.Text = "";
- this.txtQQ.Text = "";
- this.cbxRetail.Text = "";
- this.cbxCustomerGroups.Text = "";
- this.cmbtreevBusinessIntent.Text = "";
- this.cbxHospital.Text = "";
- this.cbxArea.Text = "";
- this.comboBoxTreeViewEx9.Text = "";
- this.txtsingle.Text = "";
- this.cmbtreevLostStatus.SetTextAndTag_ValueNull();
- this.dateExpectedDate.DateValue = "";
- this.txtPregnantday.Text = "";
- this.cbxFeeding.Text = "";
- this.txtBabyName.Text = "";
- this.dateBabyBirthday.Text = "";
- this.txtHome.Text = "";
- this.txtHomeZip.Text = "";
- this.txtHomePhone.Text = "";
- this.txtHusband.Text = "";
- this.txtHusbandZip.Text = "";
- this.txtFamilyPhone.Text = "";
- this.txtParents.Text = "";
- this.txtParentsZip.Text = "";
- this.txtMaidenCalls.Text = "";
- this.txtRemark.Text = "";
- this.cbxMessage.Checked = false;
- this.panelEx2.Visible = false;
- this.panelEx5.Visible = false;
- this.datasingletime.DateValue = SDateTime.Now.ToString("yyyy-MM-dd");
- this.radioButtonEx1.Checked = true;
- this.cbxBabyProfile.Checked = true;
- this.dgvTrackRecord.Rows.Clear();
- }
- /// <summary>
- /// 添加记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAdding_Click(object sender, EventArgs e)
- {
- AddingTrackRecord frm = new AddingTrackRecord();
- frm.StrOrderNumber = this.txtsingle.Text;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.tabControlEx1.SelectedIndex = 0;
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 选择预产期事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cbxPregnant_CheckedChanged(object sender, EventArgs e)
- {
- if (this.cbxPregnant.Checked == true)
- {
- this.panelEx4.Visible = true;
- this.panelEx3.Visible = false;
- this.cbxBabyProfile.Checked = false;
- this.panelEx4.Location = new Point(1, 91);
- }
- else
- { this.cbxBabyProfile.Checked = true; }
- }
- /// <summary>
- /// 选择宝宝资料事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cbxBabyProfile_CheckedChanged(object sender, EventArgs e)
- {
- if (this.cbxBabyProfile.Checked == true)
- {
- this.panelEx3.Visible = true;
- this.panelEx4.Visible = false;
- this.cbxPregnant.Checked = false;
- this.panelEx3.Location = new Point(1, 91);
- }
- else
- { this.cbxPregnant.Checked = true; }
- }
- /// <summary>
- /// 老公手机拨打电话按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonTel1_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtHusbandMobile); //手机
- }
- /// <summary>
- /// 本人手机拨打电话按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDial_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtCus_Telephone); //手机
- }
- /// <summary>
- /// QQ按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQQCall_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(this.txtQQ.Text.Trim()); //QQ
- }
- /// <summary>
- /// 生日离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dateBabyBirthday_Leave(object sender, EventArgs e)
- {
- int intMasse = this.dateBabyBirthday.CheckDateValue(this.dateBabyBirthday, chkLunar);
- if (intMasse == 1)
- { MessageBoxCustom.Show("宝贝生日日期格式输入错误"); this.IsBirthday = false; return; }
- else if (intMasse == 2)
- { MessageBoxCustom.Show("宝贝生日:" + this.dateBabyBirthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历"); this.IsBirthday = false; return; }
- this.IsBirthday = true;
- //if (this.dateBabyBirthday.DateValue != "")
- //{ this.dateBabyBirthday.DateValue = ""; }
- }
- /// <summary>
- /// QQ号只能输入数字事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtQQ_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 设置本人手机号只能为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtCus_Telephone_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 本人电话离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtCus_Telephone_Leave(object sender, EventArgs e)
- {
- string CusTelephone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
- if (CusTelephone.Trim().Length == 11)
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpCustomer", StrWhere: "Cus_Telephone = '" + CusTelephone.Trim() + "'", ShowColumnName: "ID,Cus_Name").Tables[0];
- if (dt.Rows.Count > 0)
- {
- //this.lblPrompt.Text = "温馨提示:电话[" + CusTelephone.Trim() + "],已有成交的订单,请核对!";
- //this.lblPrompt.Visible = true;
- if (MessageBoxCustom.Show("电话[" + CusTelephone.Trim() + "],已有成交的订单,是否要继续录入新的订单", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- {
- this.txtCus_Telephone.Text = CusTelephone.Substring(0, CusTelephone.Length - 1);
- this.txtCus_Telephone.ForCharMaskedTextBox();
- }
- else
- { this.txtName.Text = dt.Rows[0]["Cus_Name"].ToString().Trim(); }
- return;
- }
- DataTable dt2 = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_MyselfMobile = '" + CusTelephone.Trim() + "'", ShowColumnName: "ID,Hct_CustomerName").Tables[0];
- if (dt2.Rows.Count > 0)
- {
- //this.lblPrompt.Text = "温馨提示:电话[" + CusTelephone.Trim() + "],医院意向已有录好的订单,请核对!";
- //this.lblPrompt.Visible = true;
- if (MessageBoxCustom.Show("电话[" + CusTelephone.Trim() + "],医院意向已有录好的订单,是否要继续录入新的订单", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- {
- this.txtCus_Telephone.Text = CusTelephone.Substring(0, CusTelephone.Length - 1);
- this.txtCus_Telephone.ForCharMaskedTextBox();
- }
- else
- { this.txtName.Text = dt2.Rows[0]["Hct_CustomerName"].ToString().Trim(); }
- return;
- }
- }
- this.lblPrompt.Visible = false;
- }
- /// <summary>
- /// 设置老公手机只能输入数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtHusbandMobile_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 设置家庭电话只能为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtHomePhone_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == '-')
- { }
- else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 设置婆家电话只能为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtFamilyPhone_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == '-')
- { }
- else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 设置娘家手机只能为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtMaidenCalls_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == '-')
- { }
- else if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 自家邮编只能位数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtHomeZip_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 娘家邮编只为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtParentsZip_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 婆家邮编只为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtHusbandZip_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 设置怀孕天数只能为数字
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPregnantday_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 喂养方式设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonForm5_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAN";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAN", this.cbxFeeding); }
- }
- /// <summary>
- /// 业务意向设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonForm2_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAO";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAO", this.cmbtreevBusinessIntent); }
- }
- /// <summary>
- /// 客户区域设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonForm4_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAC";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAC", this.cbxArea); }
- }
- /// <summary>
- /// 业务种类设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonForm3_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAM";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAM", this.comboBoxTreeViewEx9); }
- }
- /// <summary>
- /// 来单医院设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonForm1_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAK";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAK", this.cbxHospital); }
- }
- /// <summary>
- /// 客户类别设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void butnSet2_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAL";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAL", this.cbxCustomerGroups); }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDelete_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.tabControlEx1.SelectedIndex == 0)
- {
- if (this.dgvTrackRecord.Rows.Count > 0 && this.dgvTrackRecord.CurrentCell.RowIndex >= 0 && this.dgvTrackRecord.CurrentCell.ColumnIndex >= 0 && this.dgvTrackRecord.SelectedRows.Count > 0)
- {
- if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- if (ambll1.Delete(Convert.ToInt32(this.dgvTrackRecord.SelectedRows[0].Cells["ID"].Value)))
- {
- MessageBoxCustom.Show("删除成功!");
- this.dgvTrackRecord.Rows.Remove(this.dgvTrackRecord.SelectedRows[0]);
- }
- else
- { MessageBoxCustom.Show("删除失败!"); }
- }
- }
- }
- else if (this.tabControlEx1.SelectedIndex == 1)
- {
- if (this.dgvData.Rows.Count > 0 && this.dgvData.CurrentCell.RowIndex >= 0 && this.dgvData.CurrentCell.ColumnIndex >= 0 && this.dgvData.SelectedRows.Count > 0)
- {
- if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- if (hddrbll.Delete(Convert.ToInt32(this.dgvData.SelectedRows[0].Cells["ID"].Value)))
- {
- MessageBoxCustom.Show("删除成功!");
- this.dgvData.Rows.Remove(this.dgvData.SelectedRows[0]);
- }
- else
- { MessageBoxCustom.Show("删除失败!"); }
- }
- }
- }
- else if (this.tabControlEx1.SelectedIndex == 2)
- {
- if (this.listViewData_Product.Items.Count > 0 && this.listViewData_Product.SelectedItems.Count > 0)
- {
- if (MessageBoxCustom.Show("你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- if (hptbll.Delete(Convert.ToInt32(ColumnModel.ProductOrderID)))
- {
- MessageBoxCustom.Show("删除成功!");
- //this.dgvData.Rows.Remove(this.dgvData.SelectedRows[0]);
- this.listViewData_Product.Items.Remove(this.listViewData_Product.SelectedItems[0]);
- }
- else
- { MessageBoxCustom.Show("删除失败!"); }
- }
- else
- { this.listViewData_Product.Items.Remove(this.listViewData_Product.SelectedItems[0]); }
- }
- }
- }
- else if (this.tabControlEx1.SelectedIndex == 3)
- {
- if (this.listViewData_Photo.Items.Count > 0)
- {
- if (this.listViewData_Photo.SelectedItems.Count > 0)
- {
- List<string> delList = new List<string>();
- List<ListViewItem> listItem = new List<ListViewItem>();
- for (int i = 0; i < this.listViewData_Photo.SelectedItems.Count; i++)
- {
- if (this.listViewData_Photo.SelectedItems[i].ForeColor != Color.Red)
- { delList.Add(this.listViewData_Photo.SelectedItems[i].Tag.ToString().Trim()); }
- listItem.Add(this.listViewData_Photo.SelectedItems[i]);
- }
- if (MessageBoxCustom.Show("您确定要删除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (delList.Count > 0)
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- for (int i = 0; i < delList.Count; i++)
- {
- backgroundWorker.ReportProgress(0, "正在删除" + System.IO.Path.GetFileNameWithoutExtension(delList[i].Trim()) + "...");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteHospitalPhoto(System.IO.Path.GetFileNameWithoutExtension(delList[i].Trim()) + ".jpg", this.StrOrdNumber, IsRecursion: true, DeleteDressType: 0);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteHospitalPhoto(System.IO.Path.GetFileName(delList[i].Trim()), this.StrOrdNumber, IsRecursion: true, DeleteDressType: 1);
- }
- });
- }
- for (int i = 0; i < listItem.Count; i++)
- { this.listViewData_Photo.Items.Remove(listItem[i]); }
- LYFZ.Model.Model_ErpHospitalClient model = hctbll.GetModel("Hct_Oddnumber", this.StrOrdNumber);
- if (model.ID > 0)
- {
- if (!string.IsNullOrEmpty(model.Hct_PhotoNames.Trim()))
- {
- List<string> StrArray = model.Hct_PhotoNames.Trim().Split('|').ToList();
- for (int j = 0; j < delList.Count; j++)
- {
- for (int i = 0; i < StrArray.Count; i++)
- {
- if (!string.IsNullOrEmpty(StrArray[i].Trim()))
- {
- if (StrArray[i].Trim() == System.IO.Path.GetFileName(delList[j].Trim()))
- {
- StrArray.Remove(StrArray[i]);
- break;
- }
- }
- }
- }
- string StrNewPhotoName = "";
- for (int i = 0; i < StrArray.Count; i++)
- {
- StrNewPhotoName += StrArray[i].Trim() + "|";
- }
- model.Hct_PhotoNames = StrNewPhotoName.TrimEnd('|');
- hctbll.Update(model);
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- /// <summary>
- /// 关闭窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnclose_Click(object sender, EventArgs e)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "关闭提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- { this.Close(); }
- }
- /// <summary>
- /// 添加派单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAddingSingle_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- AddingSendSingle frm = new AddingSendSingle();
- frm.StrOrderNumber = this.StrOrdNumber;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.tabControlEx1.SelectedIndex = 1;
- this.PublicFunctionRows2();
- }
- }
- else
- { MessageBoxCustom.Show("请选择客户进行添加!"); }
- }
- /// <summary>
- /// 修改派单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnUpdate_Click(object sender, EventArgs e)
- {
- if (this.dgvData.Rows.Count > 0 && this.dgvData.SelectedRows.Count > 0)
- {
- if (this.btnUpdate.Enabled)
- {
- AddingSendSingle frm = new AddingSendSingle();
- frm.TeskRow = this.dgvData.CurrentRow;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.tabControlEx1.SelectedIndex = 1;
- this.PublicFunctionRows2();
- }
- }
- }
- }
- /// <summary>
- /// 双击修改上门派单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { this.btnUpdate_Click(this, null); }
- }
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- this.btnDelete.Visible = true;
- this.btnUpdate.Visible = false;
- this.btnAddingSingle.Visible = false;
- this.btnAdding.Visible = false;
- this.btnPhotoExport.Visible = false;
- this.btnPhotoImport.Visible = false;
- this.btnAllSendOut.Visible = false;
- this.btnAllCompleted.Visible = false;
- this.btnAllPickup.Visible = false;
- this.btnProductToolbox.Visible = false;
- if (this.tabControlEx1.SelectedIndex == 0)
- {
- this.btnAdding.Visible = true;
- this.btnAddingSingle.Visible = true;
- }
- else if (this.tabControlEx1.SelectedIndex == 1)
- {
- this.btnAdding.Visible = true;
- this.btnAddingSingle.Visible = true; this.btnUpdate.Visible = true;
- }
- else if (this.tabControlEx1.SelectedIndex == 2)
- {
- this.btnAllPickup.Visible = true;
- this.btnAllCompleted.Visible = true;
- this.btnAllSendOut.Visible = true;
- this.btnProductToolbox.Visible = true;
- }
- else if (this.tabControlEx1.SelectedIndex == 3)
- {
- this.btnPhotoExport.Visible = true;
- this.btnPhotoImport.Visible = true;
- }
- }
- }
- /// <summary>
- /// 成效状态选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevLostStatus_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- if (e.Node.Tag != null)
- {
- if (e.Node.Tag.ToString().Trim() == "2")
- { this.panelLostRemark.Visible = true; }
- else
- { this.panelLostRemark.Visible = false; }
- }
- }
- /// <summary>
- /// 定义显示
- /// </summary>
- void PublicFunctionRows()
- {
- 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];
- if (tbl.Rows.Count > 0 && !string.IsNullOrEmpty(this.StrOrdNumber))
- {
- this.dgvTrackRecord.DataSource(tbl, strHideField: "ID");
- this.dgvTrackRecord.Columns["来单批号"].Width = 100;
- this.dgvTrackRecord.Columns["通话时间"].Width = 80;
- this.dgvTrackRecord.Columns["通话时长"].Width = 70;
- this.dgvTrackRecord.Columns["具体事项"].Width = 100;
- this.dgvTrackRecord.Columns["通话人员"].Width = 70;
- this.dgvTrackRecord.Columns["通话方式"].Width = 70;
- this.dgvTrackRecord.Columns["下次提醒时间"].Width = 90;
- }
- else
- { this.dgvTrackRecord.DataColumns(tbl.Columns, strHideField: "ID"); }
- this.dgvTrackRecord.FillLastColumn();
- }
- void PublicFunctionRows2()
- {
- 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 备注";
- DataTable dt = orbll.GetView_Custom("tb_ErpHospitalDispatchDoor", StrWhere: "Hdr_Number = '" + this.StrOrdNumber + "'", ShowColumnName: StrColumnName).Tables[0];
- if (dt.Rows.Count > 0 && !string.IsNullOrEmpty(this.StrOrdNumber))
- {
- this.dgvData.DataSource(dt, strHideField: "ID");
- this.dgvData.Columns["上门时间"].Width = 110;
- this.dgvData.Columns["上门状态"].Width = 70;
- this.dgvData.Columns["上门人员1"].Width = 70;
- this.dgvData.Columns["上门人员2"].Width = 70;
- this.dgvData.Columns["上门人员3"].Width = 70;
- this.dgvData.Columns["上门人员4"].Width = 70;
- this.dgvData.Columns["车辆"].Width = 90;
- }
- else
- { this.dgvData.DataColumns(dt.Columns, strHideField: "ID"); }
- this.dgvData.FillLastColumn();
- }
- void PublicFunctionRows3()
- {
- this.listViewData_Product.Items.Clear();
- string StrColumnName = "tb_ErpHospitalProduct.ID,Hpt_ProductSalesPrice,Hpt_ProductLessInventory,Hpt_ProductNumber,Hpt_ProductName,Hpt_ProductQuantity,Hpt_SendOutVendor,Hpt_SendOutName AS Hpt_SendOutNameNumber," +
- "dbo.fn_CheckUserIDGetUserName(Hpt_SendOutName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_SendOutDateTime)) AS Hpt_SendOutName," +
- "dbo.fn_CheckProductCompletedStatus(Hpt_CompletedStatus) AS Hpt_CompletedStatus,Hpt_CompletedName AS Hpt_CompletedNameNumber," +
- "dbo.fn_CheckUserIDGetUserName(Hpt_CompletedName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_CompletedDateTime)) AS Hpt_CompletedName," +
- "dbo.fn_CheckProductTakePiecesStatus(Hpt_PickupStatus) AS Hpt_PickupStatus,Hpt_PickupName AS Hpt_PickupNameNumber," +
- "dbo.fn_CheckUserIDGetUserName(Hpt_PickupName) + '/' + dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Hpt_PickupDateTime)) AS Hpt_PickupName," +
- "Hpt_Remark,Prod_Thumbnail";
- 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];
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = null;
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetProductImage(dt.Rows[i]["Prod_Thumbnail"].ToString().Trim());
- if (!this.mlistImage.Images.Keys.Contains(dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim()))
- { this.mlistImage.Images.Add(dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim(), img); }
- ListViewItem lvItem = new ListViewItem();
- ColumnModel = new SetCustomControls_HospitalProductColumnHeaderModel();
- ColumnModel.ProductOrderID = dt.Rows[i]["ID"].ToString().Trim();
- ColumnModel.ProductLessInventory = dt.Rows[i]["Hpt_ProductLessInventory"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.ImageKey = dt.Rows[i]["Hpt_ProductNumber"].ToString().Trim();
- lvItem.Text = dt.Rows[i]["Hpt_ProductName"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "商品价格";
- ListSubItem.Text = dt.Rows[i]["Hpt_ProductSalesPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "商品数量";
- ListSubItem.Text = dt.Rows[i]["Hpt_ProductQuantity"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "发出厂商";
- ListSubItem.Text = dt.Rows[i]["Hpt_SendOutVendor"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "发出人员";
- ListSubItem.Text = dt.Rows[i]["Hpt_SendOutName"].ToString().Trim();
- ListSubItem.Tag = dt.Rows[i]["Hpt_SendOutNameNumber"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "完成状态";
- ListSubItem.Text = dt.Rows[i]["Hpt_CompletedStatus"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "完成人员";
- ListSubItem.Text = dt.Rows[i]["Hpt_CompletedName"].ToString().Trim();
- ListSubItem.Tag = dt.Rows[i]["Hpt_CompletedNameNumber"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "取件状态";
- ListSubItem.Text = dt.Rows[i]["Hpt_PickupStatus"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "取件人员";
- ListSubItem.Text = dt.Rows[i]["Hpt_PickupName"].ToString().Trim();
- ListSubItem.Tag = dt.Rows[i]["Hpt_PickupNameNumber"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "备注";
- ListSubItem.Text = dt.Rows[i]["Hpt_Remark"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- if ((this.listViewData_Product.Items.Count % 2) > 0)
- { lvItem.BackColor = System.Drawing.Color.PapayaWhip; }
- else
- { lvItem.BackColor = System.Drawing.Color.PowderBlue; }
- this.listViewData_Product.Items.Add(lvItem);
- }
- }
- void PublicFunctionRows4()
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetHospitalImage_Small(this.listViewData_Photo, this.mlistImagePhoto, this.StrOrdNumber); }
- }
- /// <summary>
- /// 保存资料按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSavedData_Click(object sender, EventArgs e)
- {
- LYFZ.Model.Model_ErpHospitalClient model = null;
- DateTime strTime = SDateTime.Now;
- string StrPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
- string StrHusbandPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtHusbandMobile);
- if (StrPhone.Length > 0 && StrPhone.Length < 11)
- { MessageBoxCustom.Show("本人手机输入不完整!"); return; }
- if (StrHusbandPhone.Length > 0 && StrHusbandPhone.Length < 11)
- { MessageBoxCustom.Show("老公手机输入不完整!"); return; }
- if (string.IsNullOrEmpty(this.StrOrdNumber))
- {
- #region 检测数据不能为空
- if (this.txtName.Text == "")
- { MessageBoxCustom.Show("请输入客户姓名!"); return; }
- if (!this.cbxBabyProfile.Checked)
- {
- if (string.IsNullOrEmpty(this.dateExpectedDate.DateValue))
- { MessageBoxCustom.Show("请输入 预产期!"); return; }
- else
- {
- if (this.txtPregnantday.Text == "")
- { MessageBoxCustom.Show("请输入怀孕天数"); return; }
- }
- }
- if (this.datasingletime.Text == "")
- { MessageBoxCustom.Show("请输入来单日期!"); return; }
- if (this.cbxCustomerGroups.Text == "")
- { MessageBoxCustom.Show("请选择客户类别!"); return; }
- if (this.cbxRetail.Text == "")
- { MessageBoxCustom.Show("请输入门市人员"); return; }
- if (this.cbxHospital.Text == "")
- { MessageBoxCustom.Show("请选择来单医院"); return; }
- if (this.cmbtreevLostStatus.Visible)
- {
- if (string.IsNullOrEmpty(this.cmbtreevLostStatus.Text.Trim()))
- { MessageBoxCustom.Show("请选择成交状态"); return; }
- }
- this.dateBabyBirthday_Leave(this, e);
- if (!this.IsBirthday)
- { return; }
- #endregion
- model = new Model.Model_ErpHospitalClient();
- model.Hct_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- model.Hct_CustomerName = this.txtName.Text.ToString().Trim();
- model.Hct_BabyName = this.txtBabyName.Text.ToString().Trim();
- // 老公姓名;
- model.Hct_HusbandName = this.txtHusbandName.Text.ToString().Trim();
- if (this.radioButtonEx1.Checked == true)
- { model.Hct_BabySex = "男"; }
- else
- { model.Hct_BabySex = "女"; }
- if (this.cbxBabyProfile.Checked)
- {
- model.Hct_BirthdayType = 0;
- model.Hct_BabyBirthday = this.dateBabyBirthday.StrValue.Trim();
- model.Hct_AreLunar = this.chkLunar.Checked;
- }
- else if (this.cbxPregnant.Checked)
- {
- model.Hct_BirthdayType = 1;
- model.Hct_BabyBirthday = this.dateExpectedDate.Text.Trim();
- model.Hct_AreLunar = false;
- }
- if (this.cbxMessage.Checked == true)
- { model.Hct_MessageSingle = "是"; }
- else
- { model.Hct_MessageSingle = "否"; }
- model.Hct_CustomerOrders = Convert.ToInt32(this.cmbtreevLostStatus.Tag);
- model.Hct_LostRemark = "";
- model.Hct_OrderNumber = "";
- model.Hct_BabyFeeding = this.cbxFeeding.Text.ToString().Trim();
- model.Hct_SingleDatetime = Convert.ToDateTime(this.datasingletime.DateValue.Trim());
- model.Hct_Oddnumber = hctbll.GenerationNumber();
- model.Hct_CustomerGroups = this.cbxCustomerGroups.Text.ToString().Trim();
- model.Hct_Retail = this.cbxRetail.Text.ToString().Trim();
- model.Hct_CustomerRegions = this.cbxArea.Text.Trim().ToString();
- model.Hct_SingleHospital = this.cbxHospital.Text.ToString().Trim();
- if (this.txtPregnantday.Text == "")
- { model.Hct_PregnantDay = 0; }
- else
- { model.Hct_PregnantDay = Convert.ToInt32(this.txtPregnantday.Text.Trim()); }
- model.Hct_QQ = this.txtQQ.Text.Trim().ToString();
- model.Hct_Remarks = this.txtRemark.Text.ToString().Trim();
- model.Hct_MyselfMobile = StrPhone;
- model.Hct_HusbandMobile = StrHusbandPhone;
- model.Hct_FamilyPhone = this.txtHomePhone.Text.Trim();
- model.Hct_Husbandphone = this.txtFamilyPhone.Text.Trim();
- model.Hct_Maidenphone = this.txtMaidenCalls.Text.Trim();
- model.Hct_HomeAddress = this.txtHome.Text.ToString().Trim();
- model.Hct_HomePostcode = this.txtHomeZip.Text.ToString().Trim();
- model.Hct_HusbandAddress = this.txtHusband.Text.ToString().Trim();
- model.Hct_HusbandPostcode = this.txtHusbandZip.Text.ToString().Trim();
- model.Hct_MaidenAddress = this.txtParents.Text.ToString().Trim();
- model.Hct_MaidenPostcode = this.txtParentsZip.Text.Trim().ToString();
- model.Hcr_BusinessType = this.comboBoxTreeViewEx9.Text.Trim().ToString();
- model.Hct_BusinessIntention = this.cmbtreevBusinessIntent.Text.Trim().ToString();
- string phone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
- model.Hct_CreateDatetime = strTime;
- model.Hct_CreateName = strUserID;
- if (hctbll.Add(model))
- {
- this.StrOrdNumber = model.Hct_Oddnumber;
- MessageBoxCustom.Show("保存成功");
- if (this.cbxMessage.Checked == true)
- { this.SendGenerateEventSMS(model.Hct_Oddnumber); }
- //this.txtsingle.Text = model.Hct_Oddnumber;
- //this.txtsingle.Visible = true;
- string strContent = "本人手机:" + model.Hct_MyselfMobile;
- if (!String.IsNullOrEmpty(model.Hct_HusbandMobile))
- {
- strContent += ",老公手机:" + model.Hct_HusbandMobile;
- }
- if (!String.IsNullOrEmpty(model.Hct_BabyName))
- {
- strContent += ",宝贝姓名:" + model.Hct_BabyName;
- }
- 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);
- this.IntentionsEntered_Shown(this, null);
- }
- else
- { MessageBoxCustom.Show("保存失败"); }
- }
- else
- {
- #region 检测数据不能为空
- if (this.txtName.Text == "")
- { MessageBoxCustom.Show("请输入客户姓名!"); return; }
- if (!this.cbxBabyProfile.Checked)
- {
- if (string.IsNullOrEmpty(this.dateExpectedDate.DateValue))
- { MessageBoxCustom.Show("请输入 预产期!"); return; }
- else
- {
- if (this.txtPregnantday.Text == "")
- { MessageBoxCustom.Show("请输入怀孕天数"); return; }
- }
- }
- if (this.datasingletime.Text == "")
- { MessageBoxCustom.Show("请输入来单日期!"); return; }
- if (this.cbxCustomerGroups.Text == "")
- { MessageBoxCustom.Show("请选择客户类别!"); return; }
- if (this.cbxRetail.Text == "")
- { MessageBoxCustom.Show("请输入门市人员"); return; }
- if (this.cbxHospital.Text == "")
- { MessageBoxCustom.Show("请选择来单医院"); return; }
- if (string.IsNullOrEmpty(this.cmbtreevLostStatus.Text.Trim()))
- { MessageBoxCustom.Show("请选择成交状态"); return; }
- this.dateBabyBirthday_Leave(this, e);
- if (!this.IsBirthday)
- { return; }
- #endregion
- string Strs = this.txtPregnantday.Text.Trim();
- model = hctbll.GetModel("Hct_Oddnumber", this.txtsingle.Text.Trim());
- model.Hct_CustomerName = this.txtName.Text.ToString().Trim();
- model.Hct_BabyName = this.txtBabyName.Text.ToString().Trim();
- model.Hct_CustomerOrders = Convert.ToInt32(this.cmbtreevLostStatus.Tag);
- model.Hct_HusbandName = this.txtHusbandName.Text.ToString().Trim();
- if (this.panelLostRemark.Visible)
- { model.Hct_LostRemark = this.txtLostRemark.Text.Trim(); }
- else
- { model.Hct_LostRemark = ""; }
- if (this.radioButtonEx1.Checked)
- { model.Hct_BabySex = "男"; }
- else
- { model.Hct_BabySex = "女"; }
- if (this.cbxBabyProfile.Checked)
- {
- model.Hct_BirthdayType = 0;
- if (this.dateBabyBirthday.StrValue != "")
- { model.Hct_BabyBirthday = LYFZ.Command.Command_Validate.DateTimeToString(this.dateBabyBirthday.StrValue); }
- else
- { model.Hct_BabyBirthday = ""; }
- model.Hct_AreLunar = this.chkLunar.Checked;
- }
- else if (this.cbxPregnant.Checked)
- {
- model.Hct_BirthdayType = 1;
- model.Hct_BabyBirthday = this.dateExpectedDate.Text.Trim();
- model.Hct_AreLunar = false;
- }
- if (this.cbxMessage.Checked)
- { model.Hct_MessageSingle = "是"; }
- else
- { model.Hct_MessageSingle = "否"; }
- if (this.txtPregnantday.Text == "")
- { model.Hct_PregnantDay = 0; }
- model.Hct_BabyFeeding = this.cbxFeeding.Text.ToString().Trim();
- model.Hct_SingleDatetime = Convert.ToDateTime(this.datasingletime.DateValue.Trim());
- model.Hct_Oddnumber = this.txtsingle.Text.Trim();
- model.Hct_CustomerGroups = this.cbxCustomerGroups.Text.ToString().Trim();
- model.Hct_Retail = this.cbxRetail.Text.ToString().Trim();
- model.Hct_CustomerRegions = this.cbxArea.Text.Trim().ToString();
- model.Hct_SingleHospital = this.cbxHospital.Text.ToString().Trim();
- if (this.txtPregnantday.Text != "")
- { model.Hct_PregnantDay = Convert.ToInt32(this.txtPregnantday.Text); }
- else
- { model.Hct_PregnantDay = Convert.ToInt32(Strs); }
- model.Hct_QQ = this.txtQQ.Text.Trim().ToString();
- model.Hct_Remarks = this.txtRemark.Text.ToString().Trim();
- model.Hct_MyselfMobile = StrPhone;
- model.Hct_HusbandMobile = StrHusbandPhone;
- model.Hct_FamilyPhone = this.txtHomePhone.Text.Trim();
- model.Hct_Husbandphone = this.txtFamilyPhone.Text.Trim();
- model.Hct_Maidenphone = this.txtMaidenCalls.Text.Trim();
- model.Hct_HomeAddress = this.txtHome.Text.ToString().Trim();
- model.Hct_HomePostcode = this.txtHomeZip.Text.ToString().Trim();
- model.Hct_HusbandAddress = this.txtHusband.Text.ToString().Trim();
- model.Hct_HusbandPostcode = this.txtHusbandZip.Text.ToString().Trim();
- model.Hct_MaidenAddress = this.txtParents.Text.ToString().Trim();
- model.Hct_MaidenPostcode = this.txtParentsZip.Text.Trim().ToString();
- model.Hcr_BusinessType = this.comboBoxTreeViewEx9.Text.Trim().ToString();
- model.Hct_BusinessIntention = this.cmbtreevBusinessIntent.Text.Trim().ToString();
- model.Hct_UpdateDatetime = strTime;
- model.Hct_UpdateName = strUserID;
- if (hctbll.Update(model))
- {
- this.IsSaveed = true;
- MessageBoxCustom.Show("更新成功");
- string strContent = "本人手机:" + model.Hct_MyselfMobile;
- if (!String.IsNullOrEmpty(model.Hct_HusbandMobile))
- {
- strContent += ",老公手机:" + model.Hct_HusbandMobile;
- }
- if (!String.IsNullOrEmpty(model.Hct_BabyName))
- {
- strContent += ",宝贝姓名:" + model.Hct_BabyName;
- }
- 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);
- PublicFunctionRows();
- }
- else
- { MessageBoxCustom.Show("更新失败"); }
- }
- }
- /// <summary>
- /// 发送来单短信
- /// </summary>
- /// <param name="_OrderNumber"></param>
- void SendGenerateEventSMS(string _OrderNumber)
- {
- LYFZ.BLL.BLL_SMSTemplates smstBll = new BLL.BLL_SMSTemplates();
- Model.SMSParameters sMSParameters = new Model.SMSParameters();
- sMSParameters.OrderNumber = _OrderNumber;
- sMSParameters.IsHospitalTrackingSystem = true;
- smstBll.GenerateEventSMS(EnumPublic.SmsSendEvent.来单录入后X分钟, sMSParameters);
- }
- /// <summary>
- /// 相片导入
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnPhotoImport_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber))
- {
- OpenFileDialog fileDialog = new OpenFileDialog();
- fileDialog.Filter = "图片文件(*.jpg)|*.jpg|图片文件(*.bmp)|*.bmp|图片文件(*.png)|*.png";
- fileDialog.FileName = "";
- fileDialog.Multiselect = true;
- if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- List<string> StrPathList = fileDialog.FileNames.ToList();
- string StrPhotoNames = "";
- for (int i = 0; i < StrPathList.Count; i++)
- {
- FileInfo f = new FileInfo(StrPathList[i].Trim());
- if (f.Length > 30000000)
- { MessageBoxCustom.Show("图片过大,建议使用大小在30M以内的图片"); return; }
- StrPhotoNames += System.IO.Path.GetFileName(StrPathList[i].Trim()) + "|";
- }
- LYFZ.Model.Model_ErpHospitalClient model = hctbll.GetModel("Hct_Oddnumber", this.StrOrdNumber);
- if (model.ID > 0)
- {
- if (!string.IsNullOrEmpty(model.Hct_PhotoNames.Trim()))
- {
- string[] StrArray = model.Hct_PhotoNames.Trim().Split('|');
- for (int i = 0; i < StrArray.Length; i++)
- {
- if (!string.IsNullOrEmpty(StrArray[i].Trim()))
- {
- for (int j = 0; j < StrPathList.Count; j++)
- {
- if (System.IO.Path.GetFileNameWithoutExtension(StrArray[i].Trim()) == System.IO.Path.GetFileNameWithoutExtension(StrPathList[j].Trim()))
- { MessageBoxCustom.Show("相片名称‘" + System.IO.Path.GetFileNameWithoutExtension(StrPathList[j].Trim()) + "’已存在,不能重复导入!"); return; }
- }
- }
- }
- model.Hct_PhotoNames += "|" + StrPhotoNames.TrimEnd('|');
- }
- else
- { model.Hct_PhotoNames = StrPhotoNames.TrimEnd('|'); }
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- for (int i = 0; i < StrPathList.Count; i++)
- {
- backgroundWorker.ReportProgress(0, "正在上传" + (i + 1) + "...");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateHospitalPhoto(StrPathList[i].Trim(), this.StrOrdNumber, IsRecursion: true, UpdateDressType: 0);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateHospitalPhoto(StrPathList[i].Trim(), this.StrOrdNumber, IsRecursion: true, UpdateDressType: 1);
- }
- });
- hctbll.Update(model);
- }
- this.PublicFunctionRows4();
- }
- }
- }
- /// <summary>
- /// 相片导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnPhotoExport_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber.Trim()))
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpHospitalClient", StrWhere: "Hct_Oddnumber = '" + this.StrOrdNumber + "'", ShowColumnName: "Hct_PhotoNames").Tables[0];
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["Hct_PhotoNames"].ToString().Trim()))
- {
- string[] StrArray = dt.Rows[0]["Hct_PhotoNames"].ToString().Trim().Split('|');
- FolderBrowserDialog fbd = new FolderBrowserDialog();
- if (fbd.ShowDialog() == DialogResult.OK)
- {
- string StrDownPath = "";
- int whileCount = 0;
- bool IsFind = false;
- while (!IsFind)
- {
- StrDownPath = fbd.SelectedPath.ToString().Trim() + "\\" + this.StrOrdNumber;
- if (whileCount > 0)
- { StrDownPath += "_" + whileCount; }
- if (!Directory.Exists(StrDownPath))
- { IsFind = true; }
- whileCount++;
- }
- if (!Directory.Exists(StrDownPath))
- {
- System.IO.Directory.CreateDirectory(StrDownPath);
- }
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- for (int i = 0; i < StrArray.Length; i++)
- {
- if (!string.IsNullOrEmpty(StrArray[i].Trim()))
- {
- string StrPhotoName = StrArray[i].Trim();
- backgroundWorker.ReportProgress(0, "共" + StrArray.Length + "张,正在导出第" + (i + 1).ToString() + "张...");
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetHospitalImage_Original(this.StrOrdNumber, StrPhotoName.Trim(), IsShowDefaultPhoto: false);
- if (img != null)
- {
- bool IsShow = false;
- if (i == StrArray.Length - 1)
- { IsShow = true; }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DownloadToDirectory(img, StrDownPath + "\\" + StrArray[i].Trim(), IsShowPromptOK: IsShow);
- }
- }
- }
- });
- }
- }
- }
- }
- }
- /// <summary>
- /// 商品工具箱
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnProductToolbox_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrOrdNumber.Trim()))
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm();
- frm.LoadType = "套系包含商品";
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<LYFZ.Model.Model_ErpProduct> mlist = frm.mlist;
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<CommandInfo>();
- LYFZ.Model.Model_ErpHospitalProduct model = null;
- for (int i = 0; i < mlist.Count; i++)
- {
- model = new Model.Model_ErpHospitalProduct();
- model.Hpt_Number = "HPT_" + LYFZ.WinAPI.CustomPublicMethod.GenerateId().ToString().Trim();
- model.Hpt_OrderNumber = this.StrOrdNumber;
- model.Hpt_ProductNumber = mlist[i].Prod_Number.Trim();
- model.Hpt_ProductName = mlist[i].Prod_Name.Trim();
- model.Hpt_ProductClass = mlist[i].Prod_Class.ToString().Trim();
- model.Hpt_ProductCostPrice = mlist[i].Prod_CostPrice;
- model.Hpt_ProductSalesPrice = mlist[i].Prod_SalesPrice;
- model.Hpt_ProductBatch = mlist[i].Prod_Batch;
- model.Hpt_ProductUnit = mlist[i].Prod_Unit;
- model.Hpt_ProductQuantity = Convert.ToInt32("1");
- model.Hpt_ProductLessInventory = mlist[i].Prod_Availability;
- model.Hpt_HadLessInventoryQuantity = 0;
- model.Hpt_SendOutVendor = "";
- model.Hpt_SendOutName = "";
- model.Hpt_SendOutStatus = 0;
- model.Hpt_CompletedName = "";
- model.Hpt_CompletedStatus = 0;
- model.Hpt_PickupName = "";
- model.Hpt_PickupStatus = 0;
- model.Hpt_Remark = "";
- model.Hpt_CreateDateTime = StrTime;
- model.Hpt_CreateName = strUserID;
- model.Hpt_UpdateName = "";
- clist.Add(hptbll.GetAddCommandInfo(model));
- }
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- { this.PublicFunctionRows3(); }
- else
- { MessageBoxCustom.Show("添加产品失败!"); return; }
- }
- }
- }
- }
- class SetCustomControls_HospitalProductColumnHeaderModel
- {
- private string _ProductOrderID;
- private string _ProductLessInventory;
- /// <summary>
- /// 订单商品ID
- /// </summary>
- public string ProductOrderID
- {
- get { return _ProductOrderID; }
- set { _ProductOrderID = value; }
- }
- /// <summary>
- /// 是否要减库存
- /// </summary>
- public string ProductLessInventory
- {
- get { return _ProductLessInventory; }
- set { _ProductLessInventory = value; }
- }
- }
- /// <summary>
- /// 全部发出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAllSendOut_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Product.Items.Count > 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm();
- frm.ShowDialog();
- if (frm.DictDataArray.ContainsKey("VendorName"))
- {
- string StrVendor = frm.DictDataArray["VendorName"].ToString().Trim();
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_SendOutStatus == 0)
- {
- model.Hpt_SendOutStatus = 1;
- model.Hpt_SendOutVendor = StrVendor;
- model.Hpt_SendOutDateTime = StrTime;
- model.Hpt_SendOutName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- if (MessageBoxCustom.Show("您确定要发出吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- MessageBoxCustom.Show("发出成功!");
- this.PublicFunctionRows3();
- }
- else
- { MessageBoxCustom.Show("发出失败!"); }
- }
- }
- }
- }
- /// <summary>
- /// 全部完成
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAllCompleted_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Product.Items.Count > 0)
- {
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_CompletedStatus == 0)
- {
- model.Hpt_CompletedStatus = 1;
- model.Hpt_CompletedDateTime = StrTime;
- model.Hpt_CompletedName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- if (MessageBoxCustom.Show("您确定要完成吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- MessageBoxCustom.Show("完成成功!");
- this.PublicFunctionRows3();
- }
- else
- { MessageBoxCustom.Show("完成失败!"); }
- }
- }
- }
- /// <summary>
- /// 全部取走
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAllPickup_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Product.Items.Count > 0)
- {
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- for (int i = 0; i < this.listViewData_Product.Items.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.Items[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_PickupStatus == 0)
- {
- model.Hpt_PickupStatus = 1;
- model.Hpt_PickupDateTime = StrTime;
- model.Hpt_PickupName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- if (MessageBoxCustom.Show("您确定要取件吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- MessageBoxCustom.Show("取件成功!");
- this.PublicFunctionRows3();
- }
- else
- { MessageBoxCustom.Show("取件失败!"); }
- }
- }
- }
- /// <summary>
- /// 双击修改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Product_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- //商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注
- this.txtText.Visible = false;
- this.cmbtreevText.Visible = false;
- this.cmbtreevText.Nodes.Clear();
- ListViewHitTestInfo info = this.listViewData_Product.HitTest(e.X, e.Y);
- if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
- {
- TreeNode root = null;
- Rectangle rect = info.SubItem.Bounds;
- switch (info.SubItem.Name.Trim())
- {
- case "发出厂商":
- this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
- this.cmbtreevText.Size = rect.Size;
- root = new TreeNode();
- root.Text = "";
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- for (int i = 0; i < dtVendor.Rows.Count; i++)
- {
- root = new TreeNode();
- root.Text = dtVendor.Rows[i]["Vd_Name"].ToString().Trim();
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- }
- this.cmbtreevText.Visible = true;
- this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
- this.cmbtreevText.Focus();
- break;
- case "完成状态":
- this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
- this.cmbtreevText.Size = rect.Size;
- this.cmbtreevText.Visible = true;
- root = new TreeNode();
- root.Text = "完成";
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- root = new TreeNode();
- root.Text = "未完";
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
- this.cmbtreevText.Focus();
- break;
- case "取件状态":
- this.cmbtreevText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 4);
- this.cmbtreevText.Size = rect.Size;
- this.cmbtreevText.Visible = true;
- root = new TreeNode();
- root.Text = "取件";
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- root = new TreeNode();
- root.Text = "未取";
- root.Tag = info.SubItem.Name.Trim();
- this.cmbtreevText.Nodes.Add(root);
- this.cmbtreevText.TextFindTag(info.SubItem.Text.Trim());
- this.cmbtreevText.Focus();
- break;
- case "备注":
- this.txtText.Location = new Point(rect.Location.X + this.listViewData_Product.Location.X + 3, rect.Location.Y + this.listViewData_Product.Location.Y + 2);
- this.txtText.Size = rect.Size;
- this.txtText.Visible = true;
- this.txtText.Tag = info.SubItem.Name.Trim();
- this.txtText.Text = info.SubItem.Text.Trim();
- this.txtText.Focus();
- break;
- }
- }
- }
- /// <summary>
- /// 滚动条滚动事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Product_Scroll(object sender, EventArgs e)
- {
- this.txtText.Visible = false;
- this.cmbtreevText.Visible = false;
- }
- /// <summary>
- /// 发出、完成、取件离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevText_Leave(object sender, EventArgs e)
- {
- if (this.cmbtreevText.Tag != null)
- {
- DateTime StrTime = SDateTime.Now;
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- switch (this.cmbtreevText.Tag.ToString().Trim())
- {
- case "发出厂商":
- if (!string.IsNullOrEmpty(this.cmbtreevText.Text.Trim()))
- {
- if (model.Hpt_SendOutStatus == 1)
- { break; }
- model.Hpt_SendOutStatus = 1;
- model.Hpt_SendOutName = this.strUserID;
- model.Hpt_SendOutDateTime = StrTime;
- }
- else
- {
- model.Hpt_SendOutStatus = 0;
- model.Hpt_SendOutName = "";
- model.Hpt_SendOutDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- model.Hpt_SendOutVendor = this.cmbtreevText.Text.Trim();
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- hptbll.Update(model);
- break;
- case "完成状态":
- if (this.cmbtreevText.Text.Trim() == "完成")
- {
- if (model.Hpt_CompletedStatus == 1)
- { break; }
- model.Hpt_CompletedStatus = 1;
- model.Hpt_CompletedName = this.strUserID;
- model.Hpt_CompletedDateTime = StrTime;
- }
- else
- {
- model.Hpt_CompletedStatus = 0;
- model.Hpt_CompletedName = "";
- model.Hpt_CompletedDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- hptbll.Update(model);
- break;
- case "取件状态":
- if (this.cmbtreevText.Text.Trim() == "取件")
- {
- if (model.Hpt_PickupStatus == 1)
- { break; }
- model.Hpt_PickupStatus = 1;
- model.Hpt_PickupName = this.strUserID;
- model.Hpt_PickupDateTime = StrTime;
- }
- else
- {
- model.Hpt_PickupStatus = 0;
- model.Hpt_PickupName = "";
- model.Hpt_PickupDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- model.Hpt_UpdateDateTime = SDateTime.Now;
- model.Hpt_UpdateName = this.strUserID;
- hptbll.Update(model);
- break;
- }
- this.PublicFunctionRows3();
- }
- this.cmbtreevText.Visible = false;
- }
- /// <summary>
- /// 备注离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtText_Leave(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[0].Tag;
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- model.Hpt_Remark = this.txtText.Text.Trim();
- model.Hpt_UpdateDateTime = SDateTime.Now;
- model.Hpt_UpdateName = this.strUserID;
- hptbll.Update(model);
- this.listViewData_Product.SelectedItems[0].SubItems["备注"].Text = this.txtText.Text.Trim();
- this.txtText.Visible = false;
- }
- /// <summary>
- /// 点击右键
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Product_MouseDown(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Right)
- {
- if (this.listViewData_Product.Items.Count > 0)
- {
- LYFZ.ComponentLibrary.ContextMenuStripEx contextmenu = new ContextMenuStripEx();
- contextmenu.Name = "Source";
- contextmenu.ItemClicked += contextmenu_ItemClicked;
- //弹出操作菜单
- contextmenu.Items.Clear();
- contextmenu.Show(MousePosition.X, MousePosition.Y);
- ListViewHitTestInfo info = this.listViewData_Product.HitTest(e.X, e.Y);
- if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
- {
- ToolStripMenuItem item = null;
- //商品名称,商品价格,商品数量,发出厂商,发出人员,完成状态,完成人员,取件状态,取件人员,备注
- Rectangle rect = info.SubItem.Bounds;
- switch (info.SubItem.Name.Trim())
- {
- case "发出厂商":
- item = new ToolStripMenuItem();
- item.Text = "发出";
- contextmenu.Items.Add(item);
- item = new ToolStripMenuItem();
- item.Text = "取消发出";
- contextmenu.Items.Add(item);
- break;
- case "完成状态":
- item = new ToolStripMenuItem();
- item.Text = "完成";
- contextmenu.Items.Add(item);
- item = new ToolStripMenuItem();
- item.Text = "取消完成";
- contextmenu.Items.Add(item);
- break;
- case "取件状态":
- item = new ToolStripMenuItem();
- item.Text = "取件";
- contextmenu.Items.Add(item);
- item = new ToolStripMenuItem();
- item.Text = "取消取件";
- contextmenu.Items.Add(item);
- break;
- }
- }
- if (contextmenu.Items.Count > 0)
- {
- ToolStripSeparator tools = new ToolStripSeparator();
- contextmenu.Items.Add(tools);
- contextmenu.Show();
- }
- }
- }
- }
- /// <summary>
- /// 右键选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void contextmenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
- {
- ToolStripItem item = e.ClickedItem;
- if (!string.IsNullOrEmpty(item.Text.Trim()))
- {
- DateTime StrTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<CommandInfo>();
- switch (item.Text.Trim())
- {
- case "发出":
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.VendorSelectionSuperSmallForm();
- frm.ShowDialog();
- if (frm.DictDataArray.ContainsKey("VendorName"))
- {
- string StrVendor = frm.DictDataArray["VendorName"].ToString().Trim();
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_SendOutStatus == 0)
- {
- model.Hpt_SendOutStatus = 1;
- model.Hpt_SendOutVendor = StrVendor;
- model.Hpt_SendOutDateTime = StrTime;
- model.Hpt_SendOutName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- }
- break;
- case "取消发出":
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_SendOutStatus == 0)
- {
- model.Hpt_SendOutStatus = 0;
- model.Hpt_SendOutVendor = "";
- model.Hpt_SendOutDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- model.Hpt_SendOutName = "";
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- break;
- case "完成":
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_CompletedStatus == 0)
- {
- model.Hpt_CompletedStatus = 1;
- model.Hpt_CompletedDateTime = StrTime;
- model.Hpt_CompletedName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- break;
- case "取消完成":
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_CompletedStatus == 0)
- {
- model.Hpt_CompletedStatus = 0;
- model.Hpt_CompletedDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- model.Hpt_CompletedName = "";
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- break;
- case "取件":
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_PickupStatus == 0)
- {
- model.Hpt_PickupStatus = 1;
- model.Hpt_PickupDateTime = StrTime;
- model.Hpt_PickupName = this.strUserID;
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- break;
- case "取消取件":
- for (int i = 0; i < this.listViewData_Product.SelectedItems.Count; i++)
- {
- LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered.SetCustomControls_HospitalProductColumnHeaderModel ColumnModel = (SetCustomControls_HospitalProductColumnHeaderModel)this.listViewData_Product.SelectedItems[i].Tag;
- if (!string.IsNullOrEmpty(ColumnModel.ProductOrderID.Trim()))
- {
- LYFZ.Model.Model_ErpHospitalProduct model = hptbll.GetModel(Convert.ToInt32(ColumnModel.ProductOrderID));
- if (model.Hpt_PickupStatus == 0)
- {
- model.Hpt_PickupStatus = 0;
- model.Hpt_PickupDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- model.Hpt_PickupName = "";
- model.Hpt_UpdateDateTime = StrTime;
- model.Hpt_UpdateName = this.strUserID;
- clist.Add(hptbll.GetUpdateCommandInfo(model));
- }
- }
- }
- break;
- }
- if (MessageBoxCustom.Show("您确定要" + item.Text.Trim() + "吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- MessageBoxCustom.Show(item.Text.Trim() + "成功!");
- this.PublicFunctionRows3();
- }
- else
- { MessageBoxCustom.Show(item.Text.Trim() + "失败!"); }
- }
- }
- }
- /// <summary>
- /// 双击放大
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Photo_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (this.listViewData_Photo.Items.Count > 0 && this.listViewData_Photo.SelectedItems.Count > 0)
- {
- if (!string.IsNullOrEmpty(this.listViewData_Photo.SelectedItems[0].Tag.ToString().Trim()))
- {
- 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);
- if (btmp != null)
- {
- LYFZ.Software.MainBusiness.InitialSet.Product.FrmProductPic frm = new InitialSet.Product.FrmProductPic();
- frm.FrmImage = btmp;
- frm.WindowState = FormWindowState.Maximized;
- frm.Show();
- }
- else
- { MessageBoxCustom.Show("未找到相片!"); return; }
- }
- }
- }
- }
- }
|