📄 ordersearch.ascx.cs
字号:
#endregion
public string Height
{
get
{
return this.OrderTb.Height;
}
set
{
this.OrderTb.Height= value;
}
}
public string Width
{
get
{
return this.OrderTb.Width;
}
set
{
this.OrderTb.Width = value;
}
}
/// <summary>
/// 是否隐藏搜索
/// </summary>
public bool IsVisibleSearch
{
get
{
return this._isVisibleSearch;
}
set
{
this._isVisibleSearch=value;
}
}
/// <summary>
/// 根据State传入属性值与StateList枚举值判断当前订单状况并进行相应条件搜索
/// </summary>
private enum StateList
{
StoreHourse = 0,
Transport,
Reciver,
Close,
All
};
public int State
{
get
{
return _state;
}
set
{
_state = value;
}
}
#region
//public string PageName
//{
// get
// {
// return this._pageName;
// }
// set
// {
// this._pageName=value;
// }
//}
//public bool CanCreateOrder
//{
// get
// {
// return this._canCreateOrder;
// }
// set
// {
// this._canCreateOrder=value;
// }
//}
//public bool CanReplyRequire
//{
// get
// {
// return this._canReplayRequire;
// }
// set
// {
// this._canReplayRequire=value;
// }
//}
//public bool CanInputTransportInfo
//{
// get
// {
// return this._canInputTransportInfo;
// }
// set
// {
// this._canInputTransportInfo=value;
// }
//}
//public bool CanConfirmReceive
//{
// get
// {
// return this._canConfirmReceive;
// }
// set
// {
// this._canConfirmReceive=value;
// }
//}
//public bool CanCloseOrder
//{
// get
// {
// return this._canCloseOrder;
// }
// set
// {
// this._canCloseOrder=value;
// }
//}
//public bool IsAdmin
//{
// get
// {
// return this._isAdmin;
// }
// set
// {
// this._isAdmin=value;
// }
//}
//public int EmployeeID
//{
// get
// {
// return this._employeeID;
// }
// set
// {
// this._employeeID = value;
// }
//}
//public int OrderID
//{
// get
// {
// return this.OrderID;
// }
// set
// {
// this.OrderID = value;
// }
//}
#endregion
#endregion
private OrdersBL _ordersBL = new OrdersBL();
private BasePage _basepage = new BasePage();
private OrdersCollection _ordersCollection=new OrdersCollection();
private CustomersBL _customersBL = new CustomersBL();
private WebService.VinciService _vinviService = new WebService.VinciService();
private string sqlStr;
public string SqlStr
{
get
{
return this.sqlStr;
}
set
{
this.sqlStr = value;
}
}
private Common myCn = new Common();
protected void Page_Load(object sender, EventArgs e)
{
//绑定Employees表中的数据到相应控件中
DateTime startDate = Convert.ToDateTime("2000-01-01");
//if (!Page.IsPostBack)
//{
this.createOrderStart.Value = startDate;
this.storeOrderStart.Value = startDate;
this.sendOrderStart.Value = startDate;
this.okOrderStart.Value = startDate;
this.closeOrderStart.Value = startDate;
//}
if (this.orderIDtxt.Text == "")
{
this.orderIDtxt.Text = this.orderIDtxt.Text.Trim().ToString();
}
if (!IsPostBack)
{
BindOrdersDataToOrderSearch(this.EmployeeID);
}
#region Control the Column View
if (!IsVisibleSearch)
{
this.OrderTb.Visible = false;
}
#endregion
if (State ==((int)StateList.StoreHourse))
{
this.peiList.Enabled = false;
this.postList.Enabled = false;
this.okList.Enabled = false;
this.closeList.Enabled = false;
this.storeOrderStart.Enabled = false;
this.storeOrderEnd.Enabled = false;
this.sendOrderStart.Enabled = false;
this.sendOrderEnd.Enabled = false;
this.okOrderStart.Enabled = false;
this.okOrderEnd.Enabled = false;
this.closeOrderStart.Enabled = false;
this.closeOrderEnd.Enabled = false;
this.stateList.SelectedIndex = 1;
this.stateList.Enabled = false;
//if (!IsPostBack)
//{
// this.stateList.Items.Add(OrderState);
// this.stateList.Items[0].Value = StateList.StoreHourse.ToString();
//}
}
if (State == ((int)StateList.Transport))
{
this.peiList.Enabled = true;
this.postList.Enabled = false;
this.okList.Enabled = false;
this.closeList.Enabled = false;
this.storeOrderStart.Enabled = true;
this.storeOrderEnd.Enabled = true;
this.sendOrderStart.Enabled = false;
this.sendOrderEnd.Enabled = false;
this.okOrderStart.Enabled = false;
this.okOrderEnd.Enabled = false;
this.closeOrderStart.Enabled = false;
this.closeOrderEnd.Enabled = false;
this.stateList.SelectedIndex = 2;
this.stateList.Enabled = false;
//if (!IsPostBack)
//{
// this.stateList.Items.Add(OrderState);
// this.stateList.Items[0].Value = StateList.Transport.ToString();
//}
}
if (State == ((int)StateList.Reciver))
{
this.peiList.Enabled = true;
this.customerList.Enabled = true;
this.createList.Enabled = true;
this.postList.Enabled = true;
this.okList.Enabled = false;
this.closeList.Enabled = false;
this.createOrderStart.Enabled = true;
this.createOrderEnd.Enabled = true;
this.storeOrderStart.Enabled = true;
this.storeOrderEnd.Enabled = true;
this.sendOrderStart.Enabled = true;
this.sendOrderEnd.Enabled = true;
this.okOrderStart.Enabled = false;
this.okOrderEnd.Enabled = false;
this.closeOrderStart.Enabled = false;
this.closeOrderEnd.Enabled = false;
this.stateList.SelectedIndex = 3;
this.stateList.Enabled = false;
//if (!IsPostBack)
//{
// this.stateList.Items.Add(OrderState);
// this.stateList.Items[0].Value = StateList.Reciver.ToString();
//}
}
if (State == ((int)StateList.Close))
{
this.createList.Enabled = true;
this.peiList.Enabled = true;
this.postList.Enabled = true;
this.okList.Enabled = true;
this.closeList.Enabled = false;
this.createOrderStart.Enabled = true;
this.createOrderEnd.Enabled = true;
this.storeOrderStart.Enabled = true;
this.storeOrderEnd.Enabled = true;
this.sendOrderStart.Enabled = true;
this.sendOrderEnd.Enabled = true;
this.okOrderStart.Enabled = true;
this.okOrderEnd.Enabled = true;
this.closeOrderStart.Enabled = false;
this.closeOrderEnd.Enabled = false;
this.stateList.SelectedIndex = 4;
this.stateList.Enabled = false;
//if (!IsPostBack)
//{
// this.stateList.Items.Add(OrderState);
// this.stateList.Items[0].Value = StateList.Close.ToString();
//}
}
if (State == ((int)StateList.All))
{
this.createList.Enabled = true;
this.peiList.Enabled = true;
this.postList.Enabled = true;
this.okList.Enabled = true;
this.closeList.Enabled = true;
this.createOrderStart.Enabled = true;
this.createOrderEnd.Enabled = true;
this.storeOrderStart.Enabled = true;
this.storeOrderEnd.Enabled = true;
this.sendOrderStart.Enabled = true;
this.sendOrderEnd.Enabled = true;
this.okOrderStart.Enabled = true;
this.okOrderEnd.Enabled = true;
this.closeOrderStart.Enabled = true;
this.closeOrderEnd.Enabled = true;
this.stateList.SelectedIndex = 0;
this.stateList.Enabled = false;
//if (!IsPostBack)
//{
// this.stateList.Items.Add("待备货");
// this.stateList.Items.Add("待发货");
// this.stateList.Items.Add("待确认");
// this.stateList.Items.Add("待关闭");
//}
}
}
protected void customerList_SelectedIndexChanged(object sender, EventArgs e)
{
this.CustomerID = Convert.ToInt32(this.customerList.SelectedItem.Value);
}
protected void createList_SelectedIndexChanged(object sender, EventArgs e)
{
this.OrderCreateID = Convert.ToInt32(this.createList.SelectedItem.Value);
}
protected void peiList_SelectedIndexChanged(object sender, EventArgs e)
{
this.StorehouseAccepterID = Convert.ToInt32(this.peiList.SelectedItem.Value);
}
protected void postList_SelectedIndexChanged(object sender, EventArgs e)
{
this.Carrier = this.postList.SelectedItem.Text;
}
protected void okList_SelectedIndexChanged(object sender, EventArgs e)
{
this.Receiver = this.okList.SelectedItem.Text;
}
protected void closeList_SelectedIndexChanged(object sender, EventArgs e)
{
this.OrderCloseAccepterID = Convert.ToInt32(this.closeList.SelectedItem.Value);
}
protected void containList_SelectedIndexChanged(object sender, EventArgs e)
{
this.OrgID = Convert.ToInt32(this.containList.SelectedItem.Value);
}
protected void stateList_SelectedIndexChanged(object sender, EventArgs e)
{
this.OrderState = this.stateList.SelectedItem.Text;
}
//绑定Orders表中的数据到对应的选项栏中
public void BindOrdersDataToOrderSearch(int employeesID)
{
CustomersBL customerBL = new CustomersBL();
OrdersBL ordersBL = new OrdersBL();
OrdersCollection ordersCollection = new OrdersCollection();
CustomersCollection customerCollection = new CustomersCollection();
int[] employeesIDList=new int[_vinviService.GetAllIsSubOrgEmployeesInfo(employeesID).Length];
employeesIDList=_vinviService.GetAllIsSubOrgEmployeesInfo(employeesID);
customerCollection = customerBL.GetCustomersList();
for (int i = 0; i < customerCollection.Count; i++)
{
ListItem item1 = new ListItem();
item1.Text = customerCollection[i].ContactName;
item1.Value = customerCollection[i].CustomerID.ToString();
if (!this.customerList.Items.Contains(item1))
{
this.customerList.Items.Add(item1);
}
}
for (int i = 0; i < _vinviService.GetEmployeesList().Length; i++)
{
ListItem storeItem = new ListItem();
storeItem.Value = _vinviService.GetEmployeesList()[i].EmployeeID.ToString();
storeItem.Text = _vinviService.GetEmployeesList()[i].FirstName + " " + _vinviService.GetEmployeesList()[i].LastName;
if (!this.peiList.Items.Contains(storeItem))
{
this.peiList.Items.Add(storeItem);
}
if (!this.postList.Items.Contains(storeItem))
{
this.postList.Items.Add(storeItem);
}
}
if (employeesIDList.Length > 0)
{
ordersCollection = ordersBL.GetOrdersInfoByEmployeeID(employeesIDList);
for (int i =0; i <ordersCollection.Count; i++)
{
ListItem createItem = new ListItem();
createItem.Value = ordersCollection[i].EmployeeID.ToString();
createItem.Text = _vinviService.GetEmployeeName(ordersCollection[i].EmployeeID,ordersCollection[i].EmployeeID,_basepage.Ticket,out _basepage.error_Message);
if (!this.createList.Items.Contains(createItem))
{
this.createList.Items.Add(createItem);
}
if (!this.okList.Items.Contains(createItem))
{
this.okList.Items.Add(createItem);
}
if (!this.closeList.Items.Contains(createItem))
{
this.closeList.Items.Add(createItem);
}
ListItem subOrgItem = new ListItem();
subOrgItem.Value = ordersCollection[i].OrgID.ToString();
subOrgItem.Text = _vinviService.GetOrgName(ordersCollection[i].OrgID, ordersCollection[i].OrgID, _basepage.Ticket,out _basepage.error_Message);
if (!this.containList.Items.Contains(subOrgItem))
{
this.containList.Items.Add(subOrgItem);
}
}
}
else
{
for (int i = 0; i < _vinviService.GetEmployeesList().Length; i++)
{
ListItem createItem = new ListItem();
createItem.Value = _vinviService.GetEmployeesList()[i].EmployeeID.ToString();
createItem.Text = _vinviService.GetEmployeesList()[i].FirstName + " " + _vinviService.GetEmployeesList()[i].LastName;
if (!this.createList.Items.Contains(createItem))
{
this.createList.Items.Add(createItem);
}
if (!this.okList.Items.Contains(createItem))
{
this.okList.Items.Add(createItem);
}
if (!this.closeList.Items.Contains(createItem))
{
this.closeList.Items.Add(createItem);
}
}
for (int i = 0; i < _vinviService.GetOrganizationList(1,_basepage.Ticket,out _basepage.error_Message).Length; i++)
{
ListItem subOrgItem = new ListItem();
subOrgItem.Value = _vinviService.GetOrganizationList(1,_basepage.Ticket,out _basepage.error_Message)[i].OrgID.ToString();
subOrgItem.Text = _vinviService.GetOrganizationList(1, _basepage.Ticket, out _basepage.error_Message)[i].OrgName;
if (!this.containList.Items.Contains(subOrgItem))
{
this.containList.Items.Add(subOrgItem);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -