using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using LYFZ.ComponentLibrary;
using LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm;
namespace LYFZ.Software.MainBusiness.DoorCityProcess
{
public partial class TotakePieceFormMain : LYFZ.Software.UI.DoorCityProcess.TotakePieceFormMain
{
public TotakePieceFormMain()
{
this.Shown += TotakePieceFormMain_Shown;
this.Load += TotakePieceFormMain_Load;
this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
this.btnQuery.Click += btnQuery_Click;
this.btnQueryCompleted.Click += btnQueryCompleted_Click;
this.btnRecentPickup.Click += btnRecentPickup_Click;
this.btnHairPiecePickData.Click += btnHairPiecePickData_Click;
this.btnMonthPieces.Click += btnMonthPieces_Click;
this.btnNotAlreadySentBack.Click += btnNotAlreadySentBack_Click;
this.btnMonthRework.Click += btnMonthRework_Click;
this.btnClose.Click += btnClose_Click;
this.chkDressVersion.Click += chkDressVersion_Click;
this.chkKidsVersion.Click += chkKidsVersion_Click;
this.chkPortraitVersion.Click += chkPortraitVersion_Click;
this.Resize += TotakePieceFormMain_Resize;
this.btnByVendorSendOutProduct.Click += btnByVendorSendOutProduct_Click;
this.btnByVendorBackPieceProduct.Click += btnByVendorBackPieceProduct_Click;
this.btnPrintBarcode.Click += btnPrintBarcode_Click;
this.btnScanCodeBackPiece.Click += btnScanCodeBackPiece_Click;
this.btnScanCodeTakePickup.Click += btnScanCodeTakePickup_Click;
this.chkWeddingCelebration.Click += chkWeddingCelebration_Click;
this.dgvData.CellMouseDown += dgvData_CellMouseDown;
this.dgvData.CellClick += dgvData_CellClick;
this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
this.chkShowCompleteOrder.Click += chkShowCompleteOrder_Click;
this.flowLayoutPanel1.Height = 34;
this.cbxDesignNotProduct.Click += cbxDesignNotProduct_Click;
this.btn_ExportData.Click += btn_ExportData_Click;
// 部分取件;
this.cb_PartTaken.CheckedChanged += Cb_PartTaken_CheckedChanged;
this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
}
int ucPagerEx1_EventPaging(UCPager.EventPagingArg e)
{
//pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
if (cbxDesignNotProduct.Checked)
{
PublicFunctionRows(" Ordv_DesignerStatus=2 and ( OPlist_SendVendor is null or OPlist_SendVendor = '' ) ");
}
else
{
PublicFunctionRows();
}
return ucPagerEx1.NMax;
}
public void BindPageData(int pageIndx, int pageSize, int totalCount)
{
ucPagerEx1.NMax = totalCount;
ucPagerEx1.CurrentPageCount = (pageSize);
ucPagerEx1.PageCurrent = pageIndx;
}
private void Cb_PartTaken_CheckedChanged(object sender, EventArgs e)
{
if ( this.cb_PartTaken.Checked == true )
{
// 完成取件和设计未发片 checkbox禁用;
this.cbxDesignNotProduct.Checked = this.chkShowCompleteOrder.Checked = false;
this.cbxDesignNotProduct.Enabled = this.chkShowCompleteOrder.Enabled = false;
}
else
{
// 完成取件和设计未发片 checkbox启用;
this.cbxDesignNotProduct.Enabled = this.chkShowCompleteOrder.Enabled = true;
}
//PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
void btn_ExportData_Click(object sender, EventArgs e)
{
//throw new NotImplementedException();Ord_Number,Ordv_ViceNumber,Ord_Type,
TotakePieceFormExportData exportForm = new TotakePieceFormExportData();
if(exportForm.ShowDialog()== System.Windows.Forms.DialogResult.OK)
{
string exportType = exportForm.ExportType;
switch(exportType)
{
case "ExportPage":
this.dgvData.ExportDataTable();
//MessageBoxCustom.Show("导出成功!");
break;
case "ExportAllData":
DataTable dtData = GetPublicFunctionData();
dtData.Columns.Remove("Ord_Number");
dtData.Columns.Remove("Ordv_ViceNumber");
dtData.Columns.Remove("Ord_Type");
this.dgvData.ExportDataTable(dtData);
PublicFunctionRows();
//MessageBoxCustom.Show("导出成功!");
break;
}
}
}
void cbxDesignNotProduct_Click(object sender, EventArgs e)
{
//if(cbxDesignNotProduct.Checked)
//{
// PublicFunctionRows(" Ordv_DesignerStatus=2 and ( OPlist_SendVendor is null or OPlist_SendVendor = '' ) ");
//}
//else
//{
// PublicFunctionRows();
//}
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 订单号(用于开单处跳转过来)
///
public string StrOrdNumber = "";
///
/// 公共查询的where语句;
///
public string strPublicQueryString = "";
///
/// 是否首次运行
///
bool IsFirstRun = true;
///
/// 查询条件
///
private Dictionary DictData = new Dictionary();
///
/// 员工编号
///
string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
///
/// 窗体加载事件
///
///
///
void TotakePieceFormMain_Shown(object sender, EventArgs e)
{
///保存意向订单的版本权限
List hideControl = new List();
//LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
hideControl.Add(this.btnScanCodeBackPiece);
hideControl.Add(this.btnScanCodeTakePickup);
hideControl.Add(this.btnPrintBarcode);
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.btnByVendorSendOutProduct);
hideControl.Add(this.btnByVendorBackPieceProduct);
LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
VersionControl.VersionFunctionEnum.订单发片取件按厂家发片回件, hideControl, null, null);
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st013");
this.PublicFunctionRights();
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
this.IsFirstRun = false;
this.TotakePieceFormMain_Resize(this, null);
}
///
/// 窗体加载事件
///
///
///
void TotakePieceFormMain_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.btnMonthPieces.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePiece);
this.btnNotAlreadySentBack.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceSentNotBack);
this.btnMonthRework.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceMonthRework);
}
///
/// 分店选择查询数据
///
///
///
void cmbtreevStoreName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
this.PublicFunctionRights();
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.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;
this.ucPagerEx1.Bind();
}
///
/// 查询完成
///
///
///
void btnQueryCompleted_Click(object sender, EventArgs e)
{
this.DictData.Clear();
this.DictData["IsComplete"] = "True";
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 条件查询
///
///
///
void btnRecentPickup_Click(object sender, EventArgs e)
{
this.DictData.Clear();
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQueryTotakePieceSamllForm frm = new SetSmallForm.ConditionQueryTotakePieceSamllForm();
frm.ShowDialog();
if (frm.IsSaveed)
{
this.DictData = frm.DictDataArray;
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
///
/// 按厂家发片
///
///
///
void btnByVendorSendOutProduct_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ByVendorHairPieceSetSmallForm frm = new SetSmallForm.ByVendorHairPieceSetSmallForm();
frm.ShowDialog();
if (frm.IsSaveed)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
///
/// 按厂家回片
///
///
///
void btnByVendorBackPieceProduct_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ByVendorBackPieceSetSmallForm frm = new SetSmallForm.ByVendorBackPieceSetSmallForm();
frm.ShowDialog();
if (frm.IsSaveed)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
///
/// 打印条形码
///
///
///
void btnPrintBarcode_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ByVendorPrintBarcodeSetSmallForm frm = new SetSmallForm.ByVendorPrintBarcodeSetSmallForm();
frm.ShowDialog();
}
///
/// 扫码回件
///
///
///
void btnScanCodeBackPiece_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ByVendorScanCodeSetSmallForm frm = new SetSmallForm.ByVendorScanCodeSetSmallForm();
frm.ScanCodeType = 1;
frm.ShowDialog();
if (frm.IsSaveed)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
///
/// 扫码取件
///
///
///
void btnScanCodeTakePickup_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ByVendorScanCodeSetSmallForm frm = new SetSmallForm.ByVendorScanCodeSetSmallForm();
frm.ScanCodeType = 2;
frm.ShowDialog();
if (frm.IsSaveed)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
///
/// 发片取件资料
///
///
///
void btnHairPiecePickData_Click(object sender, EventArgs e)
{
if (this.dgvData.Rows.Count > 0)
{
if (this.dgvData.SelectedRows.Count > 0)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.HairPieceSingleSmallForm frm = new SetSmallForm.HairPieceSingleSmallForm();
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
Dictionary DictDataArray = new Dictionary();
DictDataArray["ViceNumber"] = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
DictDataArray["OrdNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
DictDataArray["OrdType"] = this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim();
frm.DictDataArray = DictDataArray;
frm.ShowDialog();
if (frm.IsSave)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
else { MessageBoxCustom.Show("请选择订单"); return; }
}
}
///
/// 数据列表双击事件-(进入发片取件资料)
///
///
///
void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (this.dgvData.Rows.Count > 0)
{
if (e.RowIndex != -1 && e.ColumnIndex != -1)
{ this.btnHairPiecePickData_Click(null, null); }
}
}
///
/// 列表单击事件
///
///
///
void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
if (string.IsNullOrEmpty(StrNumber))
{
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;
this.ucPagerEx1.Bind();
}
}
}
///
/// 本月出件
///
///
///
void btnMonthPieces_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.MonthPiecesSmallForm frm = new SetSmallForm.MonthPiecesSmallForm();
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
frm.ShowDialog();
}
///
/// 已发未回
///
///
///
void btnNotAlreadySentBack_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.MonthPiecesNotBackSmallForm frm = new SetSmallForm.MonthPiecesNotBackSmallForm();
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
frm.Text = "已发未回";
frm.ShowDialog();
}
///
/// 本月返工
///
///
///
void btnMonthRework_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.MonthReworkStatisticSmallForm frm = new SetSmallForm.MonthReworkStatisticSmallForm();
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
frm.ShowDialog();
}
///
/// 关闭
///
///
///
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.chkDressVersion.Checked = false; this.chkWeddingCelebration.Checked = false; }
this.cmbQueryText.Text = "";
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 婚纱版
///
///
///
void chkDressVersion_Click(object sender, EventArgs e)
{
if (this.chkDressVersion.Checked)
{ this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = false; this.chkWeddingCelebration.Checked = false; }
this.cmbQueryText.Text = "";
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 写真版
///
///
///
void chkPortraitVersion_Click(object sender, EventArgs e)
{
if (this.chkPortraitVersion.Checked)
{ this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false; this.chkWeddingCelebration.Checked = false; }
this.cmbQueryText.Text = "";
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 婚庆
///
///
///
void chkWeddingCelebration_Click(object sender, EventArgs e)
{
if (this.chkWeddingCelebration.Checked)
{ this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false; }
this.cmbQueryText.Text = "";
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 显示已取订单
///
///
///
void chkShowCompleteOrder_Click(object sender, EventArgs e)
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
///
/// 窗体大小发生改变事件
///
///
///
void TotakePieceFormMain_Resize(object sender, EventArgs e)
{
if (!this.IsFirstRun)
{
switch (this.panelShowCompleteOrder.Location.Y)
{
case 4: this.flowLayoutPanel1.Height = 37; break;
case 36: this.flowLayoutPanel1.Height = 68; break;
case 68: this.flowLayoutPanel1.Height = 98; break;
}
}
}
///
/// 右键菜单
///
///
///
void dgvData_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
{
ToolStripMenuItem item = new ToolStripMenuItem();
Hashtable 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);
// 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);//弹出操作菜单
}
}
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_DataGridViewConMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
ToolStripItem item = e.ClickedItem;
if (item.Name.Trim() == "SetColumnShow")
{
if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn(this.dgvData))
{
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.ucPagerEx1.Bind();
}
}
else if (item.Name.ToString().Trim() == "OrderRemark")
{
Hashtable htData = (Hashtable)item.Tag;
LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.发片取件.ToString().Trim();
frm.ShowDialog();
}
}
///
/// 点击列标头排序
///
///
///
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,tb_ErpOrderProductList.ID"; }
else
{ this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber,tb_ErpOrderProductList.ID"; }
this.StrCurrentClickField = StrColumnName;
//this.PublicFunctionRows();
this.ucPagerEx1.PageCurrent = 1;
this.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";
case "拍照状态": return "Ordpg_PhotographyStatus";
case "选片时间": return "Ordv_FilmSelectionTime";
case "拍摄时间": return "Ordpg_PhotographyTime";
case "是否完成": return "Ords_ProductCompletedIntStatus";
case "商品名称": return "OPlist_ProdName";
case "预约取件日期": return "OPlist_ReservationTakeTime";
case "商品取走日期": return "OPlist_PickupTime";
case "是否发出": return "OPlist_SendVendor";
case "商品完成状态": return "OPlist_CompletedStatus";
case "是否取走": return "OPlist_PickupStatus";
default: return "";
}
}
///
/// 当前点击的字段
///
string StrCurrentClickField = "";
///
/// 排序字段
///
string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber,tb_ErpOrderProductList.ID";
///
/// 排序顺序
///
string StrSortOrder = "DESC";
///
/// 创建行
///
void PublicFunctionRows(string sqlWhere="")
{
this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,拍摄名称,拍摄时间,选片时间,取件状态,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,是否完成,商品名称,加急,预约取件日期,商品取走日期,是否发出,是否返工,商品完成状态,是否取走,会员卡号";
string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0008.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.StrSecondStageNull = "拍摄名称,取件状态,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,是否完成,拍摄时间,选片时间";
this.dgvData.DataColumns(this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn);
Dictionary dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
if (!dictColumns.ContainsKey("Ord_Type"))
{
dictColumns.Add("Ord_Type", "100");
}
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 +
"' and Ords_ProductPickupIntStatus != '2' " +
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(
this.chkPortraitVersion,
this.chkDressVersion,
this.chkKidsVersion,
chkWeddingCelebration: this.chkWeddingCelebration,
StrOrdType: "0,1,2,3,4");
this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere(this.cmbtreevStoreName, "Ord_DividedShop");
}
else
{
StrQueryCondition = this.GetWhereStr();
}
if (!string.IsNullOrEmpty(sqlWhere))
{
if (!string.IsNullOrEmpty(StrQueryCondition))
{
StrQueryCondition += " and " + sqlWhere;
}
else
{
StrQueryCondition += " where " + sqlWhere;
}
}
int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
List listColumns = new List(StrSortField.Replace(" DESC", "").Replace(" ASC", "").Split(','));
if (this.cb_PartTaken.Checked == true)
{
Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderPartTakenPiece(this.dgvData, dictColumns, listColumns, StrQueryCondition, strPublicQueryString, 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"]));
}
else
{
Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderTotakePiece(this.dgvData, dictColumns, listColumns, 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"]));
}
}
DataTable GetPublicFunctionData(string sqlWhere = "")
{
this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,拍摄名称,拍摄时间,选片时间,取件状态,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,是否完成,商品名称,加急,预约取件日期,商品取走日期,是否发出,是否返工,商品完成状态,是否取走,会员卡号";
string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0008.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.StrSecondStageNull = "拍摄名称,取件状态,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,是否完成,,拍摄时间,选片时间";
this.dgvData.DataColumns(this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn);
Dictionary dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
if (!dictColumns.ContainsKey("Ord_Type"))
{
dictColumns.Add("Ord_Type", "100");
}
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 + "' and Ords_ProductPickupStatus != 'OK' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkWeddingCelebration: this.chkWeddingCelebration, StrOrdType: "0,1,2,3,4");
this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere(this.cmbtreevStoreName, "Ord_DividedShop");
}
else
{ StrQueryCondition = this.GetWhereStr(); }
if (!string.IsNullOrEmpty(sqlWhere))
{
if (!string.IsNullOrEmpty(StrQueryCondition))
{
StrQueryCondition += " and " + sqlWhere;
}
else
{
StrQueryCondition += " where " + sqlWhere;
}
}
int intTopCount = 10000;
List listColumns = new List(StrSortField.Replace(" DESC", "").Replace(" ASC", "").Split(','));
Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderTotakePiece(dictColumns, listColumns, StrQueryCondition, intTopCount, this.StrSortField);
//BindPageData(ucPagerEx1.PageCurrent, Convert.ToInt32(htData["CurrentCount"]), Convert.ToInt32(htData["TotalCount"]));
return htData["DataTable"] as DataTable;
}
///
/// 返回要操作的条件
///
///
string GetWhereStr()
{
string StrWhere = " Where Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop");
strPublicQueryString = StrWhere;
bool IsQuery = false;
if (!string.IsNullOrEmpty(this.cmbQueryText.Text.Trim()))
{
IsQuery = true;
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition(this.cmbQueryText.Text.Trim());
}
// 完成状态
if (this.DictData.ContainsKey("IsComplete") && this.DictData["IsComplete"].Trim().Length > 0)
{
if (Convert.ToBoolean(this.DictData["IsComplete"]))
{
IsQuery = true;
StrWhere += " and Ords_ProductCompletedIntStatus = '2'";
}
}
// 欠款
if (this.DictData.ContainsKey("IsArrears") && this.DictData["IsArrears"].Trim().Length > 0)
{
if (Convert.ToBoolean(this.DictData["IsArrears"]))
{
IsQuery = true;
StrWhere += " and (套系金额 + isnull(加挑金额,0) - isnull(收款金额,0)) > 0 ";
}
}
// 取件OK
if (this.DictData.ContainsKey("IsTotakePickupOK") && this.DictData["IsTotakePickupOK"].Trim().Length > 0)
{
if (Convert.ToBoolean(this.DictData["IsTotakePickupOK"]))
{
IsQuery = true;
StrWhere += " and OPlist_PickupStatus = '1' ";
}
}
// 取件人
if (this.DictData.ContainsKey("TotakePickupName") && this.DictData["TotakePickupName"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += " and OPlist_PickupName = '" + this.DictData["TotakePickupName"].Trim() + "' ";
}
// 接单人
if (this.DictData.ContainsKey("StoreNmae") && this.DictData["StoreNmae"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += " and Ord_OrderPersonName like '%" + this.DictData["StoreNmae"].Trim() + "%' ";
}
///已完成日期
if (this.DictData.ContainsKey("CompleteStartDate") && this.DictData["CompleteStartDate"].Trim().Length > 0 && this.DictData.ContainsKey("CompleteEndDate") && this.DictData["CompleteEndDate"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ords_ProductCompletedTime", this.DictData["CompleteStartDate"].Trim(), this.DictData["CompleteEndDate"].Trim());
StrWhere += " and Ords_ProductCompletedIntStatus = '2' ";
}
///已取件日期
if (this.DictData.ContainsKey("PickUpStartDate") && this.DictData["PickUpStartDate"].Trim().Length > 0 && this.DictData.ContainsKey("PickUpEndDate") && this.DictData["PickUpEndDate"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ords_ProductPickupTime", this.DictData["PickUpStartDate"].Trim(), this.DictData["PickUpEndDate"].Trim());
StrWhere += " and Ords_ProductPickupIntStatus = '2' ";
}
// 商品取走日期
if (this.DictData.ContainsKey("TotakePieceStartDate") && this.DictData["TotakePieceStartDate"].Trim().Length > 0 && this.DictData.ContainsKey("TotakePieceEndDate") && this.DictData["TotakePieceEndDate"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("OPlist_PickupTime", this.DictData["TotakePieceStartDate"].Trim(), this.DictData["TotakePieceEndDate"].Trim());
}
// 预约取件日期
if (this.DictData.ContainsKey("ReservationStartDate") && this.DictData["ReservationStartDate"].Trim().Length > 0 && this.DictData.ContainsKey("ReservationEndDate") && this.DictData["ReservationEndDate"].Trim().Length > 0)
{
IsQuery = true;
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("OPlist_ReservationTakeTime", this.DictData["ReservationStartDate"].Trim(), this.DictData["ReservationEndDate"].Trim());
}
if (this.DictData.ContainsKey("IsExpedited") && this.DictData["IsExpedited"].Trim().Length > 0 && Convert.ToBoolean(this.DictData["IsExpedited"].Trim()))
{
IsQuery = true;
StrWhere += " and OPlist_IsExpedited = 1";
}
if (!this.DictData.ContainsKey("PickUpStartDate"))
{
if (!this.chkShowCompleteOrder.Checked)
{ StrWhere += " and ( Ords_ProductPickupIntStatus != '2' )"; }
else
{ StrWhere += " and ( Ords_ProductPickupIntStatus = '2' ) "; }
}
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkWeddingCelebration: this.chkWeddingCelebration, StrOrdType: "0,1,2,3,4");
strPublicQueryString += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkWeddingCelebration: this.chkWeddingCelebration, StrOrdType: "0,1,2,3,4"); ;
return StrWhere;
}
}
}