protected void Page_Load(object sender, EventArgs e) { int.TryParse(Page.Request.QueryString["taskId"], out taskId); _flexDir = new DirectoryInfo(HttpContext.Current.Request.MapPath(Globals.ApplicationPath + "/Storage/master/flex/")); ddlShoperTag.SelectedIndexChanged += new EventHandler(ddlShoperTag_SelectedIndexChanged); btnUpdateAddrdss.Click += new EventHandler(btnUpdateAddrdss_Click); btnPrint.Click += new EventHandler(btnPrint_Click); if (!Page.IsPostBack) { TaskPrintInfo taskPrintInfo = SalesHelper.GetTaskPrintInfo(taskId); if (taskPrintInfo.IsPO) { ddlShoperTag.IncludeDistributor = true; } ddlShoperTag.DataBind(); foreach (ShippersInfo info2 in SalesHelper.GetShippers(taskPrintInfo.IsPO)) { if (info2.IsDefault) { ddlShoperTag.SelectedValue = info2.ShipperId; } } LoadShipper(); LoadTemplates(); BindPrintOrders(taskPrintInfo); } }
private void BindPrintOrders(TaskPrintInfo task) { if ((task != null) && (task.TaskId > 0)) { litCreateTime.Text = task.CreateTime.ToString(); litCreator.Text = task.Creator; litTaskId.Text = task.TaskId.ToString(); litPrintedNum.Text = task.HasPrinted.ToString(); litNumber.Text = task.OrdersCount.ToString(); pnlTask.Visible = true; pnlTaskEmpty.Visible = false; isPO = task.IsPO; if (isPO) { pnlPOEmpty.Visible = true; } else { pnlPOEmpty.Visible = false; } } else { pnlTask.Visible = false; pnlTaskEmpty.Visible = true; pnlPOEmpty.Visible = false; } }
private void BindPrintOrders() { TaskPrintInfo taskPrintInfo = SalesHelper.GetTaskPrintInfo(taskId); if ((taskPrintInfo != null) && (taskId > 0)) { int ordersCount = taskPrintInfo.OrdersCount; litCreateTime.Text = taskPrintInfo.CreateTime.ToString(); litCreator.Text = taskPrintInfo.Creator; litTaskId.Text = taskPrintInfo.TaskId.ToString(); litPrintedNum.Text = taskPrintInfo.HasPrinted.ToString(); litNumber.Text = ordersCount.ToString(); grdTaskOrders.DataSource = taskPrintInfo.Orders; grdTaskOrders.DataBind(); pnlTask.Visible = true; pnlTaskEmpty.Visible = false; } else { pnlTask.Visible = false; pnlTaskEmpty.Visible = true; } }