123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using LYFZ.ComponentLibrary;
- using LYFZ.Helper;
- using System.IO;
- using System.Diagnostics;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess
- {
- public partial class FilmSelectionFormMain : LYFZ.Software.UI.DoorCityProcess.FilmSelectionFormMain
- {
- #region OSS云传片
- bool useOss = false;
- List<AliyunOssLibrary.Model.SimplifyBranch> listbranch = null;
- #endregion
- #region N8选版开启、程序路径属性
- public bool IsUserN8ViewGo
- {
- get; set;
- }
- public string N8ViewGoPath
- {
- get; set;
- }
- #endregion
- #region 2017-03-18 杨云奕 添加 获取门店配置的ftp情况
- BLL.BaseBLL.BaseBLL_FTPServiceUserAccount ftpbll = new BLL.BaseBLL.BaseBLL_FTPServiceUserAccount();
- DataSet ftpData;
- #endregion
- LYFZ.BLL.BLL_ErpOrder obll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
- LYFZ.BLL.BLL_ErpOrderDigital dbll = new LYFZ.BLL.BLL_ErpOrderDigital();
- public FilmSelectionFormMain()
- {
- this.Shown += FilmSelectionFormMain_Shown;
- this.Load += FilmSelectionFormMain_Load;
- this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
- this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnHasRepairNoSelection.Click += btnHasRepairNoSelection_Click;
- this.btnConditionQuery.Click += btnConditionQuery_Click;
- this.btnStartFilmSelection.Click += btnStartFilmSelection_Click;
- this.btnCacheNative.Click += btnCacheNative_Click;
- this.btnCacheManage.Click += btnCacheManage_Click;
- this.btnChangeFilmSelection.Click += btnChangeFilmSelection_Click;
- this.btnViewCropped.Click += btnViewCropped_Click;
- this.btnClose.Click += btnClose_Click;
- this.chkDressVersion.Click += chkDressVersion_Click;
- this.chkKidsVersion.Click += chkKidsVersion_Click;
- this.chkPortraitVersion.Click += chkPortraitVersion_Click;
- this.dgvData.CellMouseDown += dgvData_CellMouseDown;
- this.dgvData.CellClick += dgvData_CellClick;
- this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
- this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
- this.btnYunFilmSelection.Click += btnYunFilmSelection_Click;
- this.btnYunFilmSelectionResult.Click += btnYunFilmSelectionResult_Click;
- this.btnExport.Click += btnExport_Click;
- this.flowLayoutPanel1.Height = 34;
- //打单功能
- btnPrintOrder.Click += btnPrintOrder_Click;
- // N8选版按钮;
- this.btn_N8ViewGo.Click += Btn_N8ViewGo_Click;
- this.Resize += FilmSelectionFormMain_Resize;
- ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
- this.chkCompleteOrder.Click += ChkCompleteOrder_Click;
- this.btn_CusOssUpload.Click += Btn_CusOssUpload_Click;
- this.btn_CusOssUpload.Visible = false;
- }
- /// <summary>
- /// 客照云传;
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Btn_CusOssUpload_Click( object sender, EventArgs e )
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- backgroundWorker.ReportProgress( 0, "正在上传中,请稍等..." );
- // 选中行;
- if ( this.dgvData.SelectedRows.Count == 0 )
- {
- MessageBoxCustom.Show( "请选择要上传的客照" );
- return;
- }
- if ( !OssTask.frmOssTask.IsExistsEnterpriseID() )
- {
- MessageBoxCustom.Show( "未注册企业ID,请联系服务商注册" );
- return;
- }
- // 选择os type;
- OssTask.frmChooseOsType dlg = new OssTask.frmChooseOsType();
- if ( DialogResult.OK != dlg.ShowDialog() )
- {
- return;
- }
- // 选择第一行;
- DataGridViewRow row = this.dgvData.SelectedRows[0];
- // 订单号;
- string strOrderNumber = row.Cells["Ord_Number"].Value.ToString();
- // 订单类型;
- string strOrderType = row.Cells["订单类型"].Value.ToString();
- // 副订单号;
- string strViceOrderNumber = row.Cells["Ordv_ViceNumber"].Value.ToString();
- // 客户姓名;
- string strCusNames = row.Cells["客户姓名"].Value.ToString();
- // 客户性别;
- string strCusGenders = row.Cells["客户性别"].Value.ToString();
- // 客户电话;
- string strCusPhones = row.Cells["客户电话"].Value.ToString();
- // 相片类型;
- string strPhotosType = "选好的片";
- // 拍摄名称;
- string strScenery = "";
- if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
- {
- try
- {
- strScenery = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
- }
- catch { }
- }
- // 上传的相片;
- List<string> listPhotos = null;
- if ( !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
- {
- listPhotos = LYFZ.Software.MainBusiness.OssTask.frmOssTask.GetSelectedPhotos( strOrderNumber, strViceOrderNumber, strScenery );
- // 生成任务;
- if ( listPhotos == null || listPhotos.Count == 0 )
- {
- MessageBoxCustom.Show( "该订单没有相片,不生成任务" );
- return;
- }
- }
- /*if ( LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTaskEx(
- dlg.cb_baidu.Checked ? 2 : -1,
- dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
- Convert.ToInt32( dlg.dup_times.SelectedItem ),
- strOrderNumber, strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos ) )
- {
- MessageBoxCustom.Show( "任务生成成功!" );
- }*/
- OssTask.JsonOssTask jsonOssTask = LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTask(
- //dlg.cb_baidu.Checked ? 2 : -1,
- LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl ? 2 : -1,
- //dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
- DateTime.Now.AddMonths( 1 ).ToString( "yyyy-MM-dd 00:00:00" ),
- //Convert.ToInt32( dlg.dup_times.SelectedItem ),
- 1,
- strOrderNumber, "子订单号", strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos );
- if ( jsonOssTask != null )
- {
- // 如果任务列表空,加载任务;
- //if ( OssTask.frmOssTask.IsTaskListNullOrEmpty() )
- /*{
- // 从服务器加载文件数据;
- List<string> listJson;
- if ( LYFZ.Network.PlatinumClientProcess.GetOssTaskInfoFromSvr( out listJson ) )
- {
- OssTask.frmOssTask.LoadOssTask2( listJson );
- }
- }*/
- // 是否存在;
- //if ( OssTask.frmOssTask.IsTaskExists( jsonOssTask ) )
- string strJson;
- if ( LYFZ.Network.PlatinumClientProcess.IsOssTaskInfoExists( jsonOssTask.TaskID, out strJson ) )
- {// 任务已存在;
- MessageBoxCustom.Show( "任务已存在, 若要重新上传, 请到服务端删除任务再上传!" );
- }
- else
- {// 新增任务;
- if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
- {
- LYFZ.Software.MainBusiness.OssTask.frmBaiduShareUrl frm = new OssTask.frmBaiduShareUrl();
- frm.ShowDialog();
- if ( frm.DialogResult == DialogResult.OK )
- {
- jsonOssTask.BaiduExtrCode = frm.tx_code.Text;
- jsonOssTask.BaiduShareUrl = frm.tx_url.Text;
- OssTask.frmOssTask.SendBaiduShare2WebSrv( jsonOssTask );
- }
- else
- {
- return;
- }
- }
- else
- {
- if ( OssTask.frmOssTask.SendOssTask2Svr( jsonOssTask ) )
- {
- OssTask.frmOssTask.PushTask( jsonOssTask );
- MessageBoxCustom.Show( "任务生成成功!" );
- }
- else
- {
- MessageBoxCustom.Show( "任务生成失败!" );
- }
- }
- }
- }
- } );
- }
- private void ChkCompleteOrder_Click( object sender, EventArgs e )
- {
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
- {
- //pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
- this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
- PublicFunctionRows();
- return ucPagerEx1.NMax;
- }
- public void BindPageData( int pageIndx, int pageSize, int totalCount )
- {
- ucPagerEx1.NMax = totalCount;
- ucPagerEx1.CurrentPageCount = (pageSize);
- ucPagerEx1.PageCurrent = pageIndx;
- }
- private void Btn_N8ViewGo_Click( object sender, EventArgs e )
- {
- #region N8选版
- if ( File.Exists( N8ViewGoPath ) )
- {
- LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
- LYFZ.Model.Model_ErpOrderDigital vmodel = dbll.GetModel( "Ordv_ViceNumber", this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value );
- // 是否完成了选版;
- bool bFinishView = false;
- // 商品列表;
- List<LYFZ.Model.Model_ErpOrderProductList> listProduct = null;
- // 员工id;
- string staffId = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- // 员工姓名;
- string staffName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- // 若N8已选的选版目录;
- StringBuilder strN8HasSelectPath = new StringBuilder();
- // 若N8未选的选版目录;
- StringBuilder strN8UnSelectPath = new StringBuilder();
- // 订单商品信息;
- LYFZ.BLL.BLL_ErpOrder currentOrderBll = new BLL.BLL_ErpOrder();
- // 是否已经N8选版完成;
- bool keepOnN8ViewGo = false;
- LYFZ.ExtendControlLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- // 获取订单类型:儿童订单、婚纱订单……;
- LYFZ.EnumPublic.OrderType currentOrderType = (LYFZ.EnumPublic.OrderType)Convert.ToInt32( model.Ord_Type );
- if ( LYFZ.Network.PlatinumClientProcess.N8SvrConfig == null )
- {
- MessageBoxCustom.Show( "服务器未设置N8信息,请到服务器设置" );
- return;
- }
- strN8HasSelectPath.Append( LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerUserDirectory );
- strN8UnSelectPath.Append( LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerUserDirectory );
- if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
- {
- // 获取儿童订单的成长次数名;
- LYFZ.BLL.BLL_ErpOrdersPhotography photoBll = new BLL.BLL_ErpOrdersPhotography();
- List<LYFZ.Model.Model_ErpOrdersPhotography> photoModelList = photoBll.GetViceNumberToModel( vmodel.Ordv_ViceNumber );
- // 次数名;
- string CurrentSightsName = photoModelList[0].Ordpg_Sights;
- strN8HasSelectPath.Append( model.Ord_Number );
- strN8HasSelectPath.Append( "\\[已选]" );
- strN8HasSelectPath.Append( CurrentSightsName );
- strN8UnSelectPath.Append( model.Ord_Number );
- strN8UnSelectPath.Append( "\\" );
- strN8UnSelectPath.Append( CurrentSightsName );
- }
- else
- {
- strN8HasSelectPath.Append( "[已选]" );
- strN8HasSelectPath.Append( model.Ord_Number );
- strN8UnSelectPath.Append( model.Ord_Number );
- }
- // 获取订单商品信息;
- listProduct = currentOrderBll.GetOrderProductList( vmodel.Ordv_Number, vmodel.Ordv_ViceNumber, DAL.OrderProductType.制作商品 );
- if ( Directory.Exists( strN8HasSelectPath.ToString() ) )
- {
- if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
- {
- if ( DialogResult.Yes == MessageBoxCustom.Show( "该儿童成长次数选版已完成,是否继续N8选版?", "提示消息", MessageBoxButtons.YesNo ) )
- {
- keepOnN8ViewGo = true;
- }
- }
- else
- {
- if ( DialogResult.Yes == MessageBoxCustom.Show( "该订单选版已完成,是否继续N8选版?", "提示消息", MessageBoxButtons.YesNo ) )
- {
- keepOnN8ViewGo = true;
- }
- }
- bFinishView = true;
- }
- else
- {// 如果没有选版完成,导入商品信息到本次N8选版订单中;
- if ( !Directory.Exists( strN8UnSelectPath.ToString() ) )
- {
- if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
- MessageBoxCustom.Show( "未找到该童成长次数选版,退出N8选版" );
- else
- MessageBoxCustom.Show( "未找到该订单选版,退出N8选版" );
- return;
- }
- keepOnN8ViewGo = true;
- if ( !Directory.Exists( strN8UnSelectPath + "\\选版结果\\" ) )
- {
- Directory.CreateDirectory( strN8UnSelectPath + "\\选版结果\\" );
- }
- // 导入商品到本次n8选版结果中;
- //File.Delete(strN8UnSelectPath + "\\选版结果\\product.data");
- //File.Delete(strN8UnSelectPath + "\\选版结果\\vgproduct.data");
- DAL.N8Process.DAL_N8ResultProduct dalResulProduct = new DAL.N8Process.DAL_N8ResultProduct( strN8UnSelectPath + "\\选版结果\\product.data" );
- DAL.N8Process.DAL_N8ResultViewGoProduct dalResulViewGoProduct = new DAL.N8Process.DAL_N8ResultViewGoProduct( strN8UnSelectPath + "\\选版结果\\vgproduct.data" );
- if ( !File.Exists( strN8UnSelectPath + "\\选版结果\\product.data" ) || !File.Exists( strN8UnSelectPath + "\\选版结果\\vgproduct.data" ) )
- {
- foreach ( Model.Model_ErpOrderProductList product in listProduct )
- {// 遍历添加;
- dalResulProduct.AddResultProduct( product.ID.ToString(), product.OPlist_ProdNumber, "", product.OPlist_ProdName, product.OPlist_ProdWidth, product.OPlist_ProdHeight, false );
- dalResulViewGoProduct.AddResultViewGoProduct( product.ID.ToString(), product.OPlist_ProdNumber, "", product.OPlist_ProdName, product.OPlist_ProdWidth, product.OPlist_ProdHeight, false );
- }
- }
- }
- } );
- try
- {
- if ( keepOnN8ViewGo )
- {
- ProcessStartInfo startInfo = new ProcessStartInfo( N8ViewGoPath );
- startInfo.Arguments = string.Format( "/t \"<task userfolder='{0}' staffid='{1}' serverip='{2}'/>\"", bFinishView ? strN8HasSelectPath.ToString() : strN8UnSelectPath.ToString(), staffId, LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerIpAddress );
- Process proc = Process.Start( startInfo );
- if ( proc != null )
- {
- proc.WaitForExit();
- MessageBoxCustom.Show( "选版完成" );
- }
- }
- if ( !bFinishView && Directory.Exists( strN8HasSelectPath.ToString() ) )
- {
- bFinishView = true;
- }
- // N8选版完成,处理加挑;
- #if !DEBUG
- if ( bFinishView )
- #endif
- {
- frmSaveN8Selection dlg = new frmSaveN8Selection();
- dlg.N8ServerUserDirectory = Directory.Exists( strN8HasSelectPath.ToString() ) ? strN8HasSelectPath.ToString() : strN8UnSelectPath.ToString();
- dlg.CurrentModel = model;
- dlg.CurrentModelDigital = vmodel;
- dlg.PhotoModelList = listProduct;
- dlg.ShowDialog();
- }
- }
- catch ( ArgumentException ex )
- {
- MessageBox.Show( ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
- }
- }
- else
- {
- MessageBoxCustom.Show( "N8选版客户端程序不存在, 请重置!" );
- }
- #endregion
- }
- void btnExport_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.CurrentRow.Index >= 0 )
- {
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm frm = new LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm();
- frm.ShowDialog();
- if ( frm.IsSaveed )
- {
- try
- {
- if ( !frm.isExportPhotograph )
- {
- if ( frm.IsExportCurrent )
- {
- this.dgvData.ExportDataTable( StrFileName: "订单报表" );
- }
- else
- {
- Dictionary<string, string> dictColumns = new Dictionary<string, string>();
- //Hashtable htData =
- DataTable newTable = this.GetExportReportData();
- SaveFileDialog saveFile = new SaveFileDialog();
- saveFile.FileName = "订单报表";
- saveFile.Title = "导出数据报表文件";
- saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
- saveFile.FilterIndex = 1;
- DialogResult drst = saveFile.ShowDialog();
- if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
- {
- return;
- }
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate (object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
- {
- try
- {
- if (LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel(saveFile.FileName.Trim(), newTable, null, backgroundWorker))
- {
- MessageBoxCustom.Show("数据导出成功!");
- }
- else
- {
- MessageBoxCustom.Show("数据导出失败!");
- }
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(String.Format("导出数据出错:{0}", ex.Message));
- }
- });
- }
- }
- else
- {
- Dictionary<string, string> dictColumns = new Dictionary<string, string>();
- DataTable newTable = GetExportReportData();
- SaveFileDialog saveFile = new SaveFileDialog();
- saveFile.FileName = "订单报表";
- saveFile.Title = "导出数据报表文件";
- saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
- saveFile.FilterIndex = 1;
- DialogResult drst = saveFile.ShowDialog();
- if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
- {
- return;
- }
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate (object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
- {
- try
- {
- if (LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel(saveFile.FileName.Trim(), newTable, null, backgroundWorker))
- {
- MessageBoxCustom.Show("数据导出成功!");
- }
- else
- {
- MessageBoxCustom.Show("数据导出失败!");
- }
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(String.Format("导出数据出错:{0}", ex.Message));
- }
- });
- }
- }
- catch ( Exception ex )
- {
- MessageBoxCustom.Show( "导出失败:" + ex.Message );
- }
- }
- }
- }
- }
- private DataTable GetExportReportData()
- {
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,入册加挑张数,入底加挑张数,加挑金额,拍摄名称,拍照状态,摄影师,化妆师,引导师,初修师,初修状态,初修日期,选片师,选片日期,选片状态,设计状态,精修状态,看版状态,取件状态,会员卡号";
- string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0004.ToString().Trim();
- if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
- }
- else
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
- }
- this.dgvData.dgvGuidName = StrGuidName;
- this.dgvData.dgvUserEmployeeID = this.StrUserID;
- this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,会员卡号";
- this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
- Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
- this.dgvData.dictShowColumName = dictColumns;
- string StrQueryCondition = "";
- if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
- {
- string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
- this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
- StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
- }
- else
- {
- StrQueryCondition = this.GetWhereStr();
- }
- int intTopCount = 10000;
- DataSet dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderFilmSelection( dictColumns, StrQueryCondition, intTopCount, this.StrSortField, true );
- //PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- return dtSet.Tables[0];
- }
- void btnPrintOrder_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.CurrentRow != null )
- {
- string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
- LYFZ.BLL.BLL_ErpOrderDigital mydbll = new LYFZ.BLL.BLL_ErpOrderDigital();
- if ( this.dgvData.CurrentRow.Cells["选片状态"].Value.ToUpperString() == "OK" )
- {
- LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = null;
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- backgroundWorker.ReportProgress( 0, "正在获取选片信息...." );
- LYFZ.Model.Model_ErpOrderDigital vmodel = mydbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );
- LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", MainOrderNumber );
- eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint( model, vmodel );
- } );
- if ( eventSelectPhotoPrint != null )
- {
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.制作单明细, eventSelectPhotoPrint );
- }
- else
- {
- MessageBoxCustom.Show( "获取选片信息失败" );
- }
- }
- else
- {
- MessageBoxCustom.Show( "选片未完成,不可以打单!" );
- }
- }
- }
- /// <summary>
- /// 订单号(用于开单处跳转过来)
- /// </summary>
- public string StrOrdNumber = "";
- /// <summary>
- /// 是否首次运行
- /// </summary>
- bool IsFirstRun = true;
- /// <summary>
- /// 查询条件
- /// </summary>
- private Dictionary<string, string> DictData = new Dictionary<string, string>();
- /// <summary>
- /// 员工编号
- /// </summary>
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 员工姓名
- /// </summary>
- string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void FilmSelectionFormMain_Shown( object sender, EventArgs e )
- {
- ///重拍功能的的版本权限
- List<Control> hideControl = new List<Control>();
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- hideControl.Add( this.btnYunFilmSelection );
- hideControl.Add( this.btnYunFilmSelectionResult );
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片云选片,
- hideControl, null, null );
- hideControl = new List<Control>();
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- hideControl.Add( this.btnYunFilmSelectionResult );
- b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片云选片,
- hideControl, null, null );
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st008" );
- this.PublicFunctionRights();
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- this.IsFirstRun = false;
- this.FilmSelectionFormMain_Resize( this, null );
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void FilmSelectionFormMain_Load( object sender, EventArgs e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
- this.cmbQueryText.Text = this.StrOrdNumber;
- #region 获取是否N8选版
- if ( BLL.BLL_N8ClientConfig.N8ViewGoEnable )
- {
- // 显示n8选版按钮;
- this.btn_N8ViewGo.Visible = true;
- // 获取本机是否启动N8选版信息;
- IsUserN8ViewGo = true;
- N8ViewGoPath = BLL.BLL_N8ClientConfig.N8ViewGoPath;
- // 获取N8服务器地址;
- if ( LYFZ.Network.PlatinumClientProcess.N8SvrConfig == null )
- LYFZ.Network.PlatinumClientProcess.GetN8ServerConfig();
- }
- #endregion
- }
- /// <summary>
- /// 选择分店获取权限
- /// </summary>
- void PublicFunctionRights()
- {
- this.btnStartFilmSelection.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.StartFilmSelection );
- this.btnCacheNative.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.FilmSelectionCache );
- //this.btnCacheManage.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.FilmSelectionCacheManage);
- this.btnYunFilmSelection.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.YunSelectionFilm );
- this.btnYunFilmSelectionResult.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.YunSelectionFilmResult );
- this.btnExport.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.DataExport );
- }
- /// <summary>
- /// 分店选择查询数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
- {
- this.PublicFunctionRights();
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 回车
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbQueryText_KeyDown( object sender, KeyEventArgs e )
- {
- if ( e.KeyCode == Keys.Enter )
- {
- this.btnQuery_Click( this, null );
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click( object sender, EventArgs e )
- {
- this.DictData.Clear();
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 已修未选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnHasRepairNoSelection_Click( object sender, EventArgs e )
- {
- this.DictData.Clear();
- DictData["FilmSelectionStatus"] = LYFZ.EnumPublic.FilmSelectionStatusEnum.未选.ToString();
- DictData["EarlyRepairStatus"] = "OK,修片中";
- DictData["PickupStatusNotOK"] = "OK";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 条件查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnConditionQuery_Click( object sender, EventArgs e )
- {
- this.DictData.Clear();
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new SetSmallForm.ConditionQuerySamllForm();
- frm.bPhotographNumber = true;
- frm.LoadType = "选片";
- frm.ShowDialog();
- if ( frm.DictDataArray.Count > 0 )
- {
- this.DictData = frm.DictDataArray;
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- }
- /// <summary>
- /// 开始选片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnStartFilmSelection_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.CurrentRow != null )
- {
- if ( this.dgvData.CurrentRow.Index >= 0 )
- {
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
- if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
- {
- return;
- }
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(
- LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片选P, false );
- LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionStart.ShowPhotoSelectSystemMainPhotoSelect( this.dgvData.CurrentRow );
-
- return;
- }
- }
- MessageBoxCustom.Show( "请选择订单" );
- }
- }
- /// <summary>
- /// 缓存本机
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnCacheNative_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.CurrentRow != null )
- {
- if ( !LYFZ.WinAPI.CustomPublicMethod.CheckInternaNetworkAddress( LYFZ.BLL.SelectPhotoHandling.ServerSddress ) )
- {
- ExMessageBoxCustom.Show( "外网访问时禁止缓存相片!." );
- return;
- }
- string ViceName = "";
- if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
- {
- try
- {
- ViceName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
- }
- catch { }
- }
- string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
- if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
- {
- return;
- }
- LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", MainOrderNumber );
- LYFZ.Model.Model_ErpOrderDigital vmodel = dbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );
- LYFZ.PhotoSelectSystem.LocalCachePhoto lp = new PhotoSelectSystem.LocalCachePhoto( model, vmodel );
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- lp.CachePhotoToLocal( ViceName, backgroundWorker );
- }, width: 500 );
- }
- else
- {
- MessageBoxCustom.Show( "请选择你要缓存下来的订单" ); return;
- }
- }
- /// <summary>
- /// 管理缓存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnCacheManage_Click( object sender, EventArgs e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.CacheManageSuperSmallForm frm = new SuperSmallForm.CacheManageSuperSmallForm();
- frm.ShowDialog();
- }
- /// <summary>
- /// 选片更改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnChangeFilmSelection_Click( object sender, EventArgs e )
- {
- MessageBoxCustom.Show( "此功能暂未开放" ); return;
- }
- /// <summary>
- /// 查看裁剪
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnViewCropped_Click( object sender, EventArgs e )
- {
- MessageBoxCustom.Show( "此功能暂未开放" ); return;
- }
- /// <summary>
- /// 云选片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnYunFilmSelection_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0 )
- {
- string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
- if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
- {
- return;
- }
- DoorCityProcess.DesignFormMain.ShowCloudSelection( MainOrderNumber, ViceOrderNumber, 0, 0 );
- }
- else
- {
- MessageBoxCustom.Show( "请选择要上传的订单" );
- }
- }
- }
- /// <summary>
- /// 云选片结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnYunFilmSelectionResult_Click( object sender, EventArgs e )
- {
- DoorCityProcess.DesignFormMain.ShowCloudSelection( "", "", 1, 0 );
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click( object sender, EventArgs e )
- {
- this.Close();
- }
- /// <summary>
- /// 儿童版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkKidsVersion_Click( object sender, EventArgs e )
- {
- if ( this.chkKidsVersion.Checked )
- {
- this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false;
- }
- this.cmbQueryText.Text = "";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 婚纱版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkDressVersion_Click( object sender, EventArgs e )
- {
- if ( this.chkDressVersion.Checked )
- {
- this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = true; this.chkKidsVersion.Checked = false;
- }
- this.cmbQueryText.Text = "";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 写真版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkPortraitVersion_Click( object sender, EventArgs e )
- {
- if ( this.chkPortraitVersion.Checked )
- {
- this.chkPortraitVersion.Checked = true; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false;
- }
- this.cmbQueryText.Text = "";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 窗体大小发生改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void FilmSelectionFormMain_Resize( object sender, EventArgs e )
- {
- if ( !this.IsFirstRun )
- {
- switch ( this.panelPortraitVersion.Location.Y )
- {
- case 4: this.flowLayoutPanel1.Height = 36; break;
- case 36: this.flowLayoutPanel1.Height = 68; break;
- }
- }
- }
- /// <summary>
- /// 点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
- {
- if ( e.Button == MouseButtons.Right )
- {
- if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
- {
- bool IsFind = false;
- Hashtable htData = null;
- ToolStripMenuItem item = null;
- if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "选片状态" )
- {
- if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.ProcessStatusReset ) )
- {
- this.dgvData.conMenu.Items.Clear();
- htData = new Hashtable();
- htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
- htData["StrStatusName"] = this.dgvData.Columns[e.ColumnIndex].Name.Trim() + ":";
- htData["StrStatusType"] = "2";
- htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
- //弹出操作菜单
- item = new ToolStripMenuItem();
- item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
- item.Tag = htData;
- item.Name = "ResetStatus";
- this.dgvData.conMenu.Items.Add( item );
- IsFind = true;
- }
- }
- else if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "选片日期" && this.dgvData.Rows[e.RowIndex].Cells["选片日期"].Value.ToString().Trim() != "" )
- {
- if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.ProcessDateReset ) )
- {
- this.dgvData.conMenu.Items.Clear();
- htData = new Hashtable();
- htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
- htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
- htData["StrOldDate"] = this.dgvData.Rows[e.RowIndex].Cells["选片日期"].Value.ToString().Trim();
- item = new ToolStripMenuItem();
- item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
- item.Tag = htData;
- item.Name = "ResetDate";
- this.dgvData.conMenu.Items.Add( item );
- IsFind = true;
- }
- }
- item = new ToolStripMenuItem();
- htData = new Hashtable();
- htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
- htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
- item.Text = "订单备注";
- item.Tag = htData;
- item.Name = "OrderRemark";
- this.dgvData.conMenu.Items.Add( item );
- IsFind = true;
- if ( IsFind )
- {
- // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
- this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
- this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
- // this.dgvData.conMenu.Show();
- if (!this.dgvData.conMenu.Visible)
- {
- this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
- }
- }
- if ( htData != null )
- {
- BindContextMenu( this.dgvData.Rows[e.RowIndex] );
- }
- }
- else
- {
- this.dgvData.conMenu.Items.Clear();
- ToolStripMenuItem item = new ToolStripMenuItem();
- item.Text = "设置标题";
- item.Tag = "SetColumnShow";
- item.Name = "SetColumnShow";
- this.dgvData.conMenu.Items.Add( item );
- // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
- this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
- this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
- // this.dgvData.conMenu.Show();
- if (!this.dgvData.conMenu.Visible)
- {
- this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
- }
- }
- }
- }
- /// <summary>
- /// 列表单击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
- {
- try
- {
- string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
- if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
- {
- bool IsFind = false;
- int i = this.dgvData.CurrentRow.Index;
- while ( !IsFind )
- {
- i = i - 1;
- if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
- {
- StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
- }
- }
- }
- LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
- }
- catch
- {
- }
- }
- /// <summary>
- /// 对列表控件双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
- {
- Point hit = this.dgvData.PointToClient( Cursor.Position );
- DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
- if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
- {
- if ( !string.IsNullOrEmpty( this.cmbQueryText.Text.Trim() ) )
- {
- LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
- this.cmbQueryText.Text = "";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- }
- }
- /// <summary>
- /// 右键菜单选择项事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
- {
- ToolStripItem item = e.ClickedItem;
- if ( item.Name.Trim() == "SetColumnShow" )
- {
- if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
- {
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- }
- else if ( item.Name.ToString().Trim() == "OrderRemark" )
- {
- Hashtable htData = (Hashtable)item.Tag;
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
- frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
- frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
- frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.订单选片.ToString().Trim();
- frm.ShowDialog();
- }
- else if ( item.Name.ToString().Trim() == "ResetStatus" )
- {
- Hashtable htData = (Hashtable)item.Tag;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderStatusResetSmallForm frm = new SetSmallForm.OrderStatusResetSmallForm();
- frm.StrNumber = htData["StrNumber"].ToString();
- frm.StrStatusName = htData["StrStatusName"].ToString();
- frm.StrStatusType = htData["StrStatusType"].ToString();
- frm.StrViceNumber = htData["StrViceNumber"].ToString();
- frm.ShowDialog();
- if ( frm.IsSaveed )
- {
- //PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- return;
- }
- else if ( item.Name.ToString().Trim() == "ResetDate" )
- {
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.GetDateSuperSmallForm frm = new CameraControlBook.SuperSmallForm.GetDateSuperSmallForm();
- frm.IsValueNull = false;
- frm.ShowDialog();
- if ( !frm.IsOK )
- {
- return;
- }
- if ( MessageBoxCustom.Show( "您确定要重置移选片日期吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.No )
- {
- return;
- }
- DateTime strTime = SDateTime.Now;
- Hashtable htData = (Hashtable)item.Tag;
- List<Helper.CommandInfo> clist = new List<CommandInfo>();
- LYFZ.Model.Model_ErpOrderDigital model = dbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] );
- model.Ordv_FilmSelectionTime = Convert.ToDateTime( frm.StrValue );
- model.Ordv_ReservationFilmSelectionTime = model.Ordv_FilmSelectionTime;
- model.Ordv_UpdateDateTime = strTime;
- model.Ordv_UpdateName = this.StrUserID;
- clist.Add( dbll.GetUpdateCommandInfo( model ) );
- string StrContent = "[重置选片日期] 数码编号为:" + htData["StrViceNumber"] + ",的选片日期由" + htData["StrOldDate"] + "改为" + frm.StrValue;
- clist.Add( slogbll.GetAddCommandInfo( LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.订单流程重置, StrContent, this.StrUserID, this.StrUserName, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP ) ) );
- if ( clist.Count > 0 )
- {
- if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
- {
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- MessageBoxCustom.Show( "重置成功!" );
- }
- else
- {
- MessageBoxCustom.Show( "重置失败!" );
- }
- }
- }
- }
- /// <summary>
- /// 点击列标头排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
- {
- if ( e.Button == MouseButtons.Left )
- {
- string StrColumnName = GetOrderByName( this.dgvData.Columns[e.ColumnIndex].Name.Trim() );
- if ( StrColumnName == this.StrCurrentClickField || string.IsNullOrEmpty( this.StrCurrentClickField ) )
- {
- if ( this.StrSortOrder == "ASC" )
- {
- this.StrSortOrder = "DESC";
- }
- else
- {
- this.StrSortOrder = "ASC";
- }
- }
- else
- {
- this.StrSortOrder = "DESC";
- }
- if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "欠款" || StrColumnName.Trim() == "套系金额" )
- {
- this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime,Ordv_DigitalNumber";
- }
- else
- {
- this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber";
- }
- this.StrCurrentClickField = StrColumnName;
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- }
- string GetOrderByName( string StrColumnName )
- {
- if ( StrColumnName == "选片时间" )
- {
- return "(case when Ordv_FilmSelectionStatus = '0' then Ordv_ReservationFilmSelectionTime else Ordv_FilmSelectionTime end)";
- }
- else if ( StrColumnName == "拍摄名称" )
- {
- return " Ordpg_Sights ";
- }
- else if ( StrColumnName == "摄影师" )
- {
- return " Ordpg_Photographer ";
- }
- else if ( StrColumnName == "化妆师" )
- {
- return " Ordpg_MakeupArtist ";
- }
- else if ( StrColumnName == "引导师" )
- {
- return " Ordpg_BootDivision ";
- }
- else if ( StrColumnName == "拍摄时间" )
- {
- return " Ordpg_PhotographyTime ";
- }
- else if ( StrColumnName == "拍照状态" )
- {
- return " Ordpg_PhotographyStatus ";
- }
- else if ( StrColumnName == "订单号" )
- {
- return " Ord_SinceOrderNumber ";
- }
- else if ( StrColumnName == "客户姓名" )
- {
- return " Cus_Name ";
- }
- else if ( StrColumnName == "客户性别" )
- {
- return " Cus_Sex_cs ";
- }
- else if ( StrColumnName == "客户电话" )
- {
- return " Cus_Telephone ";
- }
- else if ( StrColumnName == "订单类型" )
- {
- return " Ord_Type ";
- }
- else if ( StrColumnName == "接单人" )
- {
- return " Ord_OrderPersonName ";
- }
- else if ( StrColumnName == "套系名称" )
- {
- return " Ord_SeriesName ";
- }
- else if ( StrColumnName == "套系价格" )
- {
- return " Ord_SeriesPrice ";
- }
- else if ( StrColumnName == "摄影师" )
- {
- return " Ordpg_Photographer ";
- }
- else if ( StrColumnName == "拍摄时间" )
- {
- return " Ordpg_PhotographyTime ";
- }
- else if ( StrColumnName == "拍照状态" )
- {
- return " Ordpg_PhotographyStatus ";
- }
- else if ( StrColumnName == "初修师" )
- {
- return " Ordv_EarlyRepairName ";
- }
- else if ( StrColumnName == "选片师" )
- {
- return " Ordv_FilmSelectionName ";
- }
- else if ( StrColumnName == "初修日期" )
- {
- return " Ordv_EarlyRepairTime ";
- }
- else if ( StrColumnName == "选片日期" )
- {
- return " Ordv_FilmSelectionTime ";
- }
- else if ( StrColumnName == "初修状态" )
- {
- return " Ordv_EarlyRepairStatus ";
- }
- else if ( StrColumnName == "选片状态" )
- {
- return " Ordv_FilmSelectionStatus ";
- }
- else if ( StrColumnName == "加急" )
- {
- return " IsExpedited ";
- }
- else if ( StrColumnName == "加急日期" )
- {
- return " ExpeditedTime ";
- }
- else if ( StrColumnName == "设计状态" )
- {
- return " Ordv_DesignerStatus ";
- }
- else if ( StrColumnName == "精修状态" )
- {
- return " Ordv_RefinementStatus ";
- }
- else if ( StrColumnName == "看版状态" )
- {
- return " Ordv_LookDesignStatus ";
- }
- else if ( StrColumnName == "会员卡号" )
- {
- return " Mc_CradNumber ";
- }
- else if ( StrColumnName == "取件状态" )
- {
- return " Ords_ProductPickupIntStatus ";
- }
- return "";
- }
- /// <summary>
- /// 当前点击的字段
- /// </summary>
- string StrCurrentClickField = "";
- /// <summary>
- /// 排序字段
- /// </summary>
- string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber";
- /// <summary>
- /// 排序顺序
- /// </summary>
- string StrSortOrder = "DESC";
- /// <summary>
- /// 创建行
- /// </summary>
- Hashtable PublicFunctionRows()
- {
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,入册加挑张数,入底加挑张数,加挑金额,拍摄名称,拍照状态,摄影师,化妆师,引导师,初修师,初修状态,初修日期,选片师,选片日期,选片状态,设计状态,精修状态,看版状态,取件状态,会员卡号";
- string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0004.ToString().Trim();
- if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
- }
- else
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
- }
- this.dgvData.dgvGuidName = StrGuidName;
- this.dgvData.dgvUserEmployeeID = this.StrUserID;
- this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,会员卡号";
- this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
- Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
- this.dgvData.dictShowColumName = dictColumns;
- string StrQueryCondition = "";
- if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
- {
- string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
- this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
- StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
- }
- else
- {
- StrQueryCondition = this.GetWhereStr();
- }
- int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
- Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderFilmSelection( this.dgvData, dictColumns, StrQueryCondition, intTopCount, this.StrSortField, ucPagerEx1.PageCurrent );
- this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
- this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32( htData["CurrentCount"] );
- this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32( htData["TotalCount"] );
- BindPageData( ucPagerEx1.PageCurrent, Convert.ToInt32( htData["CurrentCount"] ), Convert.ToInt32( htData["TotalCount"] ) );
- return htData;
- }
- /// <summary>
- /// 返回要操作的条件
- /// </summary>
- /// <returns></returns>
- string GetWhereStr()
- {
- string StrWhere = " Where Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( cmbQueryText.Text.Trim() );
- if ( chkCompleteOrder.Checked )
- {
- StrWhere += " and ( (Ords_ServiceIntStatus = 2 or ServiceCount=0 ) and (Ords_ProductPickupIntStatus = 2 or productCount=0 ) and (ServiceCount>0 or productCount>0) ) ";
- }
- else
- {
- if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder && !this.chkCompleteOrder.Checked && string.IsNullOrEmpty( this.cmbQueryText.Text ) )
- {
- StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) ";
- }
- else
- {
- StrWhere += " and ( (Ords_ServiceIntStatus in (0,1) and ServiceCount>0 ) or (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) or ( ServiceCount = 0 and productCount = 0 ) ) ";
- }
- }
- if ( DictData.ContainsKey( "OrderArrears" ) && DictData["OrderArrears"].Trim().Length > 0 )
- {
- StrWhere += " and (套系金额 + isnull(加挑金额,0) - isnull(收款金额,0)) > 0 ";
- }
- if ( DictData.ContainsKey( "EarlyRepairStatus" ) && DictData["EarlyRepairStatus"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_EarlyRepairStatus <> '0'";
- }
- if ( DictData.ContainsKey( "FilmSelectionStatus" ) && DictData["FilmSelectionStatus"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_FilmSelectionStatus ='0'";
- }
- if ( DictData.ContainsKey( "FilmSelectionName" ) && DictData["FilmSelectionName"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_FilmSelectionName = '" + DictData["FilmSelectionName"].Trim() + "'";
- }
- if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
- {
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ordv_FilmSelectionTime", DictData["QueryDateTimeStart"].Trim(), DictData["QueryDateTimeEnd"].Trim() );
- }
- if ( DictData.ContainsKey( "Photographer" ) && DictData["Photographer"].Trim().Length > 0 )
- {
- StrWhere += " and Ordpg_Photographer like '%" + DictData["Photographer"].Trim() + "%'";
- }
- if ( DictData.ContainsKey( "PickupStatusNotOK" ) && DictData["PickupStatusNotOK"].Trim().Length > 0 )
- {
- StrWhere += " and Ords_ProductPickupIntStatus in (0,1)";
- }
- if ( DictData.ContainsKey( "EarlyRepairName" ) && DictData["EarlyRepairName"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_EarlyRepairName like '%" + DictData["EarlyRepairName"].Trim() + "%'";
- }
- if ( DictData.ContainsKey( "MakeupArtistNmae" ) && DictData["MakeupArtistNmae"].Trim().Length > 0 )
- {
- StrWhere += " and Ordpg_MakeupArtist like '%" + DictData["MakeupArtistNmae"].Trim() + "%'";
- }
- if ( DictData.ContainsKey( "BootDivisionName" ) && DictData["BootDivisionName"].Trim().Length > 0 )
- {
- StrWhere += " and Ordpg_BootDivision like '%" + DictData["BootDivisionName"].Trim() + "%'";
- }
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
- return StrWhere;
- }
- /// <summary>
- /// 右键添加上传功能
- /// </summary>
- /// <param name="orNumber"></param>
- void BindContextMenu( DataGridViewRow dataGridViewRow )
- {
- if ( BLL.N8Process.BLL_N8Process.IsN8ModelValid() )
- {
- #region 获取OSS信息;
- if ( LYFZ.Network.OssOperation.OssProcess.GetOssStatus( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.Client, ref this.useOss ) )
- {
- if ( this.useOss )
- {
- Network.OssOperation.OssProcess.GetOssBranchList( out this.listbranch, ref this.useOss );
- }
- }
- #endregion
- ToolStripMenuItem menuItem = new ToolStripMenuItem();
- menuItem.Text = "同步N8选版:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
- menuItem.Name = "NemoInfo";
- menuItem.Tag = dataGridViewRow;
- menuItem.Click += item_Click; ;
- this.dgvData.conMenu.Items.Add( menuItem );
- }
- }
- void item_Click( object sender, EventArgs e )
- {
- ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
- FTPUpFileForm ftpForm = new FTPUpFileForm( 1 );
- if ( this.useOss )
- {
- ftpForm.UseOss = true;
- ftpForm.ListBranch = this.listbranch;
- }
- DataGridViewRow dgvr = (DataGridViewRow)((ToolStripMenuItem)sender).Tag;
- LYFZ.BLL.BLL_ErpOrdersPhotography pbll = new BLL.BLL_ErpOrdersPhotography();
- // 拍摄景点;
- DataTable tbl = pbll.GetList( "Ordpg_Number='" + dgvr.Cells["Ord_Number"].Value.ToString() + "'" ).Tables[0];
- string _Type = dgvr.Cells["Ord_Type"].Value.ToString();
- string LoadType = "N8选版";
- string signName = "";
- string SightsName = "";
- if ( _Type == "1" )
- {// 儿童订单;
- if ( tbl.Rows.Count > 0 )
- {
- for ( int i = 0; i < tbl.Rows.Count; i++ )
- {
- SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + ",";
- }
- }
- signName = SightsName.TrimEnd( ',' );
- }
- else if ( _Type != "1" )
- {
- if ( tbl.Rows.Count > 0 )
- {
- for ( int i = 0; i < tbl.Rows.Count; i++ )
- {
- SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + (LoadType == "原片" ? "," : ",");
- }
- }
- signName = SightsName.TrimEnd( ',' );
- }
- else
- {
- signName = dgvr.Cells["拍摄名称"].Value.ToString();
- }
- string[] str = signName.Split( ',' );
- foreach ( var item in str )
- {
- CheckBoxEx cb = new CheckBoxEx();
- cb.Text = item;
- ftpForm.AddCheckBoxModel( cb );
- cb.Checked = true;
- }
- ftpForm.BindData( dgvr.Cells["Ord_Number"].Value.ToString(), dgvr.Cells["Ordv_ViceNumber"].Value.ToString(), _Type, "设计", "" );
- ftpForm.AddCheckBoxByFtpInfo( null );
- ftpForm.ShowDialog();
- }
- }
- public static class FilmSelectionStart
- {
- /// <summary>
- /// 显示并进入选片系统
- /// </summary>
- /// <param name="currentRow"></param>
- /// <returns></returns>
- public static bool ShowPhotoSelectSystemMainPhotoSelect( DataGridViewRow currentRow )
- {
- bool ret = false;
- if ( currentRow != null )
- {
- string MainOrderNumber = currentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
- string ViceOrderNumber = currentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
- LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionStart.ShowPhotoSelectSystemMainPhotoSelect( MainOrderNumber, ViceOrderNumber );
- }
- return ret;
- }
- /// <summary>
- /// 显示并进入选片系统
- /// </summary>
- /// <param name="StrOrdNumber"></param>
- /// <param name="StrViceNumber"></param>
- /// <returns></returns>
- public static bool ShowPhotoSelectSystemMainPhotoSelect( string StrOrdNumber, string StrViceNumber )
- {
- bool ret = false;
- if ( !string.IsNullOrEmpty( StrOrdNumber ) && !string.IsNullOrEmpty( StrViceNumber ) )
- {
- LYFZ.BLL.BLL_ErpOrder myobll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpOrderDigital mydbll = new LYFZ.BLL.BLL_ErpOrderDigital();
- LYFZ.Model.Model_ErpOrder model = myobll.GetModel( "Ord_Number", StrOrdNumber );
- LYFZ.Model.Model_ErpOrderDigital vmodel = mydbll.GetModel( "Ordv_ViceNumber", StrViceNumber );
- bool ReadOnlyFilmSelection = false;
- #if !DEBUG
- if ( vmodel.Ordv_FilmSelectionStatus == "1")//&& LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.AuthorizationQuadraticPiece
- {
- // if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece ) )
- // {
- DialogResult retDResult = MessageBoxCustom.Show( "订单已选片OK,未防止误操作造成选片信息错误和丢失,需要“二次选片权限”授权后才能选片"
- + "\r\n选“是”开始请求授权\r\n选“否”将以只读模式进入选片系统\r\n选“取消”将取消本次操作", msgBoxButton: MessageBoxButtons.YesNoCancel );
- //MessageBoxCustom.Show( "抱歉,你没有“二次选片权限”,需要授权后才能选片!\r\n"
- // + "是否要请求授权并选片?\r\n选“是”开始请求授权\r\n选“否”将以只读模式进入选片系统\r\n选“取消”将取消本次操作", msgBoxButton: MessageBoxButtons.YesNoCancel );
- if ( retDResult == DialogResult.Yes )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm afrm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece );
- if ( afrm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
- {
- if ( !LYFZ.BLL.BLL_ErpUser.GetRights( afrm.CurrentAuthorizeUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece, afrm.User_BelongRoles ) )
- {
- afrm.SetAuthorizationResult( String.Format( "授权失败,授权人没有“二次选片权限”" ) );
- MessageBoxCustom.Show( "抱歉,你没有“二次选片权限”" );
- return false;
- }
- else
- {
- afrm.SetAuthorizationResult();
- }
- }
- else
- {
- return false;
- }
- }
- else if ( retDResult == DialogResult.Cancel )
- {
- return false;
- }
- else
- {
- ReadOnlyFilmSelection = true;
- }
- // }
- }
- #endif
- //如果拥有选片权限时,检查订单是否被锁定
- if ( !ReadOnlyFilmSelection )
- {
- // 当前订单是否被锁定
- bool isLockOrder = false;
- if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderLockFeature )
- {
- if ( model.ID > 0 )
- {
- isLockOrder = myobll.CheckOrderLock( model.ID );
- }
- if ( isLockOrder )
- {
- ReadOnlyFilmSelection = true;
- if ( MessageBoxCustom.Show( String.Format( "此订单已被其他人员锁定,你不能对此订单进行选片操作。\r\n当有人正在修改订单或选片时,订单会被锁定。\r\n如果要强制解锁请选“是”进行解锁订单" ), msgBoxButton: MessageBoxButtons.YesNo ) == DialogResult.Yes )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frmAuthorize = new MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm( null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 2 );
- frmAuthorize.StrWindowText = "解锁订单授权";
- if ( frmAuthorize.ShowDialog() == System.Windows.Forms.DialogResult.OK )
- {
- // if (!LYFZ.BLL.BLL_ErpUser.CheckAdministrator(frmAuthorize.User_BelongRoles))
- if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OtherPermissionsSet, LYFZ.CustomAttributes.OperatingAuthority.UnlockOrderLock ) )
- {
- string msg = "授权失败,没有权限强制解锁订单";
- frmAuthorize.SetAuthorizationResult( msg );
- MessageBoxCustom.Show( msg );
- }
- else
- {
- ReadOnlyFilmSelection = false;
- frmAuthorize.SetAuthorizationResult();
- }
- }
- }
- }
- }
- }
- LYFZ.PhotoSelectSystem.MainPhotoSelect frm = new PhotoSelectSystem.MainPhotoSelect( model, vmodel, ReadOnlyFilmSelection );
- if ( !frm.IsDisposed )
- {
- frm.EventPrintSingle += frm_EventPrintSingle;
- frm.EventPrintSmallmap += frm_EventPrintSmallmap;
- frm.EventMicroShareClick += frm_EventMicroShareClick;
- frm.EventSelectProduct_Select += frm_EventSelectProduct_Select;
- frm.EventCalculatedPrintClick += frm_EventCalculatedPrintClick;
- frm.EventEditOrder_Click += Frm_EventEditOrder_Click;
- frm.BtnAdditionalPayments += Frm_BtnAdditionalPayments;
- if ( frm.ShowDialog() == DialogResult.OK )
- {
- ret = true;
- }
- }
- }
- return ret;
- }
- private static void Frm_EventEditOrder_Click(PhotoSelectSystem.EventEditOrder e)
- {
- frmNewOrder newOrder = new frmNewOrder();
- newOrder.OrderNumber = e.OrderNumber;
- newOrder.IsShowUcNavigationTool = false;
- newOrder.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- newOrder.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- newOrder.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- newOrder.OrderType = e.OrderType;
- newOrder.IsSelectPhoto = true;
- newOrder.ShowDialog();
- if (newOrder.IsSaveData)
- {
- e.IsEditOrder = true;
- }
- }
- private static void Frm_BtnAdditionalPayments(PhotoSelectSystem.EventAdditionalPayments e)
- {
- FinancialManagement.OrdersReceivables.FrmLatePayment frmLatePayment = new FinancialManagement.OrdersReceivables.FrmLatePayment();
- frmLatePayment.StrOrdNumber = e.OrderModel.Ord_Number;
- frmLatePayment.ShowDialog();
- }
- static void frm_EventCalculatedPrintClick( PhotoSelectSystem.EventCalculatedPrint e )
- {
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.加减乘除, e );
- //e.SumText 合计
- // e.ReserveProductList 原套系商品
- //e.AddSelectedProductList; 商品加选
- // e.UpgradeProductList 商品升级
- //e.AddBatchProductList 商品加P
- // e.BookAndEndList 入底入册统计
- // e.AddSelectedProductList[0].Title 标题 也就是一项的第一行
- // e.AddSelectedProductList[0].Value 第二行
- // e.AddSelectedProductList[0].IsSum 标记是否为合计
- }
- static void frm_EventSelectProduct_Select( string type, PhotoSelectSystem.EventSelectProduct e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new SetSmallForm.ToolboxListViewSamllForm();
- if ( type == "update" )
- {
- frm.IsFilmSelectionMultiple = false;
- }
- frm.LoadType = "套系包含商品";
- frm.ShowDialog();
- if ( frm.IsSaveed )
- {
- e.SetSelectProductList( frm.mlist );
- }
- }
- static void frm_EventMicroShareClick( PhotoSelectSystem.EventMicroShare e )
- {
- try
- {
- LYFZ.Software.MainBusiness.MicroShare.FrmMicroShare frm = new MicroShare.FrmMicroShare();
- frm.SPhotoList = e.SPhotoList;
- frm.F_Number = e.MainOrderNumber;//主订单号
- frm.F_CusName = e.CusName;
- frm.F_Attractions = e.SightsName;
- frm.F_MakeupArtist = e.MakeupArtist;
- frm.Show();
- }
- catch ( Exception ex )
- {
- MessageBoxCustom.Show( "调用微分享失败!错误原因:" + ex.Message );
- }
- }
- /// <summary>
- /// 打印小图
- /// </summary>
- /// <param name="e"></param>
- static void frm_EventPrintSmallmap( PhotoSelectSystem.EventSelectPhotoPrint e )
- {
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.选片缩略图, e );
- }
- /// <summary>
- /// 打印单
- /// </summary>
- /// <param name="e"></param>
- static void frm_EventPrintSingle( PhotoSelectSystem.EventSelectPhotoPrint e )
- {
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.制作单明细, e );
- }
- }
- }
|