📄 po04.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using VinciBusinessLogic.BusinessLogic;
using VinciDataAccess.DataAccess;
using VinciDataAccess.Entity;
using VinciWebService;
public partial class Web_Order_Default :BasePage
{
private OrdersStore _ordersStore = new OrdersStore();
public OrdersBL _ordersBL = new OrdersBL();
private Common _common = new Common();
private string sqlStr = "select * from Orders where ReceiveInfoInputerID IS null AND TransportInfoInputerID IS not null ";
private string strWhere = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Master.UserData = UserData;
this.GetSurelyOrders(); //页面初始加载时显示当前部门的所有待确认订单
// this.OrderSearch1.IsVisibleSearch = false; //面初始加载时搜索控件隐藏
}
this.OrderSearch1.IsVisibleSearch = true; //面初始加载时搜索控件隐藏
this.OrderSearch1.IsResult = false; //将开始搜索按钮不可见
this.OrderSearch1.IsOkEnabled = true;
this.OrderSearch1.IsSearch = true;
this.OrderSearch1.PageTitle = "待确认订单一览";
this.OrderSearch1.EmployeeID = UserData.EmployeeID;
this.OrderSearch1.State = 2;
this.OrderSearch1.OrderState = "待确认";
}
public void GetSurelyOrders() //获取当前待确认的订单
{
int count = 0;
int _orgID = UserData.OrgID;
OrdersCollection ordersInfo = new OrdersCollection();
WebService.EmployeesEntity _employeesEntity = new WebService.EmployeesEntity();
WebService.VinciService _webService = new WebService.VinciService();
if (!IsPostBack)
{
int _orderNum = _ordersBL.GetGetCurrentSurelyOrdersNum(_orgID);
ordersInfo = _ordersBL.GetCurrentSurelyOrdersBL(_orgID);
if (_orderNum > 0)
{
this.showMessage.Visible = false;
}
else
{
this.showMessage.Visible = true;
this.showMessage.ForeColor = System.Drawing.Color.Brown;
}
}
else
{
ordersInfo = _ordersBL.GetSearchOrders(SearchOrders());
if (ordersInfo.Count > 0)
{
this.showMessage.Visible = false;
}
else
{
this.showMessage.Visible = true;
this.showMessage.ForeColor = System.Drawing.Color.Brown;
}
}
foreach (OrdersEntity order in ordersInfo)
{
if (count % 2 == 0)
{
tabNeedToSure.CssClass = "LineItem";
}
else
{
tabNeedToSure.CssClass = "LineItem1";
}
string customersName = _ordersBL.GetCustomersName(order.CustomerID); //通过CustomerID获取CustomerName
string orderCreaterName = _webService.GetEmployeeName(order.OrderCreaterID, order.EmployeeID, Ticket, out error_Message); //通过OrderCreaterID获取建立者
string storehouseAccepterName = _webService.GetEmployeeName(order.StorehouseAccepterID, order.EmployeeID, Ticket, out error_Message); //通过StorehouseAccepterID获取配货者
string orgName = _webService.GetOrgName(order.OrderID, order.OrderID, Ticket, out error_Message); //通过OrgID获取OrgName
TableRow row = new TableRow();
TableCell orderID = new TableCell();
orderID.Text = "<a href='#' onclick=" + "\"" + "javascript:showModalDialog('PO07.aspx?OrderID=" + order.OrderID.ToString() + "','_blank', 'dialogWidth:600px;dialogHeight:800px;center:yes;status:yes');" + "\">" + "<span style='font-size:9pt;text-decoration:none;color:green;'><strong>" + order.OrderID.ToString() + "</a>"; //订单ID
orderID.HorizontalAlign = HorizontalAlign.Center;
TableCell customerID = new TableCell();
customerID.Text = "[" + customersName + "]"; //客户
TableCell orderCreaterID = new TableCell();
orderCreaterID.Text = "[" + orderCreaterName + "]"; //建立者
TableCell storehouseAccepterID = new TableCell();
storehouseAccepterID.Text = "[" + storehouseAccepterName + "]"; //配货者
TableCell carrier = new TableCell();
carrier.Text = order.Carrier.ToString(); //发货者
TableCell state = new TableCell();
state.Text = "待确认"; //订单状态
TableCell orderDate = new TableCell();
DateTime _orderDate = Convert.ToDateTime(order.OrderDate);
orderDate.Text = _orderDate.ToShortDateString(); //订单建立时间
TableCell storehouseReadyDate = new TableCell();
DateTime _storehouseReadyDate=Convert.ToDateTime(order.StorehouseReadyDate);
storehouseReadyDate.Text =_storehouseReadyDate.ToShortDateString() ; //配货时间
TableCell transportDate = new TableCell();
DateTime _transportDate = Convert.ToDateTime( order.TransportDate);
transportDate.Text = _transportDate.ToShortDateString(); //发货时间
TableCell orgID = new TableCell();
orgID.Text = "[" + orgName + "]"; //所属分支OrgName
orderID.HorizontalAlign = HorizontalAlign.Center;
row.Cells.Add(orderID);
row.Cells.Add(customerID);
row.Cells.Add(orderCreaterID);
row.Cells.Add(storehouseAccepterID);
row.Cells.Add(carrier);
row.Cells.Add(state);
row.Cells.Add(orderDate);
row.Cells.Add(storehouseReadyDate);
row.Cells.Add(transportDate);
row.Cells.Add(orgID);
if (count % 2 == 0)
{
row.Attributes.Add("Class", "LineItem");
}
else
{
row.Attributes.Add("Class", "LineItem1");
}
tabNeedToSure.Rows.Add(row);
tabNeedToSure.HorizontalAlign = HorizontalAlign.Center;
count++;
}
}
public string SearchOrders()
{
try
{
if (strWhere == "")
{
if (this.OrderSearch1.OrderID != "")
{
strWhere += "AND OrderID like '%" + this.OrderSearch1.OrderID + "%'";
}
if (this.OrderSearch1.OrderID == "")
{
strWhere += "AND OrderID LIKE '%' ";
}
if (Convert.ToString(this.OrderSearch1.CustomerID) != "0")
{
strWhere += " AND CustomerID=" + this.OrderSearch1.CustomerID;
}
if (Convert.ToString(this.OrderSearch1.OrderCreateID) != "0")
{
strWhere += " AND OrderCreaterID=" + this.OrderSearch1.OrderCreateID;
}
if (Convert.ToString(this.OrderSearch1.StorehouseAccepterID) != "0")
{
strWhere += " AND StorehouseAccepterID=" + this.OrderSearch1.StorehouseAccepterID;
}
if ((this.OrderSearch1.CreatOrderStartTime != Convert.ToString(DateTime.Now.Date)) || (this.OrderSearch1.CreateOrderEndTime != Convert.ToString(DateTime.Now.Date)))
{
strWhere += " AND OrderDate BETWEEN '" + this.OrderSearch1.CreatOrderStartTime + "' AND '" + this.OrderSearch1.CreateOrderEndTime + "'";
}
if ((this.OrderSearch1.StoreHourseStartTime != Convert.ToString(DateTime.Now.Date)) || (this.OrderSearch1.StoreHourseEndTime != Convert.ToString(DateTime.Now.Date)))
{
strWhere += " AND StorehouseReadyDate BETWEEN '" + this.OrderSearch1.StoreHourseStartTime + "' AND '" + this.OrderSearch1.StoreHourseEndTime+" ' ";
}
if ((this.OrderSearch1.SendStartTime != Convert.ToString(DateTime.Now.Date)) || (this.OrderSearch1.SendEndTime != Convert.ToString(DateTime.Now.Date)))
{
strWhere += " AND TransportDate BETWEEN '" + this.OrderSearch1.SendStartTime + "' AND '" + this.OrderSearch1.SendEndTime +" ' ";
}
if (this.OrderSearch1.OrgID.ToString() != "-1")
{
strWhere += " AND OrgID=" + this.OrderSearch1.OrgID.ToString();
}
}
sqlStr += strWhere;
this.OrderSearch1.SqlStr = sqlStr;
return sqlStr;
}
catch (Exception ex)
{
Response.Write("<script language=\"javascript\">alert(" + ex.Message + ")</script>");
return null;
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
this.GetSurelyOrders();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -