1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using System.IO;
- using LYFZ.ComponentLibrary;
- using LYFZ.Helper;
- using LYFZ.Model;
- using System.Diagnostics;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess
- {
- public partial class RepairPieceFormMain : LYFZ.Software.UI.DoorCityProcess.RepairPieceFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpOrderDigital dbll = new BLL.BLL_ErpOrderDigital();
- LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
- LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
- LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
- #region 2017-03-18 杨云奕 添加 获取门店配置的ftp情况
- BLL.BaseBLL.BaseBLL_FTPServiceUserAccount ftpbll = new BLL.BaseBLL.BaseBLL_FTPServiceUserAccount();
- DataSet ftpData;
- #endregion
- #region OSS云传片
- bool useOss = false;
- List<AliyunOssLibrary.Model.SimplifyBranch> listbranch = null;
- #endregion
- #region 2017-03-18 杨云奕 添加 如果有定义ftp则将上传功能显示
- /// <summary>
- /// 右键添加上传功能
- /// </summary>
- /// <param name="orNumber"></param>
- void BindContextMenu( DataGridViewRow dataGridViewRow )
- {
- #region 获取OSS信息;
- //if (LYFZ.Network.OssOperation.OssProcess.GetOssBranchList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.Client, out this.listbranch, ref this.useOss))
- 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
- if ( this.useOss )
- {
- ToolStripMenuItem item = new ToolStripMenuItem();
- item.Text = "上传订单:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
- item.Name = "UpFtp";
- item.Tag = dataGridViewRow;
- item.Click += item_Click;
- this.dgvData.conMenu.Items.Add( item );
- }
- else
- {
- if ( ftpData.Tables[0].Rows.Count > 0 )
- {
- ToolStripMenuItem item = new ToolStripMenuItem();
- item.Text = "上传订单:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
- item.Name = "UpFtp";
- item.Tag = dataGridViewRow;
- item.Click += item_Click;
- //ToolStripMenuItem[] subItem = new ToolStripMenuItem[ftpData.Tables[0].Rows.Count];
- //for (int i = 0; i < ftpData.Tables[0].Rows.Count; i++)
- //{
- // DataRow dr = ftpData.Tables[0].Rows[i];
- // subItem[i] = new ToolStripMenuItem();
- // subItem[i].Text = "至" + dr["Company_Name"].ToString() + "(" + dr["FTP_Name"].ToString() + ")账户";
- // dataGridViewRow.Tag = dr;
- // subItem[i].Tag = dataGridViewRow;
- // subItem[i].Click += ToolStripMenuItem_Click;
- //}
- //item
- this.dgvData.conMenu.Items.AddRange( new ToolStripItem[] { item } );
- //List<ToolStripItem> dropDownList = new List<ToolStripItem>();
- //for (int i = 0; i < subItem.Length; i++)
- //{
- // dropDownList.Add(subItem[i]);
- //}
- //item.DropDownItems.AddRange(dropDownList.ToArray());
- }
- }
- }
- void item_Click( object sender, EventArgs e )
- {
- FTPUpFileForm ftpForm = new FTPUpFileForm();
- if ( this.useOss )
- {
- ftpForm.Text = "云传片";
- 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 = "初修";
- 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 );
- if ( ftpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
- {
- }
- //throw new NotImplementedException();
- }
- /// <summary>
- /// 上传项点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void ToolStripMenuItem_Click( object sender, EventArgs e )
- {
- FTPUpFileForm ftpForm = new FTPUpFileForm();
- DataGridViewRow dataRow = (DataGridViewRow)((ToolStripMenuItem)sender).Tag;
- bool findR = false;
- for ( int i = 0; i < this.dgvData.Rows.Count; i++ )
- {
- DataGridViewRow dgvr = this.dgvData.Rows[i];
- if ( this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString() == dataRow.Cells["Ord_Number"].Value.ToString() )
- {
- findR = true;
- }
- else
- {
- if ( findR )
- {
- break;
- }
- }
- if ( findR )
- {
- ftpForm.AddCheckBoxModel( new CheckBoxEx()
- {
- Text = this.dgvData.Rows[i].Cells["拍摄名称"].Value.ToString(),
- Tag = dataRow,
- Checked = (dataRow.Cells["拍摄名称"].Value.ToString() == this.dgvData.Rows[i].Cells["拍摄名称"].Value.ToString())
- } );
- }
- }
- DataRow dr = ((DataRow)dataRow.Tag);
- ftpForm.BindData( dataRow, "初修", dr["Company_Name"].ToString() + "(" + dr["FTP_Name"].ToString() + ")账户" );
- if ( ftpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
- {
- }
- }
- #endregion
- #region 设置版本权隐藏字段
- string versionHideString = "";
- #endregion
- public RepairPieceFormMain()
- {
- this.Shown += RepairPieceFormMain_Shown;
- this.Load += RepairPieceFormMain_Load;
- this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
- this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnExportRepairedPiece.Click += btnExportRepairedPiece_Click;
- this.btnSeparatedPhoto.Click += btnSeparatedPhoto_Click;
- this.btnHasShotNoRepair.Click += btnHasShotNoRepair_Click;
- this.btnConditionQuery.Click += btnConditionQuery_Click;
- this.btnExportingZOOM.Click += btnExportingZOOM_Click;
- this.btnImportRepairedPiece.Click += btnImportRepairedPiece_Click;
- this.btnViewRepairedPiece.Click += btnViewRepairedPiece_Click;
- this.btnOutSendRepairPiece.Click += btnOutSendRepairPiece_Click;
- this.btnClose.Click += btnClose_Click;
- this.chkDressVersion.Click += chkDressVersion_Click;
- this.chkKidsVersion.Click += chkKidsVersion_Click;
- this.chkPortraitVersion.Click += chkPortraitVersion_Click;
- this.Resize += RepairPieceFormMain_Resize;
- this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
- this.dgvData.CellMouseDown += dgvData_CellMouseDown;
- this.dgvData.CellClick += dgvData_CellClick;
- this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
- this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
- if ( !BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsEnablePhotoStyle )
- {
- this.btnSeparatedPhoto.Visible = false;
- }
- this.flowLayoutPanel1.Height = 34;
- ///获取门店ftp账户
- ftpData = ftpbll.GetList2( "" );
- ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
- chkCompleteOrder.Click += ChkCompleteOrder_Click;
- this.btn_CusOssUpload.Click += Btn_CusOssUpload_Click;
- this.btn_CusOssUpload.Visible = false;
- this.btn_Repair.Click += Btn_Repair_Click;
- }
- private void Btn_Repair_Click(object sender, EventArgs e)
- {
- SuperSmallForm.RefinedRepairOutStatistics frmBll = new SuperSmallForm.RefinedRepairOutStatistics();
- frmBll.frmType = "初修";
- frmBll.ShowDialog();
- }
- /// <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 )
- {
- BLL.SelectPhotoHandling photoHandling = new BLL.SelectPhotoHandling( orbll.GetModel( "Ord_Number", strOrderNumber ), dbll.GetModel( "Ordv_ViceNumber", strViceOrderNumber ) );
- listPhotos = photoHandling.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.EarlyRetouch, BLL.SelectPhotoHandling.PhotoType.Original, 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;
- 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;
- }
- /// <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 RepairPieceFormMain_Shown( object sender, EventArgs e )
- {
- ///重拍功能的的版本权限
- List<Control> hideControl = new List<Control>();
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- hideControl.Add( this.btnSeparatedPhoto );
- 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.btnOutSendRepairPiece );
- b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单修片外发修片,
- hideControl, null, null );
- if ( !b )
- {
- versionHideString = ",初修是否外发";
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st007" );
- this.PublicFunctionRights();
- //this.PublicFunctionRows();
- ucPagerEx1.Bind();
- this.IsFirstRun = false;
- this.RepairPieceFormMain_Resize( null, null );
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void RepairPieceFormMain_Load( object sender, EventArgs e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
- this.cmbQueryText.Text = this.StrOrdNumber;
- }
- /// <summary>
- /// 选择分店获取权限
- /// </summary>
- void PublicFunctionRights()
- {
- this.btnExportingZOOM.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
- this.btnImportRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport );
- this.btnExportRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
- this.btnViewRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoView );
- this.btnSeparatedPhoto.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.RepairPieceSeparatePhoto );
- this.btnOutSendRepairPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
- }
- /// <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;
- 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;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 已拍未修
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnHasShotNoRepair_Click( object sender, EventArgs e )
- {
- this.DictData.Clear();
- this.DictData["PhotographyStatus"] = "OK";
- this.DictData["EarlyRepairStatus"] = "0";// "未修,修片中";
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 条件查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnConditionQuery_Click( object sender, EventArgs e )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new SetSmallForm.ConditionQuerySamllForm();
- frm.LoadType = "修片";
- frm.ShowDialog();
- if ( frm.DictDataArray.Count > 0 )
- {
- this.DictData.Clear();
- Dictionary<string, string> DictDataArray = frm.DictDataArray;
- //初修人
- if ( DictDataArray.ContainsKey( "EarlyRepairName" ) && DictDataArray["EarlyRepairName"].Length > 0 )
- {
- this.DictData["EarlyRepairName"] = DictDataArray["EarlyRepairName"].Trim();
- }
- //初修开始时间
- if ( DictDataArray.ContainsKey( "QueryDateTimeStart" ) && DictDataArray["QueryDateTimeStart"].Length > 0 )
- {
- this.DictData["QueryDateTimeStart"] = DictDataArray["QueryDateTimeStart"].Trim();
- }
- //初修结束时间
- if ( DictDataArray.ContainsKey( "QueryDateTimeEnd" ) && DictDataArray["QueryDateTimeEnd"].Length > 0 )
- {
- this.DictData["QueryDateTimeEnd"] = DictDataArray["QueryDateTimeEnd"].Trim();
- }
- //this.PublicFunctionRows();
- this.ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- }
- }
- /// <summary>
- /// 导出原片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExportingZOOM_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows.Count > 0 )
- {
- string StrSightsName = "";
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
- if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
- {
- if ( this.dgvData.Columns["拍摄名称"] != null )
- {
- StrSightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
- }
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportOriginalPiece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), ViceOrderNumber, StrSightsName );
- }
- else
- {
- MessageBoxCustom.Show( "请选择订单" ); return;
- }
- }
- }
- /// <summary>
- /// 导入修好的片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnImportRepairedPiece_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows.Count > 0 )
- {
- string SightsName = "";
- if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
- {
- if ( this.dgvData.Columns["拍摄名称"] != null )
- {
- SightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
- }
- }
- if ( this.dgvData.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK" )
- {
- MessageBoxCustom.Show( "已取件,不能导片!" );
- }
- LYFZ.Model.Model_ErpOrderDigital _modelDigital = null;
- if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRepairPiece(
- this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
- this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
- SightsName,ref _modelDigital,
- this.dgvData.CurrentRow.Cells["取件状态"].Value.ToString().Trim() ) )
- {
- if(_modelDigital!=null)
- {
- //初修师,初修日期,初修是否外发,初修状态,
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修师"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(_modelDigital.Ordv_EarlyRepairTime);
- if (!string.IsNullOrEmpty(this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"].ToString_s()))
- {
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"] = Enum.ToObject(typeof(LYFZ.EnumPublic.EarlyRepairStatusEnum),
- Convert.ToInt32(this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"])).ToString();
- }
- else
- {
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"] = "";
- }
- if (this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"].ToString_s() == "已发")
- {
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "已外发";
- }
- else if (this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"].ToString_s() == "已回")
- {
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "外发已回";
- }
- else
- {
- this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "";
- }
- }
- //this.PublicFunctionRows();
- //this.ucPagerEx1.PageCurrent = 1;
- //ucPagerEx1.Bind();
- }
- }
- else
- {
- MessageBoxCustom.Show( "请选择订单" ); return;
- }
- }
- }
- /// <summary>
- /// 查看修好的片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnViewRepairedPiece_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( 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();//数码编号
- string SightsName = "";
- if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
- {
- try { SightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
- catch { }
- }
- if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
- {
- return;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.CustomerPhotosViewSmallForm frm = new SetSmallForm.CustomerPhotosViewSmallForm();
- frm.LoadType = "初修片";
- frm.MainOrderNumber = MainOrderNumber;
- frm.ViceOrderNumber = ViceOrderNumber;
- frm.DirType = Model.Model_ErpOrder.DirectoryType.EarlyRetouch;
- frm.StrSightsName = SightsName;
- frm.Show();
- }
- else { MessageBoxCustom.Show( "请选择订单" ); return; }
- }
- }
- /// <summary>
- /// 导出修好的片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExportRepairedPiece_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows.Count > 0 )
- {
- try
- {
- string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
- LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
- LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );//
- LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling( ord_model, vmodel );
- 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 { }
- }
- /* List<string> sPhotoList = sPh.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.EarlyRetouch, BLL.SelectPhotoHandling.PhotoType.Original, ViceName );
- if (sPhotoList.Count == 0)
- {
- MessageBoxCustom.Show("此单未导片"); return;
- }*/
- if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(ViceOrderNumber))
- {
- return;
- }
- /* List<string> pathExt = new List<string>();
- foreach(string path in sPhotoList)
- {
- string ext = Path.GetExtension(path);
- if(pathExt.IndexOf(ext)==-1)
- {
- pathExt.Add(ext);
- }
- }
- frmSelectFileType frmSelectFile = new frmSelectFileType(pathExt);
- frmSelectFile.ShowDialog();
- pathExt = frmSelectFile.fileTypes;
- List<string> pathList = new List<string>();
- foreach (string path in sPhotoList)
- {
- string ext = Path.GetExtension(path);
- if (pathExt.IndexOf(ext) != -1)
- {
- pathList.Add(path);
- }
- }
- sPhotoList = pathList;
- */
- //显示对话框
- if ( fbd.ShowDialog() == DialogResult.OK )
- {
- bool IsImp = false;
- LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( ord_model, vmodel );
- IsImp = pe.ExportEarlyRetouchFilm( fbd.SelectedPath.ToString().Trim(), backgroundWorker );
- }, width: 500 );
- if ( !IsImp )
- {
- return;
- }
- else { MessageBoxCustom.Show( "导出完毕" ); return; }
- }
- }
- catch { MessageBoxCustom.Show( "导片出错" ); }
- }
- else { MessageBoxCustom.Show( "请选择订单" ); return; }
- }
- }
- /// <summary>
- /// 分片
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSeparatedPhoto_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows.Count > 0 )
- {
- 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 = orbll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
- LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );//
- LYFZ.PhotoSelectSystem.PhotoCategory frm = new PhotoSelectSystem.PhotoCategory( model, vmodel );
- if ( !frm.IsDisposed )
- {
- frm.ShowDialog();
- }
- }
- }
- else { MessageBoxCustom.Show( "请选择订单" ); }
- }
- /// <summary>
- /// 外发初修
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnOutSendRepairPiece_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.SelectedRows.Count > 0 )
- {
- string StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
- if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrOrdViceNumber ) )
- {
- return;
- }
- if ( MessageBoxCustom.Show( "你确定要外发初修片吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
- {
- string StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ChooseNameSuperSmallForm frm = new SuperSmallForm.ChooseNameSuperSmallForm();
- frm.StrOrdNumber = StrOrdNumber;
- frm.StrOrdViceNumber = StrOrdViceNumber;
- frm.orderProcess = EnumPublic.OrderProcessEnum.初修;
- frm.ShowDialog();
- if ( frm.IsSaveed )
- {
- DateTime strTime = SDateTime.Now;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- DataTable dt = orbll.GetView_Custom( "tb_ErpOrderDigitalStatus", StrWhere: "Ords_OrdNumber = '" + StrOrdNumber + "' And Ords_ViceNumber = '" + StrOrdViceNumber + "'", ShowColumnName: "*" ).Tables[0];
- LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = null;
- if ( dt.Rows.Count > 0 )
- {
- modelStatus = orsbll.DataRowToModel( dt.Rows[0] );
- modelStatus.Ords_OutSendEarlyRepairName = this.StrUserID;
- modelStatus.Ords_OutSendEarlyRepairStatus = "已发";
- modelStatus.Ords_OutSendEarlyRepairTime = strTime;
- modelStatus.Ords_OutSendEarlyRepairVendor = frm.htData["StrVendor"].ToString().Trim();
- modelStatus.Ords_OutSendEarlyRepairVendorQQ = frm.htData["StrQQ"].ToString().Trim();
- clist.Add( orsbll.GetUpdateCommandInfo( modelStatus ) );
- }
- if ( clist.Count > 0 )
- {
- if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
- {
- if ( Convert.ToBoolean( frm.htData["StrIsOutSend"] ) && frm.htData["StrQQ"].ToString().Trim().Length > 0 )
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall( frm.htData["StrQQ"].ToString().Trim() );
- }
- }
- else
- {
- MessageBoxCustom.Show( "操作选择供应商发出失败!" );
- }
- }
- else
- {
- MessageBoxCustom.Show( "外发失败,可能数码状态表不存在!" );
- }
- }
- }
- }
- }
- }
- /// <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;
- 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;
- 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;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 窗体大小发生改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void RepairPieceFormMain_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_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
- {
- if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoView ) )
- {
- this.btnViewRepairedPiece_Click( this, null );
- }
- }
- }
- }
- /// <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 )
- {
- if ( this.dgvData.Rows.Count > 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, "StoresRepairPiece", 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"] = "1";
- 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, "StoresRepairPiece", 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;
- 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;
- 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;
- ucPagerEx1.Bind();
- }
- }
- 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 )
- {
- if ( MessageBoxCustom.Show( "您确定要重置初修日期吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
- {
- DateTime strTime = SDateTime.Now;
- Hashtable htData = (Hashtable)item.Tag;
- List<Helper.CommandInfo> clist = new List<CommandInfo>();
- LYFZ.Model.Model_ErpOrderDigital model = orvbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] );
- model.Ordv_EarlyRepairTime = Convert.ToDateTime( frm.StrValue );
- model.Ordv_UpdateDateTime = strTime;
- model.Ordv_UpdateName = this.StrUserID;
- clist.Add( orvbll.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, 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;
- 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() == "套系金额" )
- {
- 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;
- 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_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_Sights ";
- }
- 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_EarlyRepairTime ";
- }
- 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>
- void PublicFunctionRows()
- {
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,套系名称,套系价格,订单类型,接单人,拍摄名称,摄影师,拍摄时间,拍照状态,初修师,初修日期,初修是否外发,初修状态,选片状态,选片时间,加急,加急日期,设计状态,精修状态,看版状态,取件状态,会员卡号";
- string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0002.ToString().Trim();
- if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号" + versionHideString;
- }
- else
- {
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type" + versionHideString;
- }
- 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_OrderRepairPiece( 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"] ) );
- }
- /// <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( "PhotographyStatus" ) && DictData["PhotographyStatus"].Trim().Length > 0 )
- {
- StrWhere += " and Ordpg_PhotographyStatus in (1,2) ";
- }
- if ( DictData.ContainsKey( "EarlyRepairStatus" ) && DictData["EarlyRepairStatus"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_EarlyRepairStatus <> '2'";
- }
- if ( DictData.ContainsKey( "EarlyRepairName" ) && DictData["EarlyRepairName"].Trim().Length > 0 )
- {
- StrWhere += " and Ordv_EarlyRepairName = '" + DictData["EarlyRepairName"].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_EarlyRepairTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"] );
- }
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
- return StrWhere;
- }
- }
- }
|