123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840 |
- using LYFZ.ComponentLibrary;
- 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;
- namespace LYFZ.Software.MainBusiness.SMSManagement
- {
- public partial class FrmSMSProcess : LYFZ.Software.UI.SMSManagement.FrmSMSProcess
- {
- public FrmSMSProcess()
- {
- this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
- this.btnNotShoot.Click += new EventHandler(btnNotShoot_Click);
- this.btnNotSelectionFilms.Click += new EventHandler(btnNotSelectionFilms_Click);
- this.btnNotDesign.Click += new EventHandler(btnNotDesign_Click);
- this.btnNotPickup.Click += new EventHandler(btnNotPickup_Click);
- this.btnSmsSend.Click += new EventHandler(btnSmsSend_Click);
- this.btnClose.Click += new EventHandler(btnClose_Click);
- this.btnSelect.Click += btnSelect_Click;
- this.Shown += FrmSMSProcess_Shown;
- ShortSmsMessage.FrmScreening.bindCmbCustomerType(this.cmbCustomerType);
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.婚纱版 )
- {
- this.dgvOrderProcessCustomer.Columns[1].Visible = false;
- }
- SetSQueryWhereString();
- this.dgvOrderProcessCustomer.Sorted += dgvOrderProcessCustomer_Sorted;
- this.btnSendMicroMessage.Click += btnSendMicroMessage_Click;
- #region 优化列表;
- this.dgvOrderProcessCustomer.VirtualMode = true;
- this.dgvOrderProcessCustomer.CellValueNeeded += DgvOrderProcessCustomer_CellValueNeeded;
- #endregion
- }
- #region 优化列表;
- DataTable dataTable = null;
- private void DgvOrderProcessCustomer_CellValueNeeded( object sender, DataGridViewCellValueEventArgs e )
- {
- // 参数校验;
- if ( dataTable == null || dataTable.Rows.Count == 0 || dataTable.Rows.Count == e.RowIndex )
- return;
- if ( e.ColumnIndex == 0 )
- e.Value = dataTable.Rows[e.RowIndex]["订单号"];
- if ( e.ColumnIndex == 1 )
- e.Value = dataTable.Rows[e.RowIndex]["摄影名称"];
- if ( e.ColumnIndex == 2 )
- e.Value = dataTable.Rows[e.RowIndex]["订单类型"];
- if ( e.ColumnIndex == 3 )
- e.Value = dataTable.Rows[e.RowIndex]["客户姓名"];
- if ( e.ColumnIndex == 4 )
- e.Value = dataTable.Rows[e.RowIndex]["客户性别"];
- if ( e.ColumnIndex == 5 )
- e.Value = dataTable.Rows[e.RowIndex]["客户电话"];
- if ( e.ColumnIndex == 6 )
- {
- string[] BindIDList = null;
- if ( dataTable.Rows[e.RowIndex]["Cus_OpenID"] != null && dataTable.Rows[e.RowIndex]["Cus_OpenID"].ToString().Trim().Length > 0 )
- BindIDList = dataTable.Rows[e.RowIndex]["Cus_OpenID"].ToString().Split('/');
- if ( CheckWxBindOPenID(BindIDList) )
- {
- DataGridViewRow row = this.dgvOrderProcessCustomer.Rows[e.RowIndex];
- e.Value = "已绑定";
- row.Tag = BindIDList;
- }
- }
- if ( e.ColumnIndex == 7 )
- e.Value = dataTable.Rows[e.RowIndex]["拍照状态"];
- if ( e.ColumnIndex == 8 )
- e.Value = dataTable.Rows[e.RowIndex]["初修状态"];
- if ( e.ColumnIndex == 9 )
- e.Value = dataTable.Rows[e.RowIndex]["选片状态"];
- if ( e.ColumnIndex == 10 )
- e.Value = dataTable.Rows[e.RowIndex]["设计状态"];
- if ( e.ColumnIndex == 11 )
- e.Value = dataTable.Rows[e.RowIndex]["看设计状态"];
- if ( e.ColumnIndex == 12 )
- e.Value = dataTable.Rows[e.RowIndex]["齐件状态"];
- if ( e.ColumnIndex == 13 )
- e.Value = dataTable.Rows[e.RowIndex]["取件状态"];
- if ( e.ColumnIndex == 14 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["预约日期"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["预约日期"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- }
- if ( e.ColumnIndex == 15 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["拍摄时间"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["拍摄时间"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[e.RowIndex]["Ordpg_PhotographyCount"] == null || dataTable.Rows[e.RowIndex]["Ordpg_PhotographyCount"].ToString() == "0" )
- e.Value = "此单不含拍照";
- }
- catch { }
- }
- if ( e.ColumnIndex == 16 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["初修时间"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["初修时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- }
- if ( e.ColumnIndex == 17 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["选片时间"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["选片时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- }
- if ( e.ColumnIndex == 18 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["设计时间"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["设计时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- }
- if ( e.ColumnIndex == 19 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["看设计时间"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["看设计时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- }
- if ( e.ColumnIndex == 20 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["取件日期"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["取件日期"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[e.RowIndex]["productCount"] == null || dataTable.Rows[e.RowIndex]["productCount"].ToString() == "0" )
- {
- if ( dataTable.Rows[e.RowIndex]["Ord_Type"].ToString() == "1" )
- e.Value = "此单不含产品";
- }
- }
- catch { }
- }
- if ( e.ColumnIndex == 21 )
- {
- try
- {
- if ( dataTable.Rows[e.RowIndex]["齐件日期"].ToString().Length >= 10 )
- e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["齐件日期"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[e.RowIndex]["productCount"] == null || dataTable.Rows[e.RowIndex]["productCount"].ToString() == "0" )
- {
- if ( dataTable.Rows[e.RowIndex]["Ord_Type"].ToString() == "1" )
- e.Value = "此单不含产品";
- }
- }
- catch { }
- }
- if ( e.ColumnIndex == 22 )
- e.Value = dataTable.Rows[e.RowIndex]["接单人"];
- if ( e.ColumnIndex == 23 )
- e.Value = dataTable.Rows[e.RowIndex]["套系名称"];
- if ( e.ColumnIndex == 24 )
- e.Value = dataTable.Rows[e.RowIndex]["套系价格"];
- }
- #endregion
- void btnSendMicroMessage_Click( object sender, EventArgs e )
- {
- if ( this.dgvOrderProcessCustomer.SelectedRows != null && this.dgvOrderProcessCustomer.SelectedRows.Count > 0 )
- {
- LYFZ.Software.MainBusiness.SMSManagement.SmsSend.frmSendMicroTemplateSMS sendMicro = new SmsSend.frmSendMicroTemplateSMS();
- string openIDs = "";
- for ( int i = 0; i < this.dgvOrderProcessCustomer.SelectedRows.Count; i++ )
- {
- if ( this.dgvOrderProcessCustomer.SelectedRows[i].Tag != null )
- {
- string[] temps = (string[])this.dgvOrderProcessCustomer.SelectedRows[i].Tag;
- foreach ( string bindOpenID in temps )
- {
- string[] openIDStr = bindOpenID.Split(':');
- if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
- {
- if ( openIDStr.Length == 2 )
- {
- string openID = openIDStr[1];
- if ( openIDStr[0].ToLower().Trim() == modInterFace.AppID.Trim().ToLower() )
- {
- if ( openID.Trim().Length > 0 && !openIDs.Contains(openID) )
- {
- openIDs += openID + ",";
- }
- }
- }
- }
- }
- }
- }
- sendMicro.DfTemplateNo = EnumPublic.MicroTemplate.拍摄服务提醒;
- sendMicro.ReceiveOPNIDs = openIDs.Trim(',');
- if ( sendMicro.ReceiveOPNIDs.Trim().Length > 0 )
- {
- sendMicro.ShowDialog();
- }
- else
- {
- MessageBoxCustom.Show("选择的客户没有绑定微信,不能发送微信消息");
- }
- }
- else
- {
- MessageBoxCustom.Show("请选择要发送消息的订单客户");
- }
- }
- void dgvOrderProcessCustomer_Sorted( object sender, EventArgs e )
- {
- Bind();
- }
- void btnSelect_Click( object sender, EventArgs e )
- {
- SetSQueryWhereString();
- Bind();
- }
- List<LYFZ.Software.MainBusiness.EnumPermissions.BusinessType> Versions = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessTypeList();
- #region 加载
- protected void FrmSMSProcess_Shown( object sender, EventArgs e )
- {
- List<Control> hideControl = new List<Control>();
- List<Control> moveControl = new List<Control>();
- hideControl.Add(cbxBindOK);
- //绑定门店
- BindStoreList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
- moveControl.Add(cbxHideOK);
- //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
- VersionControl.VersionFunctionEnum.短信管理微信短信推送, hideControl, moveControl, null);
- try
- {
- modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
- #region 权限设置
- #region 短信发送
- if ( LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.SMSProcessCompetence, CustomAttributes.OperatingAuthority.SMSSend) )
- {
- btnSmsSend.Enabled = true;
- this.btnSendMicroMessage.Enabled = true;
- }
- else
- {
- btnSmsSend.Enabled = false;
- this.btnSendMicroMessage.Enabled = false;
- }
- List<string> dataSource = (List<string>)this.cmbCustomerType.DataSource;
- dataSource.Remove(ShortSmsMessage.SQueryCustomerType.其它客户.ToString());
- this.cmbCustomerType.DataSource = null;
- this.cmbCustomerType.DataSource = dataSource;
- this.cmbCustomerType.SelectedItem = ShortSmsMessage.SQueryCustomerType.全部.ToString();
- #endregion
- #endregion
- Bind();
- }
- catch
- {
- }
- }
- string _SQueryWhereString = "1=1";
- /// <summary>
- /// 查询条件语句
- /// </summary>
- public string SQueryWhereString
- {
- get
- {
- return _SQueryWhereString;
- }
- set
- {
- _SQueryWhereString = value;
- }
- }
- public void Bind()
- {
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.Bind();
- }
- private delegate void UpdateControl();
- string GetStoreWhere()
- {
- if (this.cbxStoreList.Items.Count > 0)
- {
- ItemValue itemStore = (ItemValue)this.cbxStoreList.SelectedItem;
- if (itemStore.Value.ToString() != "0")
- {
- return String.Format("Ord_DividedShop='{0}' and ", itemStore.Value.ToString());
- }
- }
- return "";
- }
- /// <summary>
- /// 设置查询条件
- /// </summary>
- void SetSQueryWhereString( ProcessStatus status = ProcessStatus.全部 )
- {
- string keyWords = this.txtKeyWords.Text.Trim();
- string ord_Type = "";
- ShortSmsMessage.SQueryCustomerType QCustomerType = ShortSmsMessage.SQueryCustomerType.全部;
- QCustomerType = (ShortSmsMessage.SQueryCustomerType)Enum.Parse(typeof(ShortSmsMessage.SQueryCustomerType), this.cmbCustomerType.Text);
- switch ( QCustomerType )
- {
- case ShortSmsMessage.SQueryCustomerType.婚纱客户:
- ord_Type = "[Ord_Type]=0";
- break;
- case ShortSmsMessage.SQueryCustomerType.儿童客户:
- ord_Type = "[Ord_Type]=1";
- break;
- case ShortSmsMessage.SQueryCustomerType.写真客户:
- ord_Type = "[Ord_Type]=2";
- break;
- case ShortSmsMessage.SQueryCustomerType.其它客户:
- ord_Type = "[Ord_Type]=3";
- break;
- default:
- ord_Type = "[Ord_Type] in (0,1,2)";
- ord_Type = "1=1";
- break;
- }
- string processStatusString = "";
- switch ( status )
- {
- case ProcessStatus.已定未拍:
- processStatusString = " and [拍照状态] in('未拍','拍照中')";
- break;
- case ProcessStatus.已拍未选:
- processStatusString = " and ([拍照状态]='OK' and [选片状态]='未选')";
- break;
- case ProcessStatus.已设计未看:
- processStatusString = " and ([设计状态]='OK' and [看设计状态] in('未设计','设计中'))";
- break;
- case ProcessStatus.已完成未取:
- processStatusString = " and ([齐件状态]='OK' and [取件状态] in('未取','部分取件'))";
- break;
- }
- string selectOpenID = "";
- if ( this.cbxBindOK.Checked )
- {
- if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
- {
- selectOpenID = " and [Cus_OpenID] like '%" + modInterFace.AppID.Trim() + ":%' ";
- }
- }
- string Ord_DividedShop = GetStoreWhere();
-
- if ( keyWords.Length > 0 )
- {
- this.SQueryWhereString = Ord_DividedShop+ "(" +ord_Type + " and ( Ord_Number like '%" + keyWords + "%' "
- + " or [客户姓名] like '%" + keyWords + "%'"
- + " or [客户拼音] like '%" + keyWords + "%'"
- + " or [客户电话] like '%" + keyWords + "%') " + selectOpenID + processStatusString+")";
- }
- else
- {
- this.SQueryWhereString = Ord_DividedShop+"((1=1 and " + ord_Type + ") " + selectOpenID + processStatusString+")";
- }
- }
- BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
- LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
- LYFZ.BLL.BLL_CustomerAndWxOpen wxOPenBll = new BLL.BLL_CustomerAndWxOpen();
- List<LYFZ.Model.BindWxOpenID> wxOpenIDList = new List<LYFZ.Model.BindWxOpenID>();
- public List<LYFZ.Model.BindWxOpenID> WxOpenIDList
- {
- get
- {
- if ( wxOpenIDList.Count <= 0 )
- {
- if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
- {
- wxOpenIDList = wxOPenBll.GetWxOpenIdList(0, modInterFace.AppID.Trim());
- }
- }
- return wxOpenIDList;
- }
- }
- int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
- {
- LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
- if ( this.cbxHideOK.Checked )
- {
- pageData.TableName = "[dbo].[Vw_OrderProcessCustomer]";
- }
- else
- {
- pageData.TableName = "[dbo].[Vw_OrderProcessCustomerAll]";
- }
- pageData.PageIndex = this.ucPagerEx1.PageCurrent;
- pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
- this.ucPagerEx1.PageSize = pageData.PageSize;
- pageData.QueryCondition = this.SQueryWhereString;
- pageData.QueryFieldName = "[ID]"
- + " ,[Ord_DividedShop]"
- + ",[Ord_Number]"
- + ",[订单号]"
- + ",[摄影名称]"
- + ",[订单类型]"
- + ",[客户姓名]"
- + ",[客户拼音]"
- + ",[客户性别]"
- + ",[客户电话]"
- + ",[套系类别]"
- + ",[客户来源] "
- + ",[套系名称]"
- + ",[套系价格]"
- + ",[接单人]"
- + ",[拍摄时间]"
- + ",[拍照状态]"
- + ",[初修时间]"
- + ",[初修状态]"
- + ",[选片时间]"
- + ",[选片状态]"
- + ",[设计时间]"
- + ",[设计状态]"
- + ",[精修时间]"
- + ",[精修状态]"
- + ",[看设计时间]"
- + ",[看设计状态]"
- + ",[取件状态]"
- + ",[取件日期]"
- + ",[齐件状态]"
- + ",[齐件日期]"
- + ",[预约日期]"
- + ",[Cus_OpenID]"
- + ",Ordpg_PhotographyCount"
- + ",productCount"
- + ",[Ord_CreateDateTime]";
- pageData.OrderStr = " id desc ";
- LYFZ.ComponentLibrary.DataGridViewEx.SortedColumnModel sortModel
- = this.dgvOrderProcessCustomer.GetSortedColumnModel("预约日期", ListSortDirection.Ascending);
- pageData.OrderStr = sortModel.OrderStr.TrimStart();
- dgvOrderProcessCustomer.Rows.Clear();
- //DataTable dataTable = null;
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate ( object obj, BackgroundWorker backgroundWorker )
- {
- DataSet da = pageData.QueryDataTable();
- dataTable = da.Tables[0];
- try
- {
- if ( this.WxOpenIDList.Count > 0 )
- {
- //预加载
- }
- }
- catch { }
- });
- if ( dataTable.Rows.Count > 0 )
- {
- try
- {
- this.ucPagerEx1.TbDataSource = dataTable;
- }
- catch { }
- #if IGNORE
- #region
- for ( int i = 0; i < dataTable.Rows.Count; i++ )
- {
- DataGridViewRow row = new DataGridViewRow();
- row.CreateCells(this.dgvOrderProcessCustomer);
- row.Cells[0].Value = dataTable.Rows[i]["订单号"].ToString();
- row.Cells[1].Value = dataTable.Rows[i]["摄影名称"].ToString();
- row.Cells[2].Value = dataTable.Rows[i]["订单类型"].ToString();
- row.Cells[3].Value = dataTable.Rows[i]["客户姓名"].ToString();
- row.Cells[4].Value = dataTable.Rows[i]["客户性别"].ToString();
- row.Cells[5].Value = dataTable.Rows[i]["客户电话"].ToString();
- string[] BindIDList = null;
- if ( dataTable.Rows[i]["Cus_OpenID"] != null && dataTable.Rows[i]["Cus_OpenID"].ToString().Trim().Length > 0 )
- {
- BindIDList = dataTable.Rows[i]["Cus_OpenID"].ToString().Split('/');
- }
- if ( CheckWxBindOPenID(BindIDList) )
- {
- row.Cells[6].Value = "已绑定";
- row.Tag = BindIDList;
- }
- else
- {
- row.Cells[6].Value = "";
- }
- row.Cells[7].Value = dataTable.Rows[i]["拍照状态"].ToString();
- row.Cells[8].Value = dataTable.Rows[i]["初修状态"].ToString();
- row.Cells[9].Value = dataTable.Rows[i]["选片状态"].ToString();
- row.Cells[10].Value = dataTable.Rows[i]["设计状态"].ToString();
- row.Cells[11].Value = dataTable.Rows[i]["看设计状态"].ToString();
- row.Cells[12].Value = dataTable.Rows[i]["齐件状态"].ToString();
- row.Cells[13].Value = dataTable.Rows[i]["取件状态"].ToString();
- try
- {
- if ( dataTable.Rows[i]["预约日期"].ToString().Length >= 10 )
- row.Cells[14].Value = Convert.ToDateTime(dataTable.Rows[i]["预约日期"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["拍摄时间"].ToString().Length >= 10 )
- row.Cells[15].Value = Convert.ToDateTime(dataTable.Rows[i]["拍摄时间"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[i]["Ordpg_PhotographyCount"] == null || dataTable.Rows[i]["Ordpg_PhotographyCount"].ToString() == "0" )
- row.Cells[15].Value = "此单不含拍照";
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["初修时间"].ToString().Length >= 10 )
- row.Cells[16].Value = Convert.ToDateTime(dataTable.Rows[i]["初修时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["选片时间"].ToString().Length >= 10 )
- row.Cells[17].Value = Convert.ToDateTime(dataTable.Rows[i]["选片时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["设计时间"].ToString().Length >= 10 )
- row.Cells[18].Value = Convert.ToDateTime(dataTable.Rows[i]["设计时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["看设计时间"].ToString().Length >= 10 )
- row.Cells[19].Value = Convert.ToDateTime(dataTable.Rows[i]["看设计时间"].ToString()).ToString("yyyy-MM-dd");
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["取件日期"].ToString().Length >= 10 )
- row.Cells[20].Value = Convert.ToDateTime(dataTable.Rows[i]["取件日期"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[i]["productCount"] == null || dataTable.Rows[i]["productCount"].ToString() == "0" )
- {
- if ( dataTable.Rows[i]["Ord_Type"].ToString() == "1" )
- row.Cells[20].Value = "此单不含产品";
- }
- }
- catch { }
- try
- {
- if ( dataTable.Rows[i]["齐件日期"].ToString().Length >= 10 )
- row.Cells[21].Value = Convert.ToDateTime(dataTable.Rows[i]["齐件日期"].ToString()).ToString("yyyy-MM-dd");
- else if ( dataTable.Rows[i]["productCount"] == null || dataTable.Rows[i]["productCount"].ToString() == "0" )
- {
- if ( dataTable.Rows[i]["Ord_Type"].ToString() == "1" )
- row.Cells[21].Value = "此单不含产品";
- }
- }
- catch { }
- row.Cells[22].Value = dataTable.Rows[i]["接单人"].ToString();
- row.Cells[23].Value = dataTable.Rows[i]["套系名称"].ToString();
- row.Cells[24].Value = dataTable.Rows[i]["套系价格"].ToString();
- this.dgvOrderProcessCustomer.Rows.Add(row);
- }
- #endregion
- #else
- // 优化列表 ;
- this.dgvOrderProcessCustomer.RowCount = dataTable.Rows.Count;
- #endif
- }
- return pageData.TotalCount;
- }
- bool CheckWxBindOPenID( string[] _BindIDList )
- {
- bool retbl = false;
- if ( _BindIDList != null )
- {
- foreach ( string openIDStr in _BindIDList )
- {
- string[] temps = openIDStr.Split(':');
- if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
- {
- if ( temps[0].Trim().ToLower() == modInterFace.AppID.Trim().ToLower() )
- {
- retbl = true;
- break;
- }
- }
- }
- }
- return retbl;
- }
- /// <summary>
- /// 邦定门店
- /// </summary>
- void BindStoreList(bool isGroupEdition)
- {
- DataRowCollection rows = null;
- int allValue = 0;
- if (isGroupEdition)
- {
- this.cbxStoreList.Show();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
- {
- rows = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim());
- });
- if (rows == null)
- {
- MessageBoxCustom.Show("获取门店信息失败!");
- return;
- }
- else
- {
- if (rows.Count > 1)
- {
- ItemValue itemAll = new ItemValue(allValue, "全部");
- this.cbxStoreList.Items.Add(itemAll);
- this.cbxStoreList.SelectedIndex = 0;
- }
- //是否找到当前店
- bool isCurrentStore = false;
- foreach (DataRow row in rows)
- {
- ItemValue itemStore = new ItemValue(row["Company_DividedShop"].ToString(), row["Company_Name"].ToString());
- itemStore.Tag = row;
- this.cbxStoreList.Items.Add(itemStore);
- if (row["Company_JMGDomain"].ToString().Trim().ToLower() == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim().ToLower())
- {
- isCurrentStore = true;
- this.cbxStoreList.SelectedItem = itemStore;
- }
- }
- if (!isCurrentStore)
- {
- MessageBoxCustom.Show("没有找到当前门店信息");
- this.cbxStoreList.Items.Clear();
- return;
- }
- }
- }
- else
- {
- ItemValue itemAll = new ItemValue(allValue, "全部");
- this.cbxStoreList.Items.Add(itemAll);
- this.cbxStoreList.SelectedIndex = 0;
- this.cbxStoreList.Hide();
- }
- }
- #endregion
- /// <summary>
- /// 流程状态
- /// </summary>
- enum ProcessStatus
- {
- 已定未拍,
- 已拍未选,
- 已设计未看,
- 已完成未取,
- 全部,
- }
- #region 未拍照
- protected void btnNotShoot_Click( object sender, EventArgs e )
- {
- SetSQueryWhereString(ProcessStatus.已定未拍);
- Bind();
- }
- #endregion
- #region 未选片
- protected void btnNotSelectionFilms_Click( object sender, EventArgs e )
- {
- SetSQueryWhereString(ProcessStatus.已拍未选);
- Bind();
- }
- #endregion
- #region 未看设计
- protected void btnNotDesign_Click( object sender, EventArgs e )
- {
- SetSQueryWhereString(ProcessStatus.已设计未看);
- Bind();
- }
- #endregion
- #region 未取件
- protected void btnNotPickup_Click( object sender, EventArgs e )
- {
- SetSQueryWhereString(ProcessStatus.已完成未取);
- Bind();
- }
- #endregion
- #region 发送短信
- protected void btnSmsSend_Click( object sender, EventArgs e )
- {
- string Sj = "";
- if ( this.dgvOrderProcessCustomer.SelectedRows != null && this.dgvOrderProcessCustomer.SelectedRows.Count > 0 )
- {
- LYFZ.Software.MainBusiness.SMSManagement.SmsSend.FrmSendSms sendSms = new SmsSend.FrmSendSms();
- for ( int i = 0; i < this.dgvOrderProcessCustomer.SelectedRows.Count; i++ )
- {
- string tempPhones = this.dgvOrderProcessCustomer.SelectedRows[i].Cells["客户电话"].Value.ToString();
- string okPhones = "";
- LYFZ.WinAPI.CustomPublicMethod.ValidationPhones(tempPhones.Replace('/', ','), ref okPhones);
- okPhones = okPhones.Trim().Trim(',');
- foreach ( string phone in okPhones.Split(',') )
- {
- if ( phone.Trim().Length >= 11 && !Sj.Contains(phone) )
- {
- Sj += phone + ",";
- }
- }
- }
- Sj = Sj.Trim(',');
- if ( Sj.Length >= 11 )
- {
- sendSms.Phone = Sj;
- sendSms.ShowDialog();
- }
- else
- {
- MessageBoxCustom.Show("没有找到有效的手机号");
- }
- }
- else
- {
- MessageBoxCustom.Show("请选择要发送消息的订单");
- }
- }
- #endregion
- #region 关闭
- protected void btnClose_Click( object sender, EventArgs e )
- {
- this.Close();
- }
- #endregion
- }
- }
|