123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.CameraControlBook
- {
- public partial class ReservationMaturityWarningFormMain : LYFZ.Software.UI.CameraControlBook.ReservationMaturityWarningFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public ReservationMaturityWarningFormMain()
- {
- this.Load += ReservationMaturityWarningFormMain_Load;
- this.Shown += ReservationMaturityWarningFormMain_Shown;
- this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
- this.btnQuery.Click += btnQuery_Click;
- this.btnSet.Click += btnSet_Click;
- this.btnExport.Click += btnExport_Click;
- this.btnColseed.Click += btnColseed_Click;
- this.dgvData.RowsAdded += dgvData_RowsAdded;
- this.txtSelectionFilm.KeyPress += txtSelectionFilm_KeyPress;
- this.txtLookDesign.KeyPress += txtLookDesign_KeyPress;
- this.txtPickup.KeyPress += txtPickup_KeyPress;
- this.txtSelectionFilm.Leave += txtSelectionFilm_Leave;
- this.txtLookDesign.Leave += txtLookDesign_Leave;
- this.txtPickup.Leave += txtPickup_Leave;
- this.txtSelectionFilm.KeyDown += txtSelectionFilm_KeyDown;
- this.txtLookDesign.KeyDown += txtLookDesign_KeyDown;
- this.txtPickup.KeyDown += txtPickup_KeyDown;
- }
- private string StrValueType = "OriginalFilm";
- /// <summary>
- /// 员工编号
- /// </summary>
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void ReservationMaturityWarningFormMain_Load(object sender, EventArgs e)
- {
- this.txtSelectionFilm.Text = "0";
- this.txtLookDesign.Text = "0";
- this.txtPickup.Text = "0";
- DataTable dt = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'ReservationDateBeforeRemind'", ShowColumnName: "ID,Sconfig_Value").Tables[0];
- if (dt.Rows.Count > 0)
- {
- DataTable tbl = new Json.JsontoDataTable().toObject(dt.Rows[0]["Sconfig_Value"].ToString().Trim());
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- switch (tbl.Rows[i]["StrCode"].ToString().Trim())
- {
- case "SelectionFilm":
- this.txtSelectionFilm.Text = tbl.Rows[i]["StrValue"].ToString().Trim();
- this.StrValueType = tbl.Rows[i]["StrValueType"].ToString().Trim();
- break;
- case "LookDesign":
- this.txtLookDesign.Text = tbl.Rows[i]["StrValue"].ToString().Trim();
- break;
- case "Pickup":
- this.txtPickup.Text = tbl.Rows[i]["StrValue"].ToString().Trim();
- break;
- }
- }
- }
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void ReservationMaturityWarningFormMain_Shown(object sender, EventArgs e)
- {
- this.dgvData.DataColumns("订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,初修状态,选片状态,预约选片日期,已过几天未完");
- this.PublicFunctionRows();
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.客服中心预约预警提醒);
- if (!b)
- {
- this.Close();
- }
- }
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.panelSelectionFilm.Visible = false;
- this.panelLookDesign.Visible = false;
- this.panelPickup.Visible = false;
- switch (this.tabControlEx1.SelectedTab.Name.Trim())
- {
- case "tabPage_ReservationFilmSelectionNotImportedPhoto":
- this.panelSelectionFilm.Visible = true;
- break;
- case "tabPage_ReservationLookDesignNotImportedPhoto":
- this.panelLookDesign.Visible = true;
- break;
- case "tabPage_ReservationPickupNotBackPhoto":
- this.panelPickup.Visible = true;
- break;
- }
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.AlertSettingSuperSmallForm frm = new SuperSmallForm.AlertSettingSuperSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.ReservationMaturityWarningFormMain_Load(this, null);
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExport_Click(object sender, EventArgs e)
- {
- this.dgvData.ExportDataTable();
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnColseed_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 添加行
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
- {
- if (this.dgvData.Columns.Contains("预约选片日期"))
- { this.dgvData.Rows[e.RowIndex].Cells["预约选片日期"].Value = LYFZ.Command.Command_Validate.DateTimeToString2(this.dgvData.Rows[e.RowIndex].Cells["预约选片日期"].Value); }
- if (this.dgvData.Columns.Contains("预约看样日期"))
- { this.dgvData.Rows[e.RowIndex].Cells["预约看样日期"].Value = LYFZ.Command.Command_Validate.DateTimeToString2(this.dgvData.Rows[e.RowIndex].Cells["预约看样日期"].Value); }
- if (this.dgvData.Columns.Contains("预约取件日期"))
- { this.dgvData.Rows[e.RowIndex].Cells["预约取件日期"].Value = LYFZ.Command.Command_Validate.DateTimeToString2(this.dgvData.Rows[e.RowIndex].Cells["预约取件日期"].Value); }
- }
- /// <summary>
- /// 输入限制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtSelectionFilm_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
- { e.Handled = true; }
- }
- /// <summary>
- /// 输入限制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtLookDesign_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
- { e.Handled = true; }
- }
- /// <summary>
- /// 输入限制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPickup_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
- { e.Handled = true; }
- }
- /// <summary>
- /// 离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtSelectionFilm_Leave(object sender, EventArgs e)
- {
- try { this.txtSelectionFilm.Text = Convert.ToInt32(this.txtSelectionFilm.Text.Trim()).ToString(); }
- catch
- { }
- }
- /// <summary>
- /// 离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtLookDesign_Leave(object sender, EventArgs e)
- {
- try { this.txtLookDesign.Text = Convert.ToInt32(this.txtLookDesign.Text.Trim()).ToString(); }
- catch
- { }
- }
- /// <summary>
- /// 离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPickup_Leave(object sender, EventArgs e)
- {
- try { this.txtPickup.Text = Convert.ToInt32(this.txtPickup.Text.Trim()).ToString(); }
- catch
- { }
- }
- /// <summary>
- /// 输入后回车事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtSelectionFilm_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 输入后回车事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtLookDesign_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 输入后回车事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPickup_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 分页前数据,便于展开时用来查询订单的子数据
- /// </summary>
- DataTable tblMianSelectData = new DataTable();
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- string StrSql = "";
- DataTable newTable = new DataTable();
- this.dgvData.dgvUserEmployeeID = this.StrUserID;
- if (string.IsNullOrEmpty(this.txtSelectionFilm.Text))
- {
- this.txtSelectionFilm.Text = "0";
- return;
- }
- switch (this.tabControlEx1.SelectedTab.Name.Trim())
- {
- case "tabPage_ReservationFilmSelectionNotImportedPhoto":
- switch (this.StrValueType.Trim())
- {
- case "OriginalFilm":
- StrSql = "with " +
- @"photographStatus as (
- select[Ordpg_Number]
- ,[Ordpg_ViceNumber]
- , STUFF((SELECT ','+Ordpg_Sights
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Sights
- , STUFF( (SELECT ',' + Ordpg_Photographer
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Photographer
- , sum(case Ordpg_PhotographyStatus when '0' then 0 when '1' then 2 else 1 end) as totalStatusValue,
- count(Ordpg_PhotographyStatus)*2 as totalCount
- from tb_ErpOrdersPhotography b
- group by[Ordpg_Number],[Ordpg_ViceNumber]
- )
- , tb_OrderDigitalStatus as
- (
- select
- [Ordpg_Number],[Ordpg_ViceNumber] as Ords_ViceNumber,Ordpg_Sights as Ords_SightsName,Ordpg_Photographer as Ords_Photographer,
- (case when totalStatusValue = totalCount and totalStatusValue>0 then 2 when totalStatusValue<totalCount and totalStatusValue>0 then 1 else 0 end) as Ords_PhotographIntStatus
- from
- photographStatus
- )
- ,t AS (" +
- "select Ord_Number," +
- "Ordv_ViceNumber," +
- "Ord_SinceOrderNumber AS 订单号," +
- "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
- "Cus_Name AS 客户姓名," +
- "Cus_Sex_cs AS 客户性别," +
- "Cus_Telephone AS 客户电话," +
- "Ord_OrderPersonName AS 接单人," +
- "Ord_SeriesName AS 套系名称," +
- "Ord_SeriesPrice AS 套系价格," +
- "Ords_SightsName AS 拍摄名称," +
- "(case Ords_PhotographIntStatus when 0 then '未拍' when 1 then '拍摄中' else 'OK' end ) AS 拍照状态," +
- "Ords_Photographer AS 摄影师,"+
- "dbo.fn_CheckOrderFilmSelectionStatus(Ordv_FilmSelectionStatus) AS 选片状态," +
- "dbo.fn_CheckDateTime(Ordv_ReservationFilmSelectionTime) AS 预约选片日期," +
- "DATEDIFF(day, GETDATE(), Ordv_ReservationFilmSelectionTime) AS 预约前N天 " +
- "from dbo.tb_ErpOrder " +
- "Left Join tb_ErpOrderDigital on Ord_Number = Ordv_Number " +
- "Left Join tempTB_AggregationCustomer on Ord_Number = GP_OrderNumber " +
- "Left Join tb_OrderDigitalStatus on Ords_ViceNumber = Ordv_ViceNumber " +
- "where Ordv_FilmSelectionStatus = '0' And Ordv_ReservationFilmSelectionTime is not null And Ords_PhotographIntStatus in (0,1) " +
- ")" +
- "select * from t where (预约前N天 >= 0 And 预约前N天 <= '" + Convert.ToInt32(this.txtSelectionFilm.Text.Trim()) + "') Order by 预约前N天";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- newTable = orbll.GetView_Custom(StrSql).Tables[0];
- });
- DataTable userDt = LYFZ.DAL.DAL_ErpUser.GetCompanyDepartmentDataTable;
- foreach (DataRow dr in newTable.Rows)
- {
- dr["摄影师"] = LYFZ.DAL.DAL_ErpUser.GetCompanyDepartmentUserString(dr["摄影师"].ToString_s(), userDt);
- }
-
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,拍摄名称,拍照状态,摄影师,选片状态,预约选片日期,预约前N天";
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber";
- this.dgvData.StrValueNullColumn = "订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格";
- break;
- case "EarlyRepair":
- StrSql = "with " +
- @"photographStatus as (
- select[Ordpg_Number]
- ,[Ordpg_ViceNumber]
- , STUFF((SELECT ','+Ordpg_Sights
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Sights
- , STUFF( (SELECT ',' + Ordpg_Photographer
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Photographer
- , sum(case Ordpg_PhotographyStatus when '0' then 0 when '1' then 2 else 1 end) as totalStatusValue,
- count(Ordpg_PhotographyStatus)*2 as totalCount
- from tb_ErpOrdersPhotography b
- group by[Ordpg_Number],[Ordpg_ViceNumber]
- )
- , tb_OrderDigitalStatus as
- (
- select
- [Ordpg_Number],[Ordpg_ViceNumber] as Ords_ViceNumber,Ordpg_Sights as Ords_SightsName,Ordpg_Photographer as Ords_Photographer,
- (case when totalStatusValue = totalCount and totalStatusValue>0 then 2 when totalStatusValue<totalCount and totalStatusValue>0 then 1 else 0 end) as Ords_PhotographIntStatus
- from
- photographStatus
- )
- ,t AS (" +
- "select Ord_Number," +
- "Ordv_ViceNumber," +
- "Ord_SinceOrderNumber AS 订单号," +
- "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
- "Cus_Name AS 客户姓名," +
- "Cus_Sex_cs AS 客户性别," +
- "Cus_Telephone AS 客户电话," +
- "Ord_OrderPersonName AS 接单人," +
- "Ord_SeriesName AS 套系名称," +
- "Ord_SeriesPrice AS 套系价格," +
- "Ords_SightsName AS 拍摄名称," +
- "dbo.fn_CheckOrderEarlyRepairStatus(Ordv_EarlyRepairStatus) AS 初修状态," +
- "dbo.fn_CheckOrderFilmSelectionStatus(Ordv_FilmSelectionStatus) AS 选片状态," +
- "dbo.fn_CheckDateTime(Ordv_ReservationFilmSelectionTime) AS 预约选片日期," +
- "DATEDIFF(day, GETDATE(), Ordv_ReservationFilmSelectionTime) AS 预约前N天 " +
- "from dbo.tb_ErpOrder " +
- "Left Join tb_ErpOrderDigital on Ord_Number = Ordv_Number " +
- "Left Join tempTB_AggregationCustomer on Ord_Number = GP_OrderNumber " +
- "Left Join tb_OrderDigitalStatus on Ords_ViceNumber = Ordv_ViceNumber " +
- "where Ordv_FilmSelectionStatus = '0' And Ordv_EarlyRepairStatus <> '2' And Ordv_ReservationFilmSelectionTime is not null " +
- ")" +
- "select * from t where (预约前N天 >= 0 And 预约前N天 <= '" + Convert.ToInt32(this.txtSelectionFilm.Text.Trim()) + "') Order by 预约前N天";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- newTable = orbll.GetView_Custom(StrSql).Tables[0];
- });
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,拍摄名称,初修状态,选片状态,预约选片日期,预约前N天";
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber";
- this.dgvData.StrValueNullColumn = "订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格";
- break;
- }
- break;
- case "tabPage_ReservationLookDesignNotImportedPhoto":
- StrSql = "with " +
- @"photographStatus as (
- select[Ordpg_Number]
- ,[Ordpg_ViceNumber]
- , STUFF((SELECT ','+Ordpg_Sights
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Sights
- , STUFF( (SELECT ',' + Ordpg_Photographer
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Photographer
- , sum(case Ordpg_PhotographyStatus when '0' then 0 when '1' then 2 else 1 end) as totalStatusValue,
- count(Ordpg_PhotographyStatus)*2 as totalCount
- from tb_ErpOrdersPhotography b
- group by[Ordpg_Number],[Ordpg_ViceNumber]
- )
- , tb_OrderDigitalStatus as
- (
- select
- [Ordpg_Number],[Ordpg_ViceNumber] as Ords_ViceNumber,Ordpg_Sights as Ords_SightsName,Ordpg_Photographer as Ords_Photographer,
- (case when totalStatusValue = totalCount and totalStatusValue>0 then 2 when totalStatusValue<totalCount and totalStatusValue>0 then 1 else 0 end) as Ords_PhotographIntStatus
- from
- photographStatus
- )
- ,t AS (" +
- "select Ord_Number," +
- "Ordv_ViceNumber," +
- "Ord_SinceOrderNumber AS 订单号," +
- "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
- "Cus_Name AS 客户姓名," +
- "Cus_Sex_cs AS 客户性别," +
- "Cus_Telephone AS 客户电话," +
- "Ord_OrderPersonName AS 接单人," +
- "Ord_SeriesName AS 套系名称," +
- "Ord_SeriesPrice AS 套系价格," +
- "Ords_SightsName AS 拍摄名称," +
- "dbo.fn_CheckOrderDesignerStatus(Ordv_DesignerStatus) AS 设计状态," +
- "dbo.fn_CheckOrderLookDesignStatus(Ordv_LookDesignStatus) AS 看样状态," +
- "dbo.fn_CheckDateTime(Ordv_ReservationLookDesignTime) AS 预约看样日期," +
- "DATEDIFF(day, GETDATE(), Ordv_ReservationLookDesignTime) AS 预约前N天 " +
- "from dbo.tb_ErpOrder " +
- "Left Join dbo.tb_ErpOrderDigital on Ord_Number = Ordv_Number " +
- "Left Join tempTB_AggregationCustomer on Ord_Number = GP_OrderNumber " +
- "Left Join tb_OrderDigitalStatus on Ords_ViceNumber = Ordv_ViceNumber " +
- "where Ordv_FilmSelectionStatus = '0' And Ordv_EarlyRepairStatus <> '2' And Ordv_ReservationLookDesignTime is not null " +
- ")" +
- "select * from t where (预约前N天 >= 0 And 预约前N天 <= '" + Convert.ToInt32(this.txtLookDesign.Text.Trim()) + "') Order by 预约前N天";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- newTable = orbll.GetView_Custom(StrSql).Tables[0];
- });
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,拍摄名称,设计状态,看样状态,预约看样日期,预约前N天";
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber";
- this.dgvData.StrValueNullColumn = "订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格";
- break;
- case "tabPage_ReservationPickupNotBackPhoto":
- StrSql = "with " +
- @"photographStatus as (
- select[Ordpg_Number]
- ,[Ordpg_ViceNumber]
- , STUFF((SELECT ','+Ordpg_Sights
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Sights
- , STUFF( (SELECT ',' + Ordpg_Photographer
- FROM tb_ErpOrdersPhotography a
- WHERE b.Ordpg_ViceNumber = a.Ordpg_ViceNumber
- FOR XML PATH('') )
- ,1,1,''
- )AS Ordpg_Photographer
- , sum(case Ordpg_PhotographyStatus when '0' then 0 when '1' then 2 else 1 end) as totalStatusValue,
- count(Ordpg_PhotographyStatus)*2 as totalCount
- from tb_ErpOrdersPhotography b
- group by[Ordpg_Number],[Ordpg_ViceNumber]
- )
- , tb_OrderDigitalStatus as
- (
- select
- [Ordpg_Number],[Ordpg_ViceNumber] as Ords_ViceNumber,Ordpg_Sights as Ords_SightsName,Ordpg_Photographer as Ords_Photographer,
- (case when totalStatusValue = totalCount and totalStatusValue>0 then 2 when totalStatusValue<totalCount and totalStatusValue>0 then 1 else 0 end) as Ords_PhotographIntStatus
- from
- photographStatus
- )
- ,t AS (" +
- "select Ord_Number," +
- "Ordv_ViceNumber," +
- "Ord_SinceOrderNumber AS 订单号," +
- "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
- "Cus_Name AS 客户姓名," +
- "Cus_Sex_cs AS 客户性别," +
- "Cus_Telephone AS 客户电话," +
- "Ord_OrderPersonName AS 接单人," +
- "Ord_SeriesName AS 套系名称," +
- "Ord_SeriesPrice AS 套系价格," +
- "Ords_SightsName AS 拍摄名称," +
- "OPlist_ProdName AS 商品名称," +
- "dbo.fn_CheckProductCompletedStatus(OPlist_CompletedStatus) AS 回片状态," +
- "dbo.fn_CheckProductTakePiecesStatus(OPlist_PickupStatus) AS 取件状态," +
- "dbo.fn_CheckDateTime(OPlist_ReservationTakeTime) AS 预约取件日期," +
- "DATEDIFF(day, GETDATE(), OPlist_ReservationTakeTime) AS 预约前N天 " +
- "from tb_ErpOrderProductList " +
- "Left Join tb_ErpOrder on Ord_Number = OPlist_OrderNumber " +
- "Left Join tempTB_AggregationCustomer on Ord_Number = GP_OrderNumber " +
- "Left Join tb_ErpOrderDigital on Ordv_ViceNumber = OPlist_ViceNumber " +
- "Left Join tb_OrderDigitalStatus on Ords_ViceNumber = Ordv_ViceNumber " +
- "Where OPlist_Type = '2' And OPlist_ReservationTakeTime is not null And OPlist_PickupStatus = '0' And OPlist_CompletedStatus = '0' " +
- ")" +
- "select * from t where (预约前N天 >= 0 And 预约前N天 <= '" + Convert.ToInt32(this.txtPickup.Text.Trim()) + "') Order by 预约前N天";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- newTable = orbll.GetView_Custom(StrSql).Tables[0];
- });
- this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,拍摄名称,回片状态,取件状态,预约取件日期,预约前N天";
- this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber";
- this.dgvData.StrValueNullColumn = "订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格";
- this.dgvData.StrSecondStageNull = "拍摄名称";
- break;
- }
- if (newTable.Rows.Count > 0)
- { this.dgvData.DataSource(newTable, StrSecondStageNull: this.dgvData.StrSecondStageNull); }
- else
- { this.dgvData.Rows.Clear(); this.dgvData.DataColumns(this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn); }
- this.dgvData.FillLastColumn(true);
- if (this.dgvData.Columns.Contains("客户姓名"))
- { this.dgvData.Columns["客户姓名"].Frozen = true; }
- for (int i = 0; i < this.dgvData.Columns.Count; i++)
- {
- if (this.dgvData.Columns[i].Name.Trim().IndexOf("日期") != -1)
- { this.dgvData.Columns[i].Width = 110; }
- }
- Hashtable htData = new Hashtable();
- for (int i = 0; i < tblMianSelectData.Rows.Count; i++)
- { htData[tblMianSelectData.Rows[i]["Ord_Number"].ToString().Trim()] = tblMianSelectData.Rows[i]["Ord_Number"].ToString().Trim(); }
- this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
- this.dataGridViewStatisticsCount1.CurrenQuantity = htData.Count;
- this.dataGridViewStatisticsCount1.TotalQuantity = htData.Count;
- }
- }
- }
|