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 System.Diagnostics; using LYFZ.Model; namespace LYFZ.Software.MainBusiness.DoorCityProcess { public partial class DesignFormMain : LYFZ.Software.UI.DoorCityProcess.DesignFormMain { LYFZ.BLL.BLL_ErpOrder obll = new BLL.BLL_ErpOrder(); LYFZ.BLL.BLL_ErpSystemLogs systbll = new BLL.BLL_ErpSystemLogs(); LYFZ.BLL.BLL_ErpOrderDigital dbll = new LYFZ.BLL.BLL_ErpOrderDigital(); LYFZ.BLL.BLL_ErpOrderOutSendDesignList outbll = new BLL.BLL_ErpOrderOutSendDesignList(); #region OSS云传片 bool useOss = false; List 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 #region 2017-03-18 杨云奕 添加 如果有定义ftp则将上传功能显示 /// /// 右键添加上传功能 /// /// 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 dropDownList = new List(); //for (int i = 0; i < subItem.Length; i++) //{ // dropDownList.Add(subItem[i]); //} //item.DropDownItems.AddRange(dropDownList.ToArray()); } } if ( BLL.N8Process.BLL_N8Process.IsN8ModelValid() ) { 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( menuItem.Name == "NemoInfo" ? 0 : -1 ); 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(); } /// /// 上传项点击事件 /// /// /// 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 public DesignFormMain() { this.Shown += DesignFormMain_Shown; this.Load += DesignFormMain_Load; //this.cbxDesignNoBack.Click += cbxDesignNoBack_Click; this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick; this.cmbQueryText.KeyDown += cmbQueryText_KeyDown; this.btnQuery.Click += btnQuery_Click; this.btnHasSelectionNoDesign.Click += btnHasSelectionNoDesign_Click; this.btnConditionQuery.Click += btnConditionQuery_Click; this.btnExportRefinementGoodPiece.Click += btnExportRefinementGoodPiece_Click; this.btnImportDesignVersion.Click += btnImportDesignVersion_Click; this.btnExporting.Click += btnExporting_Click; this.btnLookDesignVersion.Click += btnLookDesignVersion_Click; this.btnLookOver.Click += btnLookOver_Click; this.btnClose.Click += btnClose_Click; this.chkDressVersion.Click += chkDressVersion_Click; this.chkKidsVersion.Click += chkKidsVersion_Click; this.chkPortraitVersion.Click += chkPortraitVersion_Click; this.Resize += DesignFormMain_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; this.btnOutSendDesign.Click += btnOutSendDesign_Click; this.btnOutSendStatistic.Click += btnOutSendStatistic_Click; this.btnYunLookDesign.Click += btnYunLookDesign_Click; this.btnYunLookDesignResult.Click += btnYunLookDesignResult_Click; this.flowLayoutPanel1.Height = 34; ///获取门店ftp账户 ftpData = ftpbll.GetList2( "" ); #region 获取是否N8选版 if ( BLL.BLL_N8ClientConfig.N8ViewGoEnable ) { // 显示N8导片按钮; this.btn_ImportN8.Visible = this.btn_ExportN8.Visible = true; // 获取本机是否启动N8选版信息; IsUserN8ViewGo = true; N8ViewGoPath = BLL.BLL_N8ClientConfig.N8ViewGoPath; // 获取N8服务器地址; if ( LYFZ.Network.PlatinumClientProcess.N8SvrConfig == null ) LYFZ.Network.PlatinumClientProcess.GetN8ServerConfig(); } // 导入N8选版; this.btn_ImportN8.Click += Btn_ImportN8_Click; // 导出N8选版; this.btn_ExportN8.Click += Btn_ExportN8_Click; #endregion ucPagerEx1.EventPaging += ucPagerEx1_EventPaging; chkCompleteOrder.Click += ChkCompleteOrder_Click; this.btn_CusOssUpload.Click += Btn_CusOssUpload_Click; this.btn_CusOssUpload.Visible = false; } /// /// 客照云传; /// /// /// 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; } // 是否有企业ID; 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 listPhotos = null; if ( !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl ) { BLL.SelectPhotoHandling photoHandling = new BLL.SelectPhotoHandling( obll.GetModel( "Ord_Number", strOrderNumber ), dbll.GetModel( "Ordv_ViceNumber", strViceOrderNumber ) ); listPhotos = photoHandling.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.DesignPiece, 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() ) /*if ( false ) { // 从服务器加载文件数据; List 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_ExportN8_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 ( BLL.BLL_N8ClientConfig.N8ViewGoEnable ) { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportN8Piece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), SightsName ); } } else { MessageBoxCustom.Show( "请选择要导出的订单" ); return; } } } private void Btn_ImportN8_Click( object sender, EventArgs e ) { if ( this.dgvData.Rows.Count > 0 ) { if ( this.dgvData.SelectedRows.Count > 0 ) { string ViceName = ""; if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() ) { if ( this.dgvData.Columns["拍摄名称"] != null ) { ViceName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); } } if ( BLL.BLL_N8ClientConfig.N8ViewGoEnable ) { if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportN8UserPiece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), ViceName ) ) { //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } } } else { MessageBoxCustom.Show( "请选择要导入的订单" ); return; } } } void cbxDesignNoBack_Click( object sender, EventArgs e ) { //throw new NotImplementedException(); } /// /// 订单号(用于开单处跳转过来) /// public string StrOrdNumber = ""; /// /// 是否首次运行 /// bool IsFirstRun = true; /// /// 查询条件 /// private Dictionary DictData = new Dictionary(); /// /// 员工编号 /// string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; /// /// 员工姓名 /// string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name; /// /// 窗体加载事件 /// /// /// void DesignFormMain_Shown( object sender, EventArgs e ) { ///保存意向订单的版本权限 List hideControl = new List(); //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D; hideControl.Add( this.btnOutSendDesign ); hideControl.Add( this.btnOutSendStatistic ); LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl( VersionControl.VersionFunctionEnum.订单设计外发设计, hideControl, null, null ); hideControl = new List(); //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D; hideControl.Add( this.btnYunLookDesign ); hideControl.Add( this.btnYunLookDesignResult ); LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl( VersionControl.VersionFunctionEnum.订单设计云看版, hideControl, null, null ); LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st010" ); this.PublicFunctionRights(); //this.PublicFunctionRows(); ucPagerEx1.Bind(); this.IsFirstRun = false; this.DesignFormMain_Resize( this, null ); } /// /// 窗体加载事件 /// /// /// void DesignFormMain_Load( object sender, EventArgs e ) { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion ); this.cmbQueryText.Text = this.StrOrdNumber; } /// /// 选择分店获取权限 /// void PublicFunctionRights() { this.btnExportRefinementGoodPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRefinedRepair", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ); this.btnImportDesignVersion.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport ); this.btnExporting.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ); this.btnLookOver.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoView ); this.btnLookDesignVersion.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.LookDesign ); this.btnYunLookDesign.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.YunLookDesign ); this.btnYunLookDesignResult.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.YunLookDesignResult ); this.btnOutSendDesign.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRefinedRepair", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ); } /// /// 分店选择查询数据 /// /// /// void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e ) { this.PublicFunctionRights(); //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } /// /// 回车 /// /// /// void cmbQueryText_KeyDown( object sender, KeyEventArgs e ) { if ( e.KeyCode == Keys.Enter ) { this.btnQuery_Click( this, null ); } } /// /// 查询 /// /// /// void btnQuery_Click( object sender, EventArgs e ) { this.DictData.Clear(); //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } /// /// 已精修未设计 /// /// /// void btnHasSelectionNoDesign_Click( object sender, EventArgs e ) { this.DictData.Clear(); this.DictData["RefinementStatus"] = "OK"; this.DictData["DesignerStatus"] = "未设计,设计中"; //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } /// /// 条件查询 /// /// /// void btnConditionQuery_Click( object sender, EventArgs e ) { this.DictData.Clear(); LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new SetSmallForm.ConditionQuerySamllForm(); frm.LoadType = "设计"; frm.ShowDialog(); if ( frm.DictDataArray.Count > 0 ) { Dictionary DictDataArray = frm.DictDataArray; //设计师 if ( DictDataArray.ContainsKey( "DesignerName" ) && DictDataArray["DesignerName"].Length > 0 ) { this.DictData["DesignerName"] = DictDataArray["DesignerName"].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(); } //欠款 if ( DictDataArray.ContainsKey( "OrderArrears" ) && DictDataArray["OrderArrears"].Length > 0 ) { this.DictData["OrderArrears"] = DictDataArray["OrderArrears"].Trim(); } //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } } /// /// 导出精修好的片 /// /// /// void btnExportRefinementGoodPiece_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 model = obll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value ); LYFZ.Model.Model_ErpOrderDigital vmodel = dbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber ); LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling( 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 { } } if ( PublicCodeClasses.defaultImportFilePath != "" ) { if ( Directory.Exists( PublicCodeClasses.defaultImportFilePath ) ) //设置此次默认目录为上一次选中目录 { fbd.SelectedPath = PublicCodeClasses.defaultImportFilePath; } } if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) ) { return; } frmIntensiveExport intensiveExport = new frmIntensiveExport(); if ( intensiveExport.ShowDialog() == System.Windows.Forms.DialogResult.OK ) { switch ( intensiveExport.ExportType ) { case 0: //导出全部精修片 List sPhotoList = sPh.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.FineRetouch, BLL.SelectPhotoHandling.PhotoType.Original, ViceName ); if ( sPhotoList.Count == 0 ) { MessageBoxCustom.Show( "此单未导片" ); return; } PublicCodeClasses.defaultImportFilePath = fbd.SelectedPath;//记录选中的目录 if ( fbd.ShowDialog() == DialogResult.OK ) { bool IsImp = false; LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker ) { LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( model, vmodel ); IsImp = pe.ExportFineRetouchFilm( fbd.SelectedPath.ToString().Trim(), backgroundWorker ); }, width: 500 ); if ( !IsImp ) { return; } else { if ( vmodel.Ordv_DesignerStatus.Trim() == "0" ) { vmodel.Ordv_DesignerStatus = "1"; vmodel.Ordv_UpdateDateTime = SDateTime.Now; vmodel.Ordv_UpdateName = this.StrUserID; if ( dbll.Update( vmodel ) ) { MessageBoxCustom.Show( "导出完毕!" ); this.dgvData.CurrentRow.Cells["设计状态"].Value = "设计中"; } else { MessageBoxCustom.Show( "导出相片完成,但修改设计状态为'设计中'失败!" ); } } else { MessageBoxCustom.Show( "导出完毕!" ); } return; } } break; case 1: //导出选好精修片 // FolderBrowserDialog fbd = new FolderBrowserDialog(); if ( fbd.ShowDialog() == DialogResult.OK ) { PublicCodeClasses.defaultImportFilePath = fbd.SelectedPath;//记录选中的目录 LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker ) { LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( model, vmodel ); bool IsSaveed = pe.ExportSelectedFineRetouchPhotoFile( fbd.SelectedPath.ToString().Trim(), Model.Model_ErpOrder.DirectoryType.FineRetouch, backgroundWorker, true, false, isbarode: intensiveExport.chkExportbarcode.Checked, isExportRaw: true ); if ( IsSaveed ) { LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog( LYFZ.EnumPublic.SystemLogsType.相片导入导出, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name + "导出选好精修片,订单号:" + StrOrdNumber + "场景编号:" + ViceOrderNumber, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name ); } }, width: 500 ); } break; case 2: //选好的初修片 if ( fbd.ShowDialog() == DialogResult.OK ) { PublicCodeClasses.defaultImportFilePath = fbd.SelectedPath;//记录选中的目录 LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker ) { LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( model, vmodel ); bool IsSaveed = pe.ExportSelectedFineRetouchPhotoFile( fbd.SelectedPath.ToString().Trim(), Model.Model_ErpOrder.DirectoryType.EarlyRetouch, backgroundWorker, true, false, isbarode: intensiveExport.chkExportbarcode.Checked, isExportRaw: true ); if ( IsSaveed ) { LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog( LYFZ.EnumPublic.SystemLogsType.相片导入导出, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name + "导出选好的初修片,订单号:" + StrOrdNumber + "场景编号:" + ViceOrderNumber, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name ); } }, width: 500 ); } break; case 3: //选好的原片 if ( fbd.ShowDialog() == DialogResult.OK ) { PublicCodeClasses.defaultImportFilePath = fbd.SelectedPath;//记录选中的目录 LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker ) { LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( model, vmodel ); bool IsSaveed = pe.ExportSelectedFineRetouchPhotoFile( fbd.SelectedPath.ToString().Trim(), Model.Model_ErpOrder.DirectoryType.PrimitivePicture, backgroundWorker, true, false, isbarode: intensiveExport.chkExportbarcode.Checked, isExportRaw: true ); if ( IsSaveed ) { LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog( LYFZ.EnumPublic.SystemLogsType.相片导入导出, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name + "导出选好的原片,订单号:" + StrOrdNumber + "场景编号:" + ViceOrderNumber, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name ); } }, width: 500 ); } break; } } } catch { MessageBoxCustom.Show( "导片出错!" ); } } else { MessageBoxCustom.Show( "请选择要导出的订单" ); return; } } } /// /// 导入设计片 /// /// /// void btnImportDesignVersion_Click( object sender, EventArgs e ) { if ( this.dgvData.Rows.Count > 0 ) { if ( this.dgvData.SelectedRows.Count > 0 ) { string ViceName = ""; if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() ) { if ( this.dgvData.Columns["拍摄名称"] != null ) { ViceName = 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.ImportDesignPiece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), ViceName,ref _modelDigital, this.dgvData.CurrentRow.Cells["取件状态"].Value.ToString().Trim() ) ) { //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } } else { MessageBoxCustom.Show( "请选择要导入的订单" ); return; } } } /// /// 查看设计 /// /// /// void btnLookOver_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.DesignPiece; frm.StrSightsName = SightsName; frm.Show(); } else { MessageBoxCustom.Show( "请选择订单" ); return; } } } /// /// 导出设计 /// /// /// void btnExporting_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(); } } LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportDesignPiece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), SightsName ); } else { MessageBoxCustom.Show( "请选择要导出的订单" ); return; } } } /// /// 看设计版 /// /// /// void btnLookDesignVersion_Click( object sender, EventArgs e ) { if ( this.dgvData.Rows.Count > 0 ) { if ( this.dgvData.SelectedRows.Count > 0 ) { string StrViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(); if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrViceNumber ) ) { return; } 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 ); LYFZ.PhotoSelectSystem.LookDesign frm = new PhotoSelectSystem.LookDesign( model, vmodel ); if ( !frm.IsDisposed ) { frm.ShowDialog(); //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } } } } /// /// 外发设计 /// /// /// void btnOutSendDesign_Click( object sender, EventArgs e ) { if ( this.dgvData.Rows.Count > 0 ) { if ( this.dgvData.SelectedRows.Count > 0 ) { string StrViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(); if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrViceNumber ) ) { return; } LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OutSendDesignSingleSmallForm frm = new SetSmallForm.OutSendDesignSingleSmallForm(); frm.StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(); frm.StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(); frm.ShowDialog(); if ( frm.IsSaveed ) { //this.PublicFunctionRows(); this.ucPagerEx1.PageCurrent = 1; ucPagerEx1.Bind(); } } else { MessageBoxCustom.Show( "请选择你要操作的订单" ); return; } } } /// /// 外发统计 /// /// /// void btnOutSendStatistic_Click( object sender, EventArgs e ) { LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OutSendDesignStatisticSmallForm frm = new SetSmallForm.OutSendDesignStatisticSmallForm(); frm.ShowDialog(); } /// /// 云看样 /// /// /// void btnYunLookDesign_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 StrViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号 if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrViceNumber ) ) { return; } ShowCloudSelection( MainOrderNumber, StrViceNumber, 0, 1 ); } else { MessageBoxCustom.Show( "请选择要上传的订单" ); } } } /// /// 云看样结果 /// /// /// void btnYunLookDesignResult_Click( object sender, EventArgs e ) { ShowCloudSelection( "", "", 1, 1 ); } /// /// 显示云选功能 /// /// /// /// /// public static void ShowCloudSelection( string MainOrderNumber, string ViceOrderNumber, int showtype, int cloudType ) { LYFZ.Software.MainBusiness.DoorCityProcess.frmCloudSelectionFilm frm = new frmCloudSelectionFilm(); frm.MainOrderNumber = MainOrderNumber; frm.ViceOrderNumber = ViceOrderNumber; frm.CloudType = cloudType; frm.ShowType = showtype; if ( !frm.IsDisposed ) { if ( frm.ShowDialog() == DialogResult.OK ) { } } } /// /// 关闭 /// /// /// void btnClose_Click( object sender, EventArgs e ) { this.Close(); } /// /// 儿童版 /// /// /// 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(); } /// /// 婚纱版 /// /// /// 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(); } /// /// 写真版 /// /// /// 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(); } /// /// 窗体大小发生改变事件 /// /// /// void DesignFormMain_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; case 68: this.flowLayoutPanel1.Height = 98; break; } } } /// /// 列表双击事件 /// /// /// 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, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoView ) ) { this.btnLookOver_Click( this, null ); } } } } /// /// 点击事件 /// /// /// void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e ) { if ( e.Button == MouseButtons.Right ) { if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 ) { if ( this.dgvData.CurrentRow != null ) { 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, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.ProcessStatusResetDesign ) ) { 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"] = "4"; 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() == "看版状态" ) { if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.ProcessStatusResetLookDesign ) ) { 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"] = "5"; 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, "StoresDesign", 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 = "ResetDateDesign"; 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, "StoresDesign", 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 = "ResetDateLookDesign"; 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);//弹出操作菜单 } } } } /// /// 列表单击事件 /// /// /// 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 { } } /// /// 对列表控件双击事件 /// /// /// 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(); } } } /// /// 右键菜单选择项事件 /// /// /// 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" || item.Name.ToString().Trim() == "ResetDateDesign" || item.Name.ToString().Trim() == "ResetDateLookDesign" ) { DateTime strTime = SDateTime.Now; string StrContent = ""; List clist = new List(); 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(); } return; } else if ( item.Name.ToString().Trim() == "ResetDateDesign" ) { 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; } Hashtable htData = (Hashtable)item.Tag; LYFZ.Model.Model_ErpOrderDigital model = dbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] ); model.Ordv_DesignerTime = Convert.ToDateTime( frm.StrValue ); model.Ordv_UpdateDateTime = strTime; model.Ordv_UpdateName = StrUserID; clist.Add( dbll.GetUpdateCommandInfo( model ) ); StrContent = "[重置设置日期] 数码编号为:" + htData["StrViceNumber"] + ",设计日期由" + htData["StrOldDate"] + "改为" + frm.StrValue; } else if ( item.Name.ToString().Trim() == "ResetDateLookDesign" ) { 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; } Hashtable htData = (Hashtable)item.Tag; LYFZ.Model.Model_ErpOrderDigital model = dbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] ); model.Ordv_LookDesignTime = Convert.ToDateTime( frm.StrValue ); model.Ordv_UpdateDateTime = strTime; model.Ordv_UpdateName = StrUserID; clist.Add( dbll.GetUpdateCommandInfo( model ) ); StrContent = "[重置看版日期] 数码编号为:" + htData["StrViceNumber"] + ",看版日期由" + htData["StrOldDate"] + "改为" + frm.StrValue; } clist.Add( systbll.GetAddCommandInfo( BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.订单流程重置, StrContent, 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( "重置失败!" ); } } } } /// /// 点击列标头排序 /// /// /// 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; ucPagerEx1.Bind(); } } string GetOrderByName( string StrColumnName ) { switch ( StrColumnName ) { case "订单号": return "Ord_SinceOrderNumber"; case "客户姓名": return "Cus_Name"; case "客户性别": return "Cus_Sex_cs"; case "客户电话": return "Cus_Telephone"; case "订单类型": return "Ord_Type"; case "接单人": return "Ord_OrderPersonName"; case "套系名称": return "Ord_SeriesName"; case "套系价格": return "Ord_SeriesPrice"; case "加急": return "IsExpedited"; case "加急日期": return "ExpeditedTime"; case "拍摄名称": return "Ordpg_Sights"; case "初修状态": return "Ordv_EarlyRepairStatus"; case "选片状态": return "Ordv_FilmSelectionStatus"; case "精修状态": return "Ordv_RefinementStatus"; case "精修日期": return "Ordv_RefinementTime"; case "设计状态": return "Ordv_DesignerStatus"; case "设计师": return "Ordv_DesignerName"; case "设计日期": return "Ordv_DesignerTime"; case "看版师": return "Ordv_LookDesignName"; case "看版日期": return "Ordv_LookDesignTime"; case "看版状态": return "Ordv_LookDesignStatus"; case "看版要求": return "Ordv_LookDesignClaim"; case "取件状态": return "Ords_ProductPickupIntStatus"; case "会员卡号": return "Mc_CradNumber"; default: return ""; } } /// /// 当前点击的字段 /// string StrCurrentClickField = ""; /// /// 排序字段 /// string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber"; /// /// 排序顺序 /// string StrSortOrder = "DESC"; /// /// 创建行 /// void PublicFunctionRows() { this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,加急,加急日期,是否导出,欠款,拍摄名称,初修状态,选片状态,精修状态,精修日期,设计是否外发,设计状态,设计师,设计日期,看版师,看版日期,看版状态,看版要求,取件状态,会员卡号"; string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0005.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 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_OrderDesign( 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"] ) ); foreach (DataGridViewRow row in dgvData.Rows) { if (row.Cells["加急"].Value!=null&&row.Cells["加急"].Value.ToString().Trim() == "是") { //row.DefaultCellStyle.BackColor = Color.Red; row.DefaultCellStyle.Font = new Font("黑体", 10, FontStyle.Bold); row.DefaultCellStyle.ForeColor = Color.Red; } } dgvData.Refresh(); } /// /// 返回要操作的条件 /// /// 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( this.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( "RefinementStatus" ) && DictData["RefinementStatus"].Trim().Length > 0 ) { StrWhere += " and Ordv_RefinementStatus = '2'"; } if ( DictData.ContainsKey( "DesignerStatus" ) && DictData["DesignerStatus"].Trim().Length > 0 ) { StrWhere += " and Ordv_DesignerStatus in('0','1')"; } if ( DictData.ContainsKey( "DesignerName" ) && DictData["DesignerName"].Trim().Length > 0 ) { StrWhere += " and Ordv_DesignerName = '" + DictData["DesignerName"].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_DesignerTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"] ); } StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" ); return StrWhere; } } }