1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986 |
- using LYFZ.ComponentLibrary;
- using LYFZ.Model.API;
- using LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess
- {
- public partial class OnSingleFormMain01 : LYFZ.Software.UI.DoorCityProcess.OnSingleFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpStyle stbll = new BLL.BLL_ErpStyle();
- LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
- LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL.BLL_ErpCustomer();
- LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
- LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
- LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
- LYFZ.BLL.BLL_ErpOrdersPerson orpbll = new BLL.BLL_ErpOrdersPerson();
- LYFZ.BLL.BLL_SMSTemplates smsTemplates = new BLL.BLL_SMSTemplates();
- LYFZ.BLL.BLL_ErpCustomerGroup cgbll = new BLL.BLL_ErpCustomerGroup();
- LYFZ.BLL.BLL_ErpHospitalClient hcbll = new BLL.BLL_ErpHospitalClient();
- LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
- LYFZ.BLL.BLL_ErpOrderProductLOG ptlog = new BLL.BLL_ErpOrderProductLOG();
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.BLL.BLL_ErpOrderProductList libll = new BLL.BLL_ErpOrderProductList();
- LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
- LYFZ.BLL.BLL_ErpMemberCardPoints mcptsbll = new BLL.BLL_ErpMemberCardPoints();
- LYFZ.BLL.BLL_ErpOrderNumberRecord ornrbll = new BLL.BLL_ErpOrderNumberRecord();
- LYFZ.BLL.BLL_ErpMemberCardViceCard mcvbll = new BLL.BLL_ErpMemberCardViceCard();
- LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
- LYFZ.BLL.BLL_ErpMemberCardBackCash mcbcbll = new BLL.BLL_ErpMemberCardBackCash();
- LYFZ.BLL.BLL_ErpCustomerGroupMembers cgmbll = new BLL.BLL_ErpCustomerGroupMembers();
- LYFZ.BLL.BLL_ErpMemberCardOperateLOG mcopbll = new BLL.BLL_ErpMemberCardOperateLOG();
- LYFZ.BLL.BLL_ErpMemberCardPointsLOG mcpslogbll = new BLL.BLL_ErpMemberCardPointsLOG();
- LYFZ.BLL.BLL_ErpPackagesGiftMerchandise pgbll = new BLL.BLL_ErpPackagesGiftMerchandise();
- LYFZ.BLL.BLL_ErpMemberCardBackCashSet mcbcsetbll = new BLL.BLL_ErpMemberCardBackCashSet();
- LYFZ.BLL.BLL_ErpMemberCardInterfaceManagement mcimbll = new BLL.BLL_ErpMemberCardInterfaceManagement();
- #region 属性
- public bool _bSelectFilm = false;
- /// <summary>
- /// 是否是修改订单(从订单报表、保存后这里都会为true)
- /// </summary>
- public bool IsUpdateOrderLoad = false;
- /// <summary>
- /// 关闭窗体前判断是否提示
- /// </summary>
- private bool isClose = true;
- /// <summary>
- /// 订单编号
- /// </summary>
- public string StrNumber = "";
- public int modelId = 0;
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 订单类型
- /// </summary>
- public LYFZ.EnumPublic.OrderType OrdType;
- /// <summary>
- /// 用于写入成人客户控件的序号
- /// </summary>
- private int ClientAdultNameCount = 1;
- /// <summary>
- /// 用于写入儿童客户控件的序号
- /// </summary>
- private int ClientChildNameCount = 1;
- /// <summary>
- /// 是否显示写真版
- /// </summary>
- private bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
- /// <summary>
- /// 登录都姓名
- /// </summary>
- string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- /// <summary>
- /// 登录者员工ID
- /// </summary>
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 本地分店ID
- /// </summary>
- string strInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- /// <summary>
- /// 当前客户数量
- /// </summary>
- int AddClinetCount = 0;
- /// <summary>
- /// 订单客户组编号
- /// </summary>
- string OrderGroupNumber = "";
- /// <summary>
- /// 来单批号
- /// </summary>
- string ComeSingleLotNumber = "";
- /// <summary>
- /// 覆盖订单数据时候,是否覆盖客户数据
- /// </summary>
- bool UpdateOrderIsUpdateClientData = true;
- /// <summary>
- /// 如果没有保存权限,是否已授过权
- /// </summary>
- bool IsSaveedHadAuthorized = false;
- /// <summary>
- /// 当前登录者、授权者的保利系数
- /// </summary>
- decimal dec_OrderDiscounts = 0;
- /// <summary>
- /// 客户来源《朋友介绍——副卡资料》
- /// </summary>
- LYFZ.Model.Model_ErpMemberCardViceCard modelViceCard = null;
- /// <summary>
- /// 客户来源《朋友介绍——朋友资料》
- /// </summary>
- LYFZ.Model.Model_ErpCustomer modelFriends = null;
- /// <summary>
- /// 老客户信息
- /// </summary>
- LYFZ.Model.Model_ErpCustomer modelOldClient = null;
- /// <summary>
- /// 介绍人要办理的会员卡号
- /// </summary>
- public string StrReferralsMemberCardNumber = "";
- /// <summary>
- /// 介绍人要修改的电话号码
- /// </summary>
- public string StrReferralsClientPhone = "";
- bool _isIntentionOrder = false;
- string _UploadPath = "";
- /// <summary>
- /// 当前打开的是否为意向订单
- /// </summary>
- bool IsIntentionOrder
- {
- get { return _isIntentionOrder; }
- set { _isIntentionOrder = value; }
- }
- public LoadFormType EnumLoadFormType;
- public enum LoadFormType
- {
- 订单报表,
- 开单选择
- }
- /// <summary>
- /// 旧套系名称
- /// </summary>
- string strOldTaoXiName { get; set; }
- /// <summary>
- /// 旧套系名称
- /// </summary>
- string strOldTaoXiCode { get; set; }
- /// <summary>
- /// 旧套系金额
- /// </summary>
- decimal strOldTaoXiPrice { get; set; }
- string strPersonData { get; set; }
- #endregion
- #region 窗体事件
- public OnSingleFormMain01()
- {
- this.Shown += OnSingleFormMain_Shown;
- this.Load += OnSingleFormMain_Load;
- this.btnSaveIntent.Click += btnSaveIntent_Click;
- this.btnSave.Click += btnSave_Click;
- this.btnPrint.Click += btnPrint_Click;
- this.btnNewOrder.Click += btnNewOrder_Click;
- this.btnOrderClose.Click += btnOrderClose_Click;
- this.FormClosing += OnSingleFormMain_FormClosing;
- this.FormClosed += OnSingleFormMain_FormClosed;
- this.Resize += OnSingleFormMain_Resize;
- #region 第一页
- this.btnSourceSet.Click += btnSourceSet_Click;
- this.btnStyleSet.Click += btnStyleSet_Click;
- this.pictAddClient.Click += pictAddClient_Click;
- this.btnSelectUser.Click += btnSelectUser_Click;
- this.panelEx3.Click += panelEx3_Click;
- this.panelEx2.Click += panelEx2_Click;
- this.panelVice1.Click += panelVice1_Click;
- this.PanelMain1.Click += PanelMain1_Click;
- this.chkOldClient.Click += chkOldClient_Click;
- this.chkFriends.Click += chkFriends_Click;
- this.chkHospitalClient.Click += chkHospitalClient_Click;
- this.chkOther.Click += chkOther_Click;
- this.lblYiXiangClient.Click += lblYiXiangClient_Click;
- this.lblBrowseSelect.Click += lblBrowseSelect_Click;
- #endregion
- #region 第二页
- this.tabControl.SelectedIndexChanged += tabControl_SelectedIndexChanged;
- this.PanelMain2.Click += PanelMain2_Click;
- this.PanelMain3.Click += PanelMain3_Click;
- #endregion
- #region 上传预约单
- this.btnUpload.Click += btnUpload_Click;
- this.btnShow.Click += btnShow_Click;
- #endregion
- //TestData();
-
- }
- void SetButtonPostionData()
- {
- btnUpload.Location = new Point(this.Width - 170, btnUpload.Location.Y);
- btnShow.Location = new Point(this.Width - 85, btnShow.Location.Y);
- }
- #region 上传预约单
-
- void btnShow_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this._UploadPath))
- {
- string resData = "";
- string downFilePath = Application.StartupPath + "\\Temp\\UploadFile\\" + System.IO.Path.GetFileName(this._UploadPath);
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
- {
- LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
- resData = tcpFile.DownloadFile(downFilePath, this._UploadPath, backgroundWorker);
- });
- //LYFZ.Software.MainBusiness.SystemSettings.frmShowPictureBox showPictureBox = new SystemSettings.frmShowPictureBox()
- //{
- // filePath = filePath
- //};
- //showPictureBox.ShowDialog();
- System.Diagnostics.Process.Start(downFilePath);
- }
- else
- {
- MessageBoxCustom.Show("未上传预约单!");
- }
- }
- void btnUpload_Click(object sender, EventArgs e)
- {
- OpenFileDialog openDlg = new OpenFileDialog();
- openDlg.Multiselect = false;
- if (openDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- DateTime startime = DateTime.Now;
- string filePath = openDlg.FileName.Trim();
- if (filePath.Length > 0)
- {
- bool b = false;
- string retmsg = "";
- string servicePath= "UploadFiles\\ReservationForm\\" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + System.IO.Path.GetExtension(filePath);
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
- {
- try
- {
- LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
- retmsg = tcpFile.UploadFileToServer(filePath, servicePath, backgroundWorker);
- //tcpFile.
- b = true;
- }
- catch (Exception ex)
- {
- retmsg = ex.Message;
- b = false;
- }
- });
- //this.textBoxEx2.Text = retmsg;
- //this.labelEx3.Text = "上传完成 用时:" + ExecDateDiff(startime, DateTime.Now) + " 毫秒数 " + (ExecDateDiff(startime, DateTime.Now) / 1000) + " 秒";
- if(b)
- {
- _UploadPath = servicePath;
- MessageBoxCustom.Show(
- retmsg + "\r\n" +
- "上传完成"
- );
- /// 用时:" + LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff(startime, DateTime.Now) + " 毫秒数 " + (LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff(startime, DateTime.Now) / 1000) + " 秒
- }
- else
- {
- MessageBoxCustom.Show(
- "上传失败\r\n" + retmsg
- );
- }
- }
- }
- }
- #endregion
-
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Shown(object sender, EventArgs e)
- {
- this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
- this.flowPanel0.Location = new Point(this.flowPanel0.Location.X, tabControl.Location.Y - 2);// this.flowPanel0.Location.Y);
- this.FillClientDataPanelHeight();
- this.PanelMain1_Click(this, null);
- ///保存意向订单的版本权限
- List<Control> hideControl = new List<Control>();
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- hideControl.Add(this.btnSaveIntent);
- LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- VersionControl.VersionFunctionEnum.开单保存意向订单, hideControl, null, null);
-
- ///自动开会员版本权
- hideControl = new List<Control>();
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- hideControl.Add(this.panelTransactmemberCard);
- LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- VersionControl.VersionFunctionEnum.开单自动开会员, hideControl, null, null);
- SetButtonPostionData();
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Load(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrNumber))
- {
- DataTable odbDt = odbll.GetOrderDigitalByNumberHandSelect(this.StrNumber);
- if (odbDt.Rows.Count > 0)
- {
- _bSelectFilm = true;
- }
- }
- this.StyleSetAdd();
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT");
- this.chBox_Click();
- #region 权限与加载
- if (this.StrNumber == "")
- {
- this.tap3.Parent = null;
- //this.btnSave.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
- this.GetTransactmemberCard();
- }
- else
- {
- this.btnSaveIntent.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
- this.OpenSingleLoad();
- }
- this.btnPrint.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.Print);
- this.btnStyleSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderLoveStyleSet);
- this.btnSourceSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClientSourceSet);
- #endregion
- }
- void RebindUpgrade(bool b)
- {
- if (this.OrderEx != null)
- {
- this.OrderEx.bUpgrade = b;
- }
- //throw new NotImplementedException();
- if (this.OrderProductEx != null)
- {
- this.OrderProductEx.bUpgrade = b;
- }
- if (OrderServiceEx != null)
- {
- OrderServiceEx.bUpgrade = b;
- }
- if (this.OrderSightsEx != null)
- {
- this.OrderSightsEx.bUpgrade = b;
- }
- else if (this.OrderStagesEx != null)
- {
- this.OrderStagesEx.bUpgrade = b;
- }
- }
- /// <summary>
- /// 打开订单数据
- /// </summary>
- void OpenSingleLoad()
- {
- RebindUpgrade(false);
- this.IsSaveedHadAuthorized = false;
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- LYFZ.Model.Model_ErpOrder modelorder = orbll.GetModel(this.StrNumber);
- if (modelorder.ID <= 0)
- { return; }
- else
- {
- this._UploadPath = modelorder.Ord_UploadPath;
- this.strOldTaoXiName = modelorder.Ord_OldSeriesName;
- this.strOldTaoXiPrice = modelorder.Ord_OldSeriesPrice;
- this.strOldTaoXiCode = modelorder.Ord_OldSeriesCode;
- modelId = modelorder.ID;
- this.OrdType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), modelorder.Ord_Type);
- if (modelorder.Ord_Class == "0")
- {
- IsIntentionOrder = true;
- }
- DataTable tbl_P = orbll.GetView_Custom("tb_ErpOrdersPerson", StrWhere: "OrdPe_OrderNumber = '" + this.StrNumber + "'", filedOrder: "OrdPe_Type ASC", ShowColumnName: "dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) AS OrdPe_OrdersPersonName,OrdPe_OrdersPerson,OrdPe_Type").Tables[0];
- DataTable tblFriends = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID,GP_IntroducerCustomerID").Tables[0];
- List<LYFZ.Model.Model_ErpCustomer> mlistClient = new List<Model.Model_ErpCustomer>();
- List<string> mlistClientRelation = new List<string>();
- string StrMasterNumber = "";
- string StrChildNumber = "";
- DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID").Tables[0];
- if (tblGroup.Rows.Count > 0)
- {
- DataTable tblClientGroup = orbll.GetView_Custom("View_CustomerGroupMembersAndErpCustomer", StrWhere: "GM_CustomerGroupID = '" + tblGroup.Rows[0]["GP_CustomerGroupID"].ToString().Trim() + "'", ShowColumnName: "Cus_CustomerNumber,GM_Master,GM_RelatedPersonID,GM_Relation,GM_ProtagonistCustomer").Tables[0];
- for (int i = 0; i < tblClientGroup.Rows.Count; i++)
- {
- if (tblClientGroup.Rows[i]["GM_Master"].ToString().Trim() == "1")
- { StrMasterNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
- if (modelorder.Ord_Type == "1")
- {
- if (tblClientGroup.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
- { StrChildNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
- }
- LYFZ.Model.Model_ErpCustomer modelClient = ctbll.GetModel("Cus_CustomerNumber", tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim());
- if (modelClient.ID > 0)
- {
- mlistClient.Add(modelClient);
- mlistClientRelation.Add(tblClientGroup.Rows[i]["GM_Relation"].ToString().Trim());
- }
- }
- }
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (modelorder.Ord_Class == "1")
- { this.btnSaveIntent.Visible = false; }
- else
- { this.btnSaveIntent.Visible = true; }
- if (this.IsUpdateOrderLoad)
- { this.lblYiXiangClient.Enabled = false; this.panelTransactmemberCard.Visible = false; }
- #region 订单资料
- if (this.UpdateOrderIsUpdateClientData)
- {
- this.AddClinetCount = 0;
- }
- this.tabControl.SelectedIndex = 1;
- bool IsActivity = false;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- this.OrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
- IsActivity = this.OrderEx.SetOrderValue(modelorder);
- if (this.OrderSightsEx != null)
- {
- this.OrderSightsEx.SetOrderSightsValue(this.StrNumber, modelorder.Ord_SeriesName);
- this.OrderSightsEx.OrdType = (int)this.OrdType;
- }
- else if (this.OrderStagesEx != null)
- { this.OrderStagesEx.SetOrderStagesValue(this.StrNumber, modelorder.Ord_SeriesName); }
- break;
- case EnumPublic.OrderType.服务订单:
- this.ServiceOrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
- this.ServiceOrderEx.SetOrderValue(modelorder);
- break;
- }
- try
- {
- this.OrderServiceEx.SetOrderServiceValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
- this.OrderProductEx.SetOrderProductValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message + ",原因:可能是“tb_ErpOrderProductList”商品唯一标识重复");
- }
- #endregion
- #region 接单人
- string PersonName = "";
- string PersonTag = "";
- string PersonType = "";
- for (int i = 0; i < tbl_P.Rows.Count; i++)
- {
- if (i == 0)
- {
- PersonName = tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
- PersonTag = tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
- PersonType = tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
- }
- else
- {
- PersonName += "," + tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
- PersonTag += "," + tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
- PersonType += "," + tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
- }
- }
- this.txtOrderPerson.Text = PersonName;
- this.txtOrderPerson.Tag = PersonTag + "|" + PersonType;
- strPersonData = modelorder.Ord_CommissionRatio;
- #endregion
- #region 客户来源
- if (modelorder.Ord_CustomerSource.Trim() == "朋友介绍")
- {
- this.chkFriends.Checked = true;
- if (tblFriends.Rows.Count > 0)
- {
- if (tblFriends.Rows[0]["GP_IntroducerCustomerID"].ToString().Trim() != "")
- {
- this.modelFriends = ctbll.GetModel("Cus_CustomerNumber", tblFriends.Rows[0]["GP_IntroducerCustomerID"]);
- string StrCardType = "";
- string StrCardTypeShow = "";
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + this.modelFriends.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
- if (dt.Rows.Count > 0)
- {
- StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
- if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
- { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
- }
- LYFZ.Model.Model_ErpMemberCardBackCashSet modelCashSet = mcbcsetbll.GetModel("Mcb_OrderNumber", modelorder.Ord_Number);
- if (modelCashSet.ID > 0)
- {
- this.modelViceCard = mcvbll.GetModel("Mvc_ViceNumber", modelCashSet.Mcb_ViceNumber);
- this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + " - 副卡)";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ";副卡卡号:" + this.modelViceCard.Mvc_ViceCardNumber + ")");
- }
- else
- {
- if (this.modelFriends.Cus_Name != null)
- {
- this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + ")";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ")");
- }
- }
- }
- }
- }
- else if (modelorder.Ord_CustomerSource.Trim() == "老客户")
- { this.chkOldClient.Checked = true; }
- else if (modelorder.Ord_CustomerSource.Trim() == "医院跟踪客户")
- { this.chkHospitalClient.Checked = true; }
- else
- {
- this.chkOther.Checked = true;
- this.cmbtreevClientSource.Enabled = true;
- this.cmbtreevClientSource.TextFindTag(modelorder.Ord_CustomerSource.Trim());
- }
- #endregion
- #region 喜爱格调
- if (modelorder.Ord_LovedStyle.Trim() != "")
- {
- if (modelorder.Ord_LovedStyle.Trim().IndexOf('|') != -1)
- {
- string[] LovedStylelist = modelorder.Ord_LovedStyle.Trim().Split('|');
- if (LovedStylelist.Length > 0)
- {
- for (int i = 0; i < LovedStylelist.Length; i++)
- {
- try
- {
- ((CheckBoxEx)panelEx3.Controls[LovedStylelist[i]]).Checked = true;
- }
- catch { }
- }
- }
- }
- else
- { ((CheckBoxEx)panelEx3.Controls[modelorder.Ord_LovedStyle.Trim()]).Checked = true; }
- }
- #endregion
- #region 客户资料
- this.chBox_Click();
- if (this.UpdateOrderIsUpdateClientData)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber == StrMasterNumber)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber != StrChildNumber && mlistClient[i].Cus_CustomerNumber.Trim() == StrMasterNumber)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber.Trim() == StrChildNumber)
- {
- tmp.SetClientValue(mlistClient[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (mlistClient.Count > 0)
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- this.ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: mlistClient[i], MainClientRelation: mlistClientRelation[i].Trim());
- this.AddClinetCount++;
- }
- }
- }
- #endregion
- this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
- }));
- }
- catch { }
- }
- });
- this.tabControl.SelectedIndex = 0;
-
- }
- /// <summary>
- /// 赋婚期值
- /// </summary>
- /// <param name="StrValue"></param>
- /// <param name="StrLunar"></param>
- void SetMarriageValue(string StrValue, string StrLunar)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- this.mskMarriage.StrValue = StrValue;
- this.chkMarriage.Checked = LYFZ.Command.Command_Validate.DateLunar(StrLunar);
- break;
- }
- }
- /// <summary>
- /// 获取前缀
- /// </summary>
- /// <returns></returns>
- private string GetOrderCustomPrefix()
- {
- string StrCustomPrefix = "";
- if (this.OrdType == LYFZ.EnumPublic.OrderType.婚纱订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚纱订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.儿童订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.儿童订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.写真订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.写真订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.服务订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.服务订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.婚庆订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚庆订单).Trim(); }
- return StrCustomPrefix;
- }
- /// <summary>
- /// 填充客户层的高
- /// </summary>
- void FillClientDataPanelHeight()
- {
- if (this.panelVice1.Height < (this.tap1.Height - 12))
- {
- this.panelVice1.Height = this.tap1.Height - 12;
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- }
- /// <summary>
- /// 检查数据是否被修改过
- /// </summary>
- /// <returns></returns>
- bool CheckDataIsUpdate()
- {
- bool IsUpdateSaveed = false;
- if (this.OrdType == EnumPublic.OrderType.服务订单)
- { }
- else
- {
- ComboBoxTreeViewEx cmbtreevTaoXiName = OrderEx.CmbtreevTaoXi;
- if (cmbtreevTaoXiName.Tag != null)
- {
- DataRow[] dtRow0 = null;
- DataRow[] dtRow1 = null;
- DataRow[] dtRow2 = null;
- DataTable tbl0 = null;
- DataTable tbl1 = null;
- DataTable tbl2 = null;
- string ExecuteSql = "select tb_ErpPackagesGiftMerchandise.ID,Sc_ClassName,Pgm_GiveType,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity " +
- "from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
- "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- ExecuteSql += "select tb_ErpPackagesGiftMerchandise.ID,Prod_Batch,Pgm_Quantity,Pgm_GiveType from tb_ErpPackagesGiftMerchandise " +
- "Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- ExecuteSql += "select Pak_UnitPrice from tb_ErpPackages where Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dt0 = dsData.Tables["ds"];
- DataTable dt1 = dsData.Tables["ds1"];
- DataTable dt2 = dsData.Tables["ds2"];
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- #region 判断价格
- if (dt2.Rows.Count > 0)
- {
- if (Convert.ToDecimal(dt2.Rows[0]["Pak_UnitPrice"]) != Convert.ToDecimal(this.OrderEx.TaoXiPrice))
- { IsUpdateSaveed = true; }
- }
- #endregion
- #region 判断入底入册
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- try
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpPackages", StrWhere: "Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "'", ShowColumnName: "Pak_IntoTheArchive,Pak_IntoTheBook").Tables[0];
- Hashtable htDataPackages = this.OrderEx.GetIntoRegisterAndIntoBottom();
- if (dt.Rows.Count == 0 && htDataPackages.Count > 0)
- { IsUpdateSaveed = true; }
- else if (Convert.ToInt32(dt.Rows[0]["Pak_IntoTheArchive"]) != Convert.ToInt32(htDataPackages["IntoBottom"].ToString()) || Convert.ToInt32(dt.Rows[0]["Pak_IntoTheBook"]) != Convert.ToInt32(htDataPackages["IntoRegister"].ToString()))
- { IsUpdateSaveed = true; }
- }
- catch
- { }
- break;
- }
- #endregion
- #region 商品与服务
- if (!IsUpdateSaveed)
- {
- dtRow0 = dt1.Select("Pgm_GiveType = '0'");
- tbl0 = this.OrderProductEx.GetListViewData();
- if (dtRow0.Length != tbl0.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow0.Length > 0 && tbl0.Rows.Count > 0)
- {
- for (int j = 0; j < tbl0.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl0.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow0.Length; i++)
- {
- DataRow[] dtRow = tbl0.Select("PgmID = '" + dtRow0[i]["ID"].ToString().Trim() + "'");
- if (dtRow0.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (Convert.ToInt32(dtRow[0]["商品P数"]) != Convert.ToInt32(dtRow0[i]["Prod_Batch"]) || Convert.ToInt32(dtRow[0]["商品数量"]) != Convert.ToInt32(dtRow0[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- }
- }
- }
- }
- if (!IsUpdateSaveed)
- {
- dtRow1 = dt1.Select("Pgm_GiveType = '1'");
- tbl1 = this.OrderServiceEx.GetListViewData();
- if (dtRow1.Length != tbl1.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow1.Length > 0 && tbl1.Rows.Count > 0)
- {
- for (int j = 0; j < tbl1.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl1.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow1.Length; i++)
- {
- DataRow[] dtRow = tbl1.Select("PgmID = '" + dtRow1[i]["ID"].ToString().Trim() + "'");
- if (dtRow1.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (Convert.ToInt32(dtRow[0]["服务数量"]) != Convert.ToInt32(dtRow1[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- }
- }
- }
- }
- #endregion
- #region 景点与拍摄次数
- if (!IsUpdateSaveed)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- dtRow2 = dt0.Select("Pgm_GiveType = '2'");
- tbl2 = this.OrderSightsEx.GetListViewData();
- break;
- case EnumPublic.OrderType.儿童订单:
- dtRow2 = dt0.Select("Pgm_GiveType = '3'");
- tbl2 = this.OrderStagesEx.GetListViewData();
- break;
- }
- if (dtRow2.Length != tbl2.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow2.Length > 0 && tbl2.Rows.Count > 0)
- {
- for (int j = 0; j < tbl2.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl2.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow2.Length; i++)
- {
- DataRow[] dtRow = tbl2.Select("PgmID = '" + dtRow2[i]["ID"].ToString().Trim() + "'");
- if (dtRow2.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (dtRow[0]["拍摄级别"].ToString().Trim() != dtRow2[i]["Sc_ClassName"].ToString().Trim() || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- if (!IsUpdateSaveed)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- if (Convert.ToInt32(dtRow[0]["入册"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoRegisterQuantity"]) || Convert.ToInt32(dtRow[0]["入底"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoBottomQuantity"]) || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- break;
- }
- }
- }
- }
- }
- }
- }
- #endregion
- break;
- }
- }
- }
- return IsUpdateSaveed;
- }
- /// <summary>
- /// 保存意向
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveIntent_Click(object sender, EventArgs e)
- {
- SaveOrderData("0");
- }
- /// <summary>
- /// 保存意向订单和真实订单数据
- /// </summary>
- /// <param name="saveClass">0意向订单,1开单</param>
- void SaveOrderData(string saveClass)
- {
- Api_ErpOrderModel apiErpModel = new Api_ErpOrderModel()
- {
- OrderID = modelId,
- strTime = SDateTime.Now,
- strUserName = StrUserName,
- dividedShop = strInfoID,
- strUserID = strUserID,
- User_IP = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP,
- strMskMarriage = this.mskMarriage.StrValue,
- bChkCheckBox = this.chkMarriage.Checked,
- chkTransactmemberCard = this.chkTransactmemberCard.Checked,
- StrSaveClass = saveClass,
- strStyle = this.GetStyle(),
- StrClientSource = this.GetClientSource(),
- dec_OrderDiscounts = this.dec_OrderDiscounts,
- strOldTaoXiName=this.strOldTaoXiName,
- strOldTaoXiCode = this.strOldTaoXiCode,
- strOldTaoXiPrice = this.strOldTaoXiPrice,
- UploadPath = this._UploadPath,
- CommissionRatio = this.strPersonData,
- strOrderPerson = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Tag.ToString(),
- strOrderPersonName = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Text.ToString(),
- ComeSingleLotNumber = this.ComeSingleLotNumber,
- StrNewOrderNumber = (modelId > 0 ? this.StrNumber : null),
- OrderGroupNumber = this.OrderGroupNumber,
- customerData = new List<Api_CustomerModel>(),
- OrderSightData = new List<Api_StagesModel>(),
- OrderServiceData = new List<Api_ServiceModel>(),
- OrderProductData = new List<Api_ProductModel>(),
- modelFriends = new Model.Model_ErpCustomer(),
- modelViceCard = new Model.Model_ErpMemberCardViceCard(),
- IsMagess = true
- };
- if (this.modelFriends != null)
- {
- apiErpModel.friend_CustomerNumber = this.modelFriends.Cus_CustomerNumber;
-
- }
- else
- {
- apiErpModel.friend_CustomerNumber = "";
- }
- apiErpModel.orderType = this.OrdType;
- ///会员副卡
- apiErpModel.modelViceCard = this.modelViceCard;
- if (apiErpModel.modelViceCard != null)
- {
- if (apiErpModel.modelViceCard.Mvc_CreateDatetime == new DateTime())
- {
- apiErpModel.modelViceCard.Mvc_CreateDatetime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- if (apiErpModel.modelViceCard.Mvc_UpdateDateTime == new DateTime())
- {
- apiErpModel.modelViceCard.Mvc_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- }
- //朋友介绍
- apiErpModel.modelFriends = this.modelFriends;
- if (apiErpModel.modelFriends != null)
- {
- if (apiErpModel.modelFriends.Cus_CreateDateTime == new DateTime())
- {
- apiErpModel.modelFriends.Cus_CreateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- if (apiErpModel.modelFriends.Cus_UpdateDateTime == new DateTime())
- {
- apiErpModel.modelFriends.Cus_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- }
- }
- string ChildCilentRelation = "";
- string MainCilentRelation = "";
- foreach (Control control in this.flowPanel1.Controls)
- {
- ///成人客户信息
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- tmp.GetClientValueData(apiErpModel, ref MainCilentRelation);
- }
- ///儿童客户信息
- if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- tmp.GetClientValueData(apiErpModel, ref ChildCilentRelation);
- }
- }
- if (this.OrderEx != null)
- {
- ///获取订单数据
- this.OrderEx.BindApiData(apiErpModel);
- }
- if( this.ServiceOrderEx!=null)
- {
- this.ServiceOrderEx.BindApiData(apiErpModel);
- }
- ///获取拍摄场景数据
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- if (this.OrderSightsEx != null)
- {
- this.OrderSightsEx.GetOrderSightsValueData(apiErpModel);
- }
- break;
- case EnumPublic.OrderType.儿童订单:
- if (this.OrderStagesEx != null)
- {
- this.OrderStagesEx.GetOrderStagesValueData(apiErpModel);
- }
- break;
- }
- ///服务的数据信息
- if (this.OrderServiceEx != null)
- {
- this.OrderServiceEx.GetOrderServiceValueData(apiErpModel);
- }
- if (this.OrderProductEx != null)
- {
- this.OrderProductEx.GetOrderProductValueData(apiErpModel);
- }
- int indx = 0;
- bool bSelect = false;
- LYFZ.BLL.BLL_ErpOrder erpOrder = new BLL.BLL_ErpOrder();
- // string json = Json.JsonTool.ObjectToJson(apiErpModel);
- 数据检查队列:
- LYFZ.Command.Result result = erpOrder.SaveErpOrderDataByCheck(apiErpModel, ref indx, ref bSelect);
- if (!result.Status)
- {
- if(result.StatusMsg=="手机号码重复,请核实客户数据!")
- {
- MessageBoxCustom.Show(result.StatusMsg);
- return;
- }
- LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg> resultMsg = ((LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg>)result);
- if (resultMsg.Data == Command.EnumReturnMsg.ReturnMsg)
- {
- MessageBoxCustom.Show(resultMsg.StatusMsg);
- return;
- }
- else if (resultMsg.Data == Command.EnumReturnMsg.SelectMsg)
- {
- if (MessageBoxCustom.Show(resultMsg.StatusMsg, "温馨提示",
- MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
- {
- return;
- }
- else
- {
- bSelect = true;
- goto 数据检查队列;
- }
- }
- else if (resultMsg.Data == Command.EnumReturnMsg.CostAuthorization)
- {
- if (MessageBoxCustom.Show(resultMsg.StatusMsg, "温馨提示",
- MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm(null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 1);
- frm.ShowDialog();
- if (!frm.IsSaveed)
- {
- return;
- }
- else
- {
- decimal Ord_SeriesPrice = 0;
- decimal.TryParse(apiErpModel.strTaoXiPrice, out Ord_SeriesPrice);
- decimal Old_PackagesAmount = apiErpModel.ProductAmount();
- Old_PackagesAmount += apiErpModel.ServiceAmount();
- if (apiErpModel.orderType == EnumPublic.OrderType.儿童订单)
- {
- Old_PackagesAmount += apiErpModel.SightOrStageAmount();
- }
- else if (apiErpModel.orderType != EnumPublic.OrderType.婚庆订单)
- {
- Old_PackagesAmount += apiErpModel.SightOrStageAmount();
- }
- if (Ord_SeriesPrice < (Old_PackagesAmount * frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType))))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人成本管控权限不够"));
- MessageBoxCustom.Show("授权帐号:" + frm.StrUserAccount + ",授权后的套系价格低于订单总成本,无法保存!"); return; }
- else
- {
- frm.SetAuthorizationResult();
- bSelect = true;
- goto 数据检查队列;
- }
-
- }
- }
- else
- {
- return;
- }
- }
- else
- {
- MessageBoxCustom.Show(resultMsg.StatusMsg);
- return;
- }
- }
- else
- {
- //string strOrderPrefix = LYFZ.BLL.Common.BLL_Com_Data.GetOrderCustomPrefix(apiErpModel.orderType);
- //if (apiErpModel.OrderID == 0)
- //{
- // if (apiErpModel.bIsShowSinceOrderNumber)
- // {
- // apiErpModel.SinceOrderNumber
- // }
- //}
- bool isAddOrder = false;
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- backgroundWorker.ReportProgress(0, "正在提交数据... ");
- result = erpOrder.SaveErpOrderData(apiErpModel, ref isAddOrder);
- });
- if (result.Status)
- {
- object obj;
- try
- {
- obj = ((LYFZ.Command.Result<object>)result).Data;
- }
- catch
- {
- MessageBoxCustom.Show("保存失败", "提示");
- return;
- }
-
- Model.Model_ErpOrder modelOrder = (Model.Model_ErpOrder)(obj.GetType().GetProperty("modelOrder").GetValue(obj, null));
- LYFZ.Model.Model_ErpCustomer modelCilentMain = (Model.Model_ErpCustomer)(obj.GetType().GetProperty("modelCilentMain").GetValue(obj, null));
- this.StrNumber = modelOrder.Ord_Number;
- this.IsSaveed = true;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- }
- this.IsUpdateOrderLoad = true;
- //LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber);
- //if (modelOrder.Ord_Number.Trim().Length > 0)
- //{ LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单); }
- if (apiErpModel.StrSaveClass == "1")
- {
- #region 收款 并 积分
- bool IsPayment = true;
- if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, LYFZ.CustomAttributes.OperatingAuthority.OrdersReceivables))
- {
- if (modelOrder.Ord_SeriesPrice > 0)
- {
- if (ptbll.GetRecordCount("Pay_OrdNumber = '" + modelOrder.Ord_Number + "'") <= 0)
- {
- LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmPrePayment frm = new FinancialManagement.OrdersReceivables.FrmPrePayment();
- //frm.StrOrdType = this.OrdType.ToString();
- frm.StrOrdNumber = this.StrNumber;
- //frm.StrCope = modelOrder.Ord_SeriesPrice;
- frm.IsShowButtonPayment = true;
- //frm.StrPaid = 0;
- //frm.StrArrears = modelOrder.Ord_SeriesPrice;
- frm.ShowDialog();
- IsPayment = false;
- }
- }
- }
- #endregion
- this.OpenSingleLoad();
-
- if (IsPayment)
- {
- MessageBoxCustom.Show(result.StatusMsg);
- }
- #region 短信发送操作
- LYFZ.BLL.BLL_SMSRecord smsRecord = new BLL.BLL_SMSRecord();
- smsRecord.SMSSend(orbll,
- sgbll,
- mcbcsetbll,
- apiErpModel,
- modelOrder,
- isAddOrder,
- apiErpModel.StrSaveClass == "0",
- modelCilentMain.Cus_CustomerNumber);
- #endregion
- //MessageBoxCustom.Show("保存成功!");
- }
- else
- {
- this.StrNumber = modelOrder.Ord_Number;
- this.IsSaveed = true;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- }
- this.IsUpdateOrderLoad = true;
- LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber);
- if (modelOrder.Ord_Number.Trim().Length > 0)
- {
- new System.Threading.Thread(new System.Threading.ThreadStart(delegate ()
- {
- LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单);
- })).Start();
- }
- this.OpenSingleLoad();
- MessageBoxCustom.Show("保存成功!");
- }
- }
- else
- {
- MessageBoxCustom.Show(result.StatusMsg);
- }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSave_Click(object sender, EventArgs e)
- {
-
- #region 检查授权
- if (this.StrNumber.Trim() == "")
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder))
- {
- if (!this.IsSaveedHadAuthorized)
- {
- bool IsCheckDataIsUpdate = this.CheckDataIsUpdate();
- string strWindowText = "开订单";
- if (IsCheckDataIsUpdate)
- { strWindowText += "、修改新订单"; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
- frm.StrWindowText = strWindowText;
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'开订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'开订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- #region 检测套系是否被修改过
- if (IsCheckDataIsUpdate)
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- }
- #endregion
- }
- }
- else
- {
- #region 检测套系是否被修改过
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder))
- {
- if (this.CheckDataIsUpdate())
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder);
- frm.StrWindowText = "修改新订单";
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- }
- }
- #endregion
- this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- }
- }
- else
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder))
- {
- if (!this.IsSaveedHadAuthorized)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
- frm.StrWindowText = "修改已订单";
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改已订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改已订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- }
- }
- }
- else
- { this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType)); }
- }
- this.IsSaveedHadAuthorized = true;
- #endregion
- SaveOrderData("1");
- }
- void test(List<Helper.CommandInfo> clist, string newOrderNumber)
- {
- foreach (Helper.CommandInfo commd in clist)
- {
- foreach (System.Data.SqlClient.SqlParameter Par in commd.Parameters)
- {
- if ("orderNuber,eddiid,iiii,dddd".Contains(Par.ParameterName))
- {
- Par.Value = newOrderNumber;
- }
- }
- }
- }
- /// <summary>
- /// 获取订单数码表的摄次数种子值
- /// </summary>
- /// <param name="dlist"></param>
- /// <returns></returns>
- int GetDigitalNumber(List<LYFZ.Model.Model_ErpOrderDigital> dlist)
- {
- int DigitalNumber = 0;
- if (dlist != null && dlist.Count > 0)
- {
- DigitalNumber = Convert.ToInt32(dlist[dlist.Count - 1].Ordv_DigitalNumber);
- while (ViceNumberEquals(dlist, DigitalNumber))
- { DigitalNumber++; }
- DigitalNumber--;
- }
- return DigitalNumber;
- }
- /// <summary>
- /// 栓检查DigitalNumber是否存在
- /// </summary>
- /// <param name="dlist"></param>
- /// <param name="DigitalNumber"></param>
- /// <returns></returns>
- bool ViceNumberEquals(List<LYFZ.Model.Model_ErpOrderDigital> dlist, int DigitalNumber)
- {
- bool bl = false;
- if (dlist != null)
- {
- int tempMaxNumber = 0;
- foreach (LYFZ.Model.Model_ErpOrderDigital modelDig in dlist)
- {
- string tempViceNumer = modelDig.Ordv_Number + "_" + LYFZ.Command.Command_Validate.GetBeforeAddZero(DigitalNumber, 3);
- if (modelDig.Ordv_ViceNumber.Equals(tempViceNumer))
- {
- bl = true;
- break;
- }
- else
- {
- int tempNu = 0;
- try
- { tempNu = Convert.ToInt32(modelDig.Ordv_ViceNumber.Split('_')[1]); }
- catch
- { tempNu = dlist.Count + modelDig.Ordv_DigitalNumber; }
- if (tempNu > tempMaxNumber)
- { tempMaxNumber = tempNu; }
- }
- }
- if (tempMaxNumber >= DigitalNumber)
- { bl = true; }
- }
- return bl;
- }
- /// <summary>
- /// 打印
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnPrint_Click(object sender, EventArgs e)
- {
- if (this.StrNumber.Trim() != "")
- {
- Hashtable htData = new Hashtable();
- htData["strNumber"] = this.StrNumber.Trim();
- htData["strOrdType"] = this.OrdType.ToString().Trim();
- // 获取全部景点;
- List<PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null;
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- listScenicSpot = new List<PrintPreviewSmallForm.ScenicSpot2>();
- for(int i = 0; i < this.OrderStagesEx.listViewData_Stages.Items.Count; i++)
- {
- PrintPreviewSmallForm.ScenicSpot2 scenic = new PrintPreviewSmallForm.ScenicSpot2();
- scenic.strScenicName = this.OrderStagesEx.listViewData_Stages.Items[i].Text;
- scenic.strViceNumber = ((SetCustomControls.SetCustomControls_StagesColumnHeaderModel)this.OrderStagesEx.listViewData_Stages.Items[i].Tag).StagesViceNumber;
- listScenicSpot.Add(scenic);
- }
- }
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot);
- }
- }
- /// <summary>
- /// 新订单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnNewOrder_Click(object sender, EventArgs e)
- {
- if (MessageBoxCustom.Show("重置后将清空所有数据,您确定要重置订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- this.IsGoForm = true;
- this.EnumLoadFormType = LoadFormType.开单选择;
- this.Close();
- }
- }
- /// <summary>
- /// 清空数据重置
- /// </summary>
- void ClearDataReset()
- {
- this.btnSaveIntent.Visible = true;
- this.btnSaveIntent.Enabled = true;
- this.StrNumber = "";
- this.txtOrderPerson.Text = "";
- this.txtOrderPerson.Tag = null;
- this.mskMarriage.Text = "";
- this.chkMarriage.Checked = false;
- this.StyleSetAdd();
- this.ClearClientSource();
- this.mskMarriage.StrValue = "";
- this.chkMarriage.Checked = false;
- this.flowPanel2.Controls.Clear();
- this.tabControl.SelectedIndex = 0;
- this.tabControl.TabPages["tap2"].Tag = null;
- this.lblYiXiangClient.Enabled = true;
- this.IsUpdateOrderLoad = false;
- this.IsSaveedHadAuthorized = false;
- this.FillClientDataPanelHeight();
- this.GetTransactmemberCard();
- OrderEx = null;
- ServiceOrderEx = null;
- OrderProductEx = null;
- OrderServiceEx = null;
- OrderStagesEx = null;
- OrderSightsEx = null;
- }
- /// <summary>
- /// 获取是否自动办理会员卡
- /// </summary>
- void GetTransactmemberCard()
- {
- this.panelTransactmemberCard.Visible = true;
- this.chkTransactmemberCard.Checked = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OrderAutoOpenMemberCard;
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnOrderClose_Click(object sender, EventArgs e)
- {
- isClose = false;
- if (!isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- }
- this.Close();
- }
- /// <summary>
- /// 关闭窗体之前发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (!this.IsGoForm)
- {
- if (this.isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { e.Cancel = true; }
- }
- }
- }
- bool IsGoForm = false;
- /// <summary>
- /// 关闭窗体之后发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (this.IsGoForm)
- {
- this.Hide();
- switch (this.EnumLoadFormType)
- {
- case LoadFormType.开单选择:
- LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFirstFormMain frm = new OnSingleFirstFormMain();
- frm.StartPosition = FormStartPosition.CenterScreen;
- frm.Show();
- break;
- }
- }
- }
- /// <summary>
- /// 窗体大小 发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Resize(object sender, EventArgs e)
- {
- this.FillClientDataPanelHeight();
- this.SetButtonPostionData();
-
- }
- #endregion
- #region 第一页
- #region 添加成年人客户控件
- /// <summary>
- /// 添加客户控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void pictAddClient_Click(object sender, EventArgs e)
- {
- if (this.OrdType == EnumPublic.OrderType.婚纱订单)
- {
- if (this.AddClinetCount >= 2)
- { MessageBoxCustom.Show("婚纱订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
- }
- else if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- if (this.AddClinetCount >= 5)
- { MessageBoxCustom.Show("儿童订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsShowRelation: true, lblRelation: "与宝贝关系:", IsPhoneSymbol: false);
- }
- else
- {
- if (this.AddClinetCount >= 5)
- { MessageBoxCustom.Show("写真订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
- }
- this.AddClinetCount++;
- }
- /// <summary>
- /// 客户成年人资料
- /// </summary>
- /// <param name="lblClentName">层标题名称</param>
- /// <param name="PanelName">层Name</param>
- /// <param name="IsShowRemove">是否显示移除按钮</param>
- /// <param name="IsShowRelation">是否显示关系控件</param>
- /// <param name="lblRelation">关系控件lable的名称</param>
- void ClientAdultPanelAdd(string lblClentName = "", string PanelName = "Adult_", bool IsShowRemove = true, bool IsShowRelation = true, string lblRelation = "与客户关系:", LYFZ.Model.Model_ErpCustomer model = null, string MainClientRelation = "", bool IsPhoneSymbol = true)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx Client = new SetCustomControls.OrderClientParentsControlsEx();
- Client.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
- Client.Name = PanelName + ClientAdultNameCount;
- Client.StrClientAttribute = PanelName;
- Client.IsPictDeleteShow = IsShowRemove;
- if (model != null)
- {
- Client.SetClientValue(model, true, MainClientRelation: MainClientRelation);
- Client.IsPictResetShow = true;
- Client.IsPictEditShow = true;
- }
- else
- {
- Client.IsPictEditShow = false;
- Client.IsPictResetShow = false;
- }
- Client.LblClientName = lblClentName;
- Client.IsShowRelation = IsShowRelation;
- Client.LblRelationText = lblRelation;
- Client.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
- Client.IsExistClient += Client_IsExistClient;
- Client.DeleteClick += Client_DeleteClick;
- Client.RelationSet += Client_RelationSet;
- Client.RegionSet += Client_RegionSet;
- Client.PhoneLeave += Client_PhoneLeave;
- Client.UpdateOrderGroup += Client_UpdateOrderGroup;
- Client.isShowPhoneSymbol(IsPhoneSymbol);
- this.flowPanel1.Controls.Add(Client);
- this.ClientAdultNameCount++;
- this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Client.Location.Y + Client.Height + 6);
- if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Client.Height))
- {
- this.panelVice1.Height = this.panelVice1.Height + ((panelAddClient.Location.Y + (panelAddClient.Height * 2) + Client.Height) - this.flowPanel1.Height);
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- this.panelAddClient.SendToBack();
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 判断当前客户在其他资料是否存在,一个订单不能同时存在两个相同的客户
- /// </summary>
- /// <param name="StrControlsName"></param>
- /// <param name="StrClientNumber"></param>
- /// <returns></returns>
- string Client_IsExistClient(string StrControlsName, string StrClientNumber)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.Name.Trim() != StrControlsName.Trim())
- {
- if (tmp.modelCilent != null)
- {
- if (tmp.modelCilent.Cus_CustomerNumber.Trim() != "")
- {
- if (tmp.modelCilent.Cus_CustomerNumber.Trim() == StrClientNumber.Trim())
- { return tmp.LblClientName.Trim(); }
- }
- }
- }
- }
- }
- return "";
- }
- /// <summary>
- /// 移除客户控件
- /// </summary>
- void Client_DeleteClick(SetCustomControls.OrderClientParentsControlsEx senderEx)
- {
- if (this.modelOldClient != null)
- {
- if (senderEx.modelCilent != null)
- {
- if (this.modelOldClient.Cus_CustomerNumber == senderEx.modelCilent.Cus_CustomerNumber)
- { this.modelOldClient = null; }
- }
- }
- if ((this.flowPanel1.Height + this.flowPanel1.Location.Y - this.panelAddClient.Height) >= this.PanelMain1.Height)
- {
- this.panelVice1.Height = this.panelVice1.Height - senderEx.Height;
- if (this.PanelMain1.Height > (this.panelVice1.Height + 6))
- { this.panelVice1.Height = this.PanelMain1.Height - 6; }
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- this.AddClinetCount--;
- }
- /// <summary>
- /// 客户关系
- /// </summary>
- /// <param name="obj"></param>
- void Client_RelationSet(object obj)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("BFABDBAJBJCEBDJCJ", tmp.CmbtreevRelation);
- }
- }
- }
- /// <summary>
- /// 客户地区设置
- /// </summary>
- /// <param name="obj"></param>
- void Client_RegionSet(object obj)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("AAAAAAC", tmp.CmbtreevRegion, true);
- }
- }
- }
- /// <summary>
- /// 客户电话输入后离开事件,去检测是否有相同电话的
- /// </summary>
- /// <param name="objForm"></param>
- void Client_PhoneLeave(object objForm)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx ClientEx = (SetCustomControls.OrderClientParentsControlsEx)objForm;
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (!ClientEx.Equals(tmp))
- {
- if (ClientEx.StrClientPhone.Trim() != "" && tmp.StrClientPhone.Trim() != "")
- {
- if (ClientEx.StrClientPhone.Trim() == tmp.StrClientPhone.Trim())
- { MessageBoxCustom.Show("'" + ClientEx.LblClientName.Trim() + "' 与 '" + tmp.LblClientName.Trim() + "' 的手机号码不能一样!"); ClientEx.StrClientPhone = ""; }
- }
- }
- }
- }
- }
- /// <summary>
- /// 电话输入事件——模糊查询
- /// </summary>
- /// <param name="obj"></param>
- /// <param name="senderEx"></param>
- void Client_UpdateOrderGroup(object obj)
- {
- if (obj != null && obj.ToString().Trim().Length > 0)
- {
- string[] StrArray = obj.ToString().Trim().Split('|');
- switch (StrArray[0].Trim())
- {
- case "ClientGroup":
- if (string.IsNullOrEmpty(StrNumber))
- {
- this.OrderGroupNumber = StrArray[1].Trim();
- }
- break;
- case "OrderNumber":
- this.UpdateOrderIsUpdateClientData = true;
- this.StrNumber = StrArray[1].Trim();
- this.OpenSingleLoad();
- this.UpdateOrderIsUpdateClientData = true;
- break;
- case "IntentClient":
- string[] StrList = StrArray[1].Trim().Split(',');
- this.UpdateOrderIsUpdateClientData = false;
- this.SelectIntentClient(StrList[0].Trim(), StrList[1].Trim());
- this.UpdateOrderIsUpdateClientData = true;
- break;
- }
- }
- }
- #endregion
- #region 添加儿童客户资料
- /// <summary>
- /// 添加儿童客户资料
- /// </summary>
- /// <param name="lbClentName"></param>
- /// <param name="PanelName"></param>
- /// <param name="IsShowRemove"></param>
- void ClientChildPanelAdd(string lbClentName = "宝贝资料", string PanelName = "Child_", bool IsShowRemove = true)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientChildrenControlsEx Children = new SetCustomControls.OrderClientChildrenControlsEx();
- Children.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
- Children.Name = PanelName + ClientAdultNameCount;
- Children.StrClientAttribute = PanelName;
- Children.IsPictDeleteShow = IsShowRemove;
- Children.LblClientName = lbClentName;
- Children.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
- Children.DeleteClick += Children_DeleteClick;
- this.flowPanel1.Controls.Add(Children);
- this.ClientChildNameCount++;
- this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Children.Location.Y + Children.Height + 6);
- if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Children.Height))
- { this.panelVice1.Height += Children.Height; }
- this.panelAddClient.SendToBack();
- }
- /// <summary>
- /// 移除客户控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void Children_DeleteClick(SetCustomControls.OrderClientChildrenControlsEx senderEx)
- {
- if (this.panelVice1.Height >= this.PanelMain1.Height)
- { this.panelVice1.Height = this.panelVice1.Height - senderEx.Height; }
- this.AddClinetCount--;
- }
- #endregion
- #region 开单类型
- /// <summary>
- /// 开单类型选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chBox_Click()
- {
- List<SetCustomControls.OrderClientParentsControlsEx> ClistA = new List<SetCustomControls.OrderClientParentsControlsEx>();
- List<SetCustomControls.OrderClientChildrenControlsEx> ClistB = new List<SetCustomControls.OrderClientChildrenControlsEx>();
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- ClistA.Add(tmp);
- }
- if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- ClistB.Add(tmp);
- }
- }
- for (int i = 0; i < ClistA.Count; i++)
- { this.flowPanel1.Controls.Remove(ClistA[i]); }
- for (int i = 0; i < ClistB.Count; i++)
- { this.flowPanel1.Controls.Remove(ClistB[i]); }
- this.ClientAdultNameCount = 1;
- this.ClientChildNameCount = 1;
- this.AddClinetCount = 0;
- this.AddClinetCount++;
- this.panelMarriage.Visible = false;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- this.panelHospitalClient.Visible = false;
- this.panelMarriage.Visible = true;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.儿童订单:
- this.AddClinetCount++;
- this.panelHospitalClient.Visible = true;
- this.ClientChildPanelAdd(IsShowRemove: false);
- this.ClientAdultPanelAdd("家长资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: true, lblRelation: "与宝贝关系:");
- break;
- case EnumPublic.OrderType.写真订单:
- this.panelHospitalClient.Visible = true;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.婚庆订单:
- this.panelHospitalClient.Visible = false;
- this.panelMarriage.Visible = true;
- this.panelEx3.Visible = false;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.服务订单:
- this.panelHospitalClient.Visible = true;
- this.panelMarriage.Visible = true;
- this.panelEx3.Visible = false;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- }
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 || LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版)
- { this.pictAddClient.Visible = true; }
- else
- { this.panelHospitalClient.Visible = false; }
- SetCustomControls.OrderClientParentsControlsEx frmClient = (SetCustomControls.OrderClientParentsControlsEx)flowPanel1.Controls["Man_1"];
- if (this.modelOldClient != null)
- {
- frmClient.SetClientValue(this.modelOldClient, true);
- frmClient.IsPictEditShow = true;
- frmClient.IsPictResetShow = true;
- }
- else
- {
- frmClient.SetClientValue(null);
- frmClient.IsPictEditShow = false;
- frmClient.IsPictResetShow = false;
- }
- //this.CurrentClickCount = Convert.ToInt32(chk.Tag);
- }
- #endregion
- #region 客户来源
- /// <summary>
- /// 客户来源设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSourceSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAF";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT"); }
- }
- /// <summary>
- /// 老客户
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkOldClient_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.StrNumber))
- {
- if (!this.chkOldClient.Checked)
- { return; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ClientGroupSelectSuperSmallForm frm = new SuperSmallForm.ClientGroupSelectSuperSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- #region
- this.chBox_Click();
- if (frm.mlist.Count > 0)
- {
- if (frm.mlist.Count == 1)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- tmp.SetClientValue(frm.mlist[0], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- break;
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- if (frm.mlist[0].Cus_Telephone == "")
- {
- tmp.SetClientValue(frm.mlist[0], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- break;
- }
- }
- }
- }
- else
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_CustomerNumber == frm.htData["MainClientNumber"].ToString().Trim())
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_CustomerNumber != frm.htData["MainClientNumber"].ToString().Trim() && frm.mlist[i].Cus_Telephone.Trim() != "")
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_Telephone == "")
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (frm.mlist.Count > 0)
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: frm.mlist[i]);
- this.AddClinetCount++;
- }
- }
- }
- if (frm.htData["Ord_Number"].ToString().Trim() == "")
- { this.OrderGroupNumber = frm.htData["GP_CustomerGroupID"].ToString().Trim(); }
- }
- #endregion
- }
- this.chkFriends.Enabled = true;
- }
- this.chkOldClient.Checked = true;
- this.chkOther.Checked = false;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- this.chkHospitalClient.Checked = false;
- this.modelFriends = null;
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 朋友介绍
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkFriends_Click(object sender, EventArgs e)
- {
- if (!this.chkFriends.Checked)
- {
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- return;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.FriendIntroducedSuperSmallForm frm = new SuperSmallForm.FriendIntroducedSuperSmallForm();
- frm.ShowDialog();
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.modelViceCard = null;
- if (frm.IsSaveed)
- {
- this.StrReferralsClientPhone = frm.StrReferralsClientPhone;
- this.StrReferralsMemberCardNumber = frm.StrReferralsMemberCardNumber;
- string StrCardType = "";
- string StrCardTypeShow = "";
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + frm.model.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
- if (dt.Rows.Count > 0)
- {
- StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
- if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
- { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
- }
- this.modelFriends = frm.model;
- if (frm.modelVice != null)
- {
- this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + " - 副卡)";
- this.modelViceCard = frm.modelVice;
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ";副卡卡号:" + frm.modelVice.Mvc_ViceCardNumber + ")");
- }
- else
- {
- this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + ")";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ")");
- }
- }
- else
- {
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.modelFriends = null;
- }
- this.chkFriends.Checked = true;
- this.chkOldClient.Checked = false;
- this.chkOldClient.Enabled = true;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.ComeSingleLotNumber = "";
- this.chkOther.Checked = false;
- this.chkHospitalClient.Checked = false;
- this.cmbtreevClientSource.Enabled = false;
- }
- /// <summary>
- /// 医院跟踪客户
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkHospitalClient_Click(object sender, EventArgs e)
- {
- if (!this.chkHospitalClient.Checked)
- { return; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.SelectHospitalClientSuperSmallForm frm = new SuperSmallForm.SelectHospitalClientSuperSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.chBox_Click();
- LYFZ.Model.Model_ErpHospitalClient model = frm.model;
- this.ComeSingleLotNumber = model.Hct_Oddnumber;
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- tmp.setHospitalClientValue(model);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- tmp.setHospitalClientValue(model);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- }
- }
- }
- }
- this.chkOldClient.Checked = false;
- this.chkOldClient.Enabled = true;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- this.chkOther.Checked = false;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.modelFriends = null;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- }
- /// <summary>
- /// 其他
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkOther_Click(object sender, EventArgs e)
- {
- if (this.chkOther.Checked)
- {
- this.chkOther.Checked = true;
- this.cmbtreevClientSource.Enabled = true;
- }
- else
- {
- this.chkOther.Checked = false;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- }
- this.modelFriends = null;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.chkOldClient.Checked = false;
- this.chkHospitalClient.Checked = false;
- this.chkFriends.Enabled = true;
- this.chkOldClient.Enabled = true;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 意向客户点击选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void lblYiXiangClient_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderSelectSuperSmallForm frm = new SuperSmallForm.OrderSelectSuperSmallForm();
- frm.Text = "选择订单(双击选择)";
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.chkFriends.Checked = false;
- this.chkOldClient.Checked = false;
- this.chkFriends.Enabled = true;
- this.chkOldClient.Enabled = true;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.ComeSingleLotNumber = "";
- this.modelOldClient = null;
- this.SelectIntentClient(frm.SelectOrderNumber, frm.SelectClientGroupNumber);
- }
- }
- /// <summary>
- /// 选择意向订单或意向客户组
- /// </summary>
- /// <param name="SelectOrderNumber"></param>
- /// <param name="SelectClientGroupNumber"></param>
- void SelectIntentClient(string SelectOrderNumber, string SelectClientGroupNumber)
- {
- if (this.IsUpdateOrderLoad)
- { return; }
- if (!string.IsNullOrEmpty(SelectOrderNumber))
- {
- this.StrNumber = SelectOrderNumber;
- this.OrderGroupNumber = SelectClientGroupNumber;
- this.OpenSingleLoad();
- }
- else
- {
- DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_CustomerGroupID = '" + SelectClientGroupNumber + "'", ShowColumnName: "GP_CustomerType").Tables[0];
- this.OrdType = (LYFZ.EnumPublic.OrderType)Convert.ToInt32(tblGroup.Rows[0]["GP_CustomerType"]);
- this.Text = "开单(" + this.OrdType.ToString() + ")";
- this.ClearDataReset();
- this.OrderGroupNumber = SelectClientGroupNumber;
- DataTable tbl = orbll.GetView_Custom("tb_ErpCustomerGroupMembers", StrWhere: "GM_CustomerGroupID = '" + this.OrderGroupNumber + "'", ShowColumnName: "GM_CustomerID,GM_Master,GM_ProtagonistCustomer,GM_RelatedPersonID").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- List<SetCustomControls.OrderClientParentsControlsEx> AdultList = new List<SetCustomControls.OrderClientParentsControlsEx>();
- List<SetCustomControls.OrderClientChildrenControlsEx> ChildList = new List<SetCustomControls.OrderClientChildrenControlsEx>();
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- bool Isbl = true;
- if (tbl.Rows.Count > 0)
- {
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && !tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (Isbl)
- { AdultList.Add(tmp); }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- bool Isbl = true;
- if (tbl.Rows.Count > 0)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- if (Isbl)
- { ChildList.Add(tmp); }
- }
- }
- //移除多余的客户组件
- for (int i = 0; i < AdultList.Count; i++)
- { this.flowPanel1.Controls.Remove(AdultList[i]); }
- if (this.OrdType != EnumPublic.OrderType.儿童订单)
- {
- for (int i = 0; i < ChildList.Count; i++)
- { this.flowPanel1.Controls.Remove(ChildList[i]); }
- }
- else if(this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- if (ChildList.Count>0)
- {
- if(this.flowPanel1.Controls.IndexOf(ChildList[0])==-1)
- {
- this.flowPanel1.Controls.Add(ChildList[0]);
- }
- }
- else
- {
- List<Control> controlLists = new List<Control>();
- foreach (Control control in this.flowPanel1.Controls)
- {
- controlLists.Add(control);
- }
- this.flowPanel1.Controls.Clear();
- SetCustomControls.OrderClientChildrenControlsEx children = new SetCustomControls.OrderClientChildrenControlsEx();
- children.LblClientName = "宝宝资料";
- children.IsPictDeleteShow = false;
- this.flowPanel1.Controls.Add(children);
- foreach(Control control in controlLists)
- {
- this.flowPanel1.Controls.Add(control);
- }
- }
-
- }
- }
- }
- }
- /// <summary>
- /// 清空客户来源
- /// </summary>
- void ClearClientSource()
- {
- this.chkOldClient.Checked = false;
- this.chkFriends.Checked = false;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.chkOther.Checked = false;
- this.cmbtreevClientSource.SetTextAndTag_ValueNull();
- this.modelOldClient = null;
- this.modelFriends = null;
- this.OrderGroupNumber = "";
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 获取客户来源
- /// </summary>
- /// <returns></returns>
- private string GetClientSource()
- {
- string StrClientSource = "";
- foreach (Control control in this.flowPanelClientSource.Controls)
- {
- foreach (Control control2 in control.Controls)
- {
- if (control2 is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control2;
- if (tmp.Checked)
- {
- if (tmp.Tag.ToString().Trim() == "其他")
- { StrClientSource = this.cmbtreevClientSource.Text.Trim(); }
- else
- { StrClientSource = tmp.Tag.ToString().Trim(); }
- }
- }
- }
- }
- return StrClientSource;
- }
- #endregion
- #region 喜爱格调
- /// <summary>
- /// 喜爱格调设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnStyleSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleSetSmallForm frm = new SetSmallForm.StyleSetSmallForm();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.StyleSetAdd(); }
- }
- /// <summary>
- /// 添加Check控件
- /// </summary>
- private void StyleSetAdd()
- {
- List<CheckBoxEx> chklist = new List<CheckBoxEx>();
- foreach (Control control in this.panelEx3.Controls)
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- chklist.Add(tmp);
- }
- }
- for (int i = 0; i < chklist.Count; i++)
- { this.panelEx3.Controls.Remove(chklist[i]); }
- DataTable tbl = stbll.GetAllList(" ID ASC").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- int StrTablIndex = 11;
- int LocationY = this.lblStyle.Location.Y + this.lblStyle.Height + 11;
- CheckBoxEx chBox = null;
- int[] Str1 = { 0, 5, 10, 15 };
- int[] Str2 = { 1, 6, 11, 16 };
- int[] Str3 = { 2, 7, 12, 17 };
- int[] Str4 = { 3, 8, 13, 18 };
- int[] Str5 = { 4, 9, 14, 19 };
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- chBox = new CheckBoxEx();
- if (Array.IndexOf(Str1, i) != -1)
- { chBox.Location = new Point(20, LocationY); }
- else if (Array.IndexOf(Str2, i) != -1)
- { chBox.Location = new Point(180, LocationY); }
- else if (Array.IndexOf(Str3, i) != -1)
- { chBox.Location = new Point(340, LocationY); }
- else if (Array.IndexOf(Str4, i) != -1)
- { chBox.Location = new Point(500, LocationY); }
- else if (Array.IndexOf(Str5, i) != -1)
- { chBox.Location = new Point(670, LocationY); LocationY += 25; }
- chBox.Name = "chk_" + tbl.Rows[i]["ID"].ToString();
- chBox.Tag= tbl.Rows[i]["ID"].ToString();
- chBox.Text = tbl.Rows[i]["Style_Name"].ToString();
- chBox.TabIndex = StrTablIndex;
- StrTablIndex++;
- this.panelEx3.Controls.Add(chBox);
- }
- }
- }
- /// <summary>
- /// 获取喜爱格调
- /// </summary>
- /// <returns></returns>
- private string GetStyle()
- {
- String strStyle = "";
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- if (tmp.Checked)
- { strStyle += tmp.Name.Trim() + "|"; }
- }
- }
- return strStyle.TrimEnd('|');
- }
- /// <summary>
- /// 获取喜爱格调
- /// </summary>
- /// <returns></returns>
- private List<string> GetStyleList()
- {
- List<string> ListID = new List<string>();
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- if (tmp.Checked)
- {
- string[] strArray = tmp.Name.Trim().Split('_');
- ListID.Add(strArray[1].Trim());
- }
- }
- }
- return ListID;
- }
- /// <summary>
- /// 喜爱风格—浏览选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void lblBrowseSelect_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
- frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.风格浏览;
- frm.OldSelectStyleList = GetStyleList();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<string> strList = frm.SelectStyleList;
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- bool IsFind = false;
- for (int i = 0; i < strList.Count; i++)
- {
- // string[] strArray = tmp.Name.Trim().Split('_');
- //if (strArray[1].Trim() == strList[i].Trim())
- if ( tmp.Text.ToLower().Trim() == strList[i].ToLower().Trim() )
- {
- IsFind = true;
- tmp.Checked = true;
- strList.RemoveAt(i);
- break;
- }
- }
- if (!IsFind)
- { tmp.Checked = false; }
- }
- }
- }
- }
- #endregion
- #region 选择接单人员
- /// <summary>
- /// 选择接单人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSelectUser_Click(object sender, EventArgs e)
- {
- strPersonData = new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses().txtOrdersPerson(this.txtOrderPerson, this.strPersonData);
- }
- #endregion
- #region 点击让滚动条获取焦点
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelEx3_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelEx2_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelVice1_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain1_Click(object sender, EventArgs e)
- {
- this.PanelMain1.Focus();
- }
- #endregion
- #endregion
- #region 第二页
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoOneControlsEx OrderEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoTwoControlsEx ServiceOrderEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProductControlsEx OrderProductEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderServiceControlsEx OrderServiceEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderStagesControlsEx OrderStagesEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderSightsControlsEx OrderSightsEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx OrderProcessesEx = null;
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabControl_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap2"].Name.Trim())
- {
- if (this.tabControl.TabPages["tap2"].Tag == null)
- {
- int PanelVice2Height = 0;
- Hashtable htData = new Hashtable();
- htData["IsShowSinceOrderNumber"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsCustomOrderNumber();
- htData["IsOrderNumber"] = "";
- htData["StrPrefix"] = this.GetOrderCustomPrefix();
- htData["StrOrderType"] = this.OrdType.ToString().Trim();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx == null)
- {
- this.ServiceOrderEx = new SetCustomControls.OrderInfoTwoControlsEx(htData);
- this.flowPanel2.Controls.Add(this.ServiceOrderEx);
- }
- PanelVice2Height += this.ServiceOrderEx.Height;
- break;
- default:
- if (this.OrderEx == null)
- {
- this.OrderEx = new SetCustomControls.OrderInfoOneControlsEx(htData);
- this.OrderEx.SeriesUpgradeEvent += OrderEx_SeriesUpgradeEvent;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚庆订单:
- this.OrderEx.IsHotelInfo = true;
- break;
- case EnumPublic.OrderType.儿童订单:
- this.OrderEx.IsShowIntoRegisterAndIntoBottom = false;
- break;
- }
- this.OrderEx.OrderTaoXiNodeMouseClick += OrderEx_OrderTaoXiNodeMouseClick;
- this.flowPanel2.Controls.Add(this.OrderEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderPackagesNameSet))
- { this.OrderEx.IsShowTaoXiNameSet = false; }
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClsssSet))
- { this.OrderEx.IsOrderClsssSet = false; }
- #endregion
- }
- PanelVice2Height += this.OrderEx.Height;
- break;
- }
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- if (this.OrderSightsEx == null)
- {
- this.OrderSightsEx = new SetCustomControls.OrderSightsControlsEx();
- this.flowPanel2.Controls.Add(this.OrderSightsEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
- { this.OrderSightsEx.IsShowSightsSet = false; }
- #endregion
- }
- this.OrderSightsEx.StrOrdNumber = this.StrNumber;
- PanelVice2Height += this.OrderSightsEx.Height;
- break;
- case EnumPublic.OrderType.儿童订单:
- if (this.OrderStagesEx == null)
- {
- this.OrderStagesEx = new SetCustomControls.OrderStagesControlsEx();
- this.flowPanel2.Controls.Add(this.OrderStagesEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
- { this.OrderStagesEx.IsShowStagesSet = false; }
- #endregion
- }
- this.OrderStagesEx.StrOrdNumber = this.StrNumber;
- PanelVice2Height += this.OrderStagesEx.Height;
- break;
- }
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.服务订单:
- if (this.OrderProductEx == null)
- {
- this.OrderProductEx = new SetCustomControls.OrderProductControlsEx();
- this.OrderProductEx.bSelectFilm = _bSelectFilm;
- this.OrderProductEx.OrdType = this.OrdType;
- this.flowPanel2.Controls.Add(this.OrderProductEx);
- if (this.OrderStagesEx != null)
- { this.OrderStagesEx.OrderProductEx = this.OrderProductEx; }
- }
- this.OrderProductEx.StrNumber = this.StrNumber;
- PanelVice2Height += this.OrderProductEx.Height;
- break;
- }
- if (this.OrderServiceEx == null)
- {
- this.OrderServiceEx = new SetCustomControls.OrderServiceControlsEx();
- this.OrderServiceEx.OrdType = this.OrdType;
- this.flowPanel2.Controls.Add(this.OrderServiceEx);
- if (this.OrderStagesEx != null)
- { this.OrderStagesEx.OrderServiceEx = this.OrderServiceEx; }
- }
- PanelVice2Height += this.OrderServiceEx.Height;
- this.panelVice2.Height = PanelVice2Height + 40;
- }
- this.PanelClick(this.panelVice2, 2);
- this.PanelMain2_Click(this, null);
- }
- else
- {
- if (this.tap3.Parent != null)
- {
- if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap3"].Name.Trim())
- {
- if (this.OrderProcessesEx == null)
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- this.OrderProcessesEx = new SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx(this.StrNumber, Convert.ToInt32(this.OrdType).ToString());
- //this.OrderProcessesEx.Dock = DockStyle.Fill;
- this.panelVice3.Controls.Add(this.OrderProcessesEx);
- if (this.panelVice3.Height < this.OrderProcessesEx.Height)
- { this.panelVice3.Height = this.OrderProcessesEx.Height; }
- //else
- //{ this.panelVice3.Height = this.PanelMain3.Height; }
- this.PanelClick(this.panelVice3, 3);
- this.PanelMain3_Click(this, null);
- }));
- }
- catch
- { }
- });
- }
- }
- }
- }
- }
- /// <summary>
- /// 升级套系事件
- /// </summary>
- void OrderEx_SeriesUpgradeEvent()
- {
- if (string.IsNullOrEmpty(strOldTaoXiName))
- {
- this.strOldTaoXiName = this.OrderEx.cmbtreevTaoXiName.Text;
- this.strOldTaoXiCode = this.OrderEx.cmbtreevTaoXiName.Tag.ToString();
- this.strOldTaoXiPrice = decimal.Parse(this.OrderEx.txtTaoXiPrice.Text);
- }
- //throw new NotImplementedException();
- if (this.OrderProductEx != null)
- {
- this.OrderProductEx.DeleteSightByNotAction();
- }
- if (OrderServiceEx!=null)
- {
- OrderServiceEx.DeleteSightByNotAction();
- }
- if(this.OrderSightsEx!=null)
- {
- this.OrderSightsEx.DeleteSightByNotAction();
- }
- else if (this.OrderStagesEx != null)
- {
- this.OrderStagesEx.DeleteSightByNotAction();
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="Panelcontrol"></param>
- void PanelClick(Control Panelcontrol, int LoadType)
- {
- if (Panelcontrol.Controls.Count > 0)
- {
- foreach (Control control in Panelcontrol.Controls)
- {
- if (control is LYFZ.ComponentLibrary.PanelEx || control is UserControl || control is FlowLayoutPanel)
- {
- if (LoadType == 2)
- { control.Click += PanelMain2_Click; }
- else if (LoadType == 3)
- { control.Click += PanelMain3_Click; }
- if (control.Controls.Count > 0)
- {
- this.PanelClick(control, LoadType);
- }
- }
- }
- }
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain2_Click(object sender, EventArgs e)
- { this.PanelMain2.Focus(); }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain3_Click(object sender, EventArgs e)
- {
- this.PanelMain3.Focus();
- }
- /// <summary>
- /// 套系选择
- /// </summary>
- /// <param name="objTaoXiNameTag">套系编号</param>
- /// <param name="IsActivity">是否可以操作</param>
- /// <param name="PackagesType">类型,判断是礼包还是套系</param>
- /// <param name="dtPackages">礼包几选几数据</param>
- void OrderEx_OrderTaoXiNodeMouseClick(object objTaoXiNameTag, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType, Hashtable htData)
- {
- if (objTaoXiNameTag != null)
- {
- string StrWhere = " And Pgm_PackagesCode = '" + objTaoXiNameTag.ToString().Trim() + "'";
- if (htData.ContainsKey("OptionalSeveral") && htData["OptionalSeveral"].ToString().Trim().Length > 0 && Convert.ToInt32(htData["OptionalSeveral"]) >= 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxPackageListViewSamllForm frm = new SetSmallForm.ToolboxPackageListViewSamllForm();
- frm.intOptionalSeveral = Convert.ToInt32(htData["OptionalSeveral"]);
- frm.StrPackageCode = objTaoXiNameTag.ToString().Trim();
- frm.StrOrderType = this.OrdType;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<int> listID = frm.listID;
- string StrIDing = "";
- for (int i = 0; i < listID.Count; i++)
- { StrIDing += listID[i].ToString().Trim() + ","; }
- if (!string.IsNullOrEmpty(StrIDing))
- { StrWhere = " And tb_ErpPackagesGiftMerchandise.ID in (" + StrIDing.TrimEnd(',') + ")"; }
- }
- else
- { OrderEx.RemovePackageItem(); return; }
- }
- string strMagess = "";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- if (!string.IsNullOrEmpty(objTaoXiNameTag.ToString().Trim()))
- {
- string StrSource = "'' AS TaoXiNameSource,";
- if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
- { StrSource = "'礼包' AS TaoXiNameSource,"; }
- string ExecuteSql = "select tb_ErpTheScenery.ID," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Tsc_Rating,Sc_ClassName,Tcs_Category,case when Tcs_Category = 0 then '内景' else '外景' end AS Tcs_CategoryText,Tsc_CostPrice,Tsc_SalesPrice,Tsc_Remark,Pgm_ProductName,Pgm_GiveType," +
- "Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
- "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') " + StrWhere + ";";
- ExecuteSql += "select Prod_Number," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Pgm_ProductNumber,Prod_Name,Prod_Batch,Prod_CostPrice,Prod_SalesPrice,Prod_Class,Prod_Unit,Prod_Thumbnail,Pgm_ProductNumber,Pgm_ProductName,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_GiveType," +
- "Pgm_Quantity,Pgm_GiveType,Pgm_ProductGroupName from tb_ErpPackagesGiftMerchandise Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') " + StrWhere + ";";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dtSights = dsData.Tables["ds"];
- DataTable dtProduct = dsData.Tables["ds1"];
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (this.OrderSightsEx != null)
- {
- DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '2'");
- if (this.OrderSightsEx.bUpgrade)
- {
- this.OrderSightsEx.DeleteSightByNotAction();
- }
- strMagess += this.OrderSightsEx.SetOrderSightsValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderStagesEx != null)
- {
- DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '3'");
- if (this.OrderStagesEx.bUpgrade)
- {
- this.OrderStagesEx.DeleteSightByNotAction();
- }
- strMagess += this.OrderStagesEx.SetOrderStagesValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderServiceEx != null)
- {
- DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '1'");
- strMagess += this.OrderServiceEx.SetOrderServiceValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderProductEx != null)
- {
- DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '0'");
- strMagess += this.OrderProductEx.SetOrderProductValue(dtRow, IsActivity, PackagesType);
- }
- }));
- }
- catch { }
- }
- else if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (this.OrderSightsEx != null)
- {
- try
- { this.OrderSightsEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderStagesEx != null)
- {
- try
- { this.OrderStagesEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderServiceEx != null)
- {
- try
- { this.OrderServiceEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderProductEx != null)
- {
- try
- { this.OrderProductEx.RemovePackageItem(); }
- catch { }
- }
- }));
- }
- });
- if (strMagess.Trim() != "")
- { MessageBoxCustom.Show(strMagess); }
- }
- }
- #endregion
- }
- }
|