void btnProducePILs_Click(object sender, EventArgs e) { NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); if (this.OrdersList.Count > 0) { #region Pop-up Report dsPIL = facLoadOrder.GetPILData(Entities.Utilities.GetCSV(this.OrdersList)); //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = eReportType.PIL; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dsPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); #endregion } }
private void LoadPILReport() { NameValueCollection reportParams = new NameValueCollection(); string OrderIDs = string.Empty; foreach (GridDataItem gdi in grdLoadOrder.Items) { CheckBox chk = gdi.FindControl("chkPIL") as CheckBox; if (chk.Checked) { OrderIDs += chk.Attributes["OrderID"] + ","; } } DataSet dsPIL = null; Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); dsPIL = facLoadOrder.GetPILData(OrderIDs); //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = eReportType.PIL; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dsPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); //Response.Redirect("../reports/reportviewer.aspx"); }
void btnUpdateDriverInstructions_Click(object sender, EventArgs e) { int instructionId = int.Parse(Request.QueryString["instructionID"]); Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); facLoadOrder.UpdateDriverInstructions(instructionId, txtDriverNotes.Text, this.Page.User.Identity.Name); lblUpdateConfirmation.Visible = true; grdLoadSheet.Rebind(); }
private void LoadPILReport() { NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; string OrderIDs = string.Empty; bool isPalletNetwork = false; foreach (GridDataItem item in grdOrders.SelectedItems) { isPalletNetwork = (bool)item.OwnerTableView.DataKeyValues[item.ItemIndex]["IsPalletNetwork"]; OrderIDs += item.OwnerTableView.DataKeyValues[item.ItemIndex]["OrderID"].ToString(); OrderIDs += ","; } Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); if (OrderIDs.Length > 0) { #region Pop-up Report eReportType reportType = eReportType.PIL; dsPIL = facLoadOrder.GetPILData(OrderIDs.ToString()); DataView dvPIL; if (isPalletNetwork) { reportType = Orchestrator.Globals.Configuration.PalletNetworkLabelID; //Need to duplicate the rows for the Pallteforce labels dsPIL.Tables[0].Merge(dsPIL.Tables[0].Copy(), true); dvPIL = new DataView(dsPIL.Tables[0], string.Empty, "OrderId, PalletCount", DataViewRowState.CurrentRows); } else { dvPIL = new DataView(dsPIL.Tables[0]); } //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = reportType; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dvPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); #endregion } }
void grdLoadOrder_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { if (this.LoadOrder == null) { int instructionId = 0; int.TryParse(Request.QueryString["instructionID"], out instructionId); Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); this.LoadOrder = facLoadOrder.GetLoadOrderForInstruction(instructionId); } this.lblAmendedBy.Text = "The Load Order was last amended by <b>" + this.LoadOrder.Tables[0].Rows[0]["LastUpdateUserID"].ToString() + "</b> at <b>" + ((DateTime)this.LoadOrder.Tables[0].Rows[0]["LastUpdateDateTime"]).ToString("dd/MM/yy HH:mm") + "</b>"; grdLoadOrder.DataSource = this.LoadOrder.Tables[4]; }
void btnCreatePIL_Click(object sender, EventArgs e) { Session[Orchestrator.Globals.Constants.SubbyManifestListFromDate] = dteStartdate.SelectedDate; Session[Orchestrator.Globals.Constants.SubbyManifestListToDate] = dteEndDate.SelectedDate; Session[Orchestrator.Globals.Constants.SubbyManifestDate] = dteManifestDate.SelectedDate; NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); CheckBox chkPIL = null; HiddenField hidOrderIDs = null; // We have to get the OrderIDs for each of the Jobs Selected on this report. string orders = string.Empty; foreach (Telerik.Web.UI.GridDataItem gdi in grdManifests.Items) { chkPIL = gdi.FindControl("chkPIL") as CheckBox; if (chkPIL != null && chkPIL.Checked) { hidOrderIDs = gdi.FindControl("hidOrderIDs") as HiddenField; if (orders.Length > 0) { orders += ","; } orders += hidOrderIDs.Value; } } #region Pop-up Report dsPIL = facLoadOrder.GetPILData(orders); if (dsPIL.Tables[0].Rows.Count > 0) { //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = eReportType.PIL; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dsPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); } #endregion }
void btnCreatePIL_Click(object sender, EventArgs e) { NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); if (OrderID != -1) { #region Pop-up Report eReportType reportType = eReportType.PIL; dsPIL = facLoadOrder.GetPILData(OrderID.ToString()); DataView dvPIL; if ((bool)dsPIL.Tables[0].Rows[0]["IsPalletNetwork"]) { reportType = Globals.Configuration.PalletNetworkLabelID; //Need to duplicate the rows for the Pallteforce labels dsPIL.Tables[0].Merge(dsPIL.Tables[0].Copy(), true); dvPIL = new DataView(dsPIL.Tables[0], string.Empty, "OrderId, PalletCount", DataViewRowState.CurrentRows); } else { dvPIL = new DataView(dsPIL.Tables[0]); } //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = reportType; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dvPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; //string url = this.Request.Url.AbsoluteUri; //if (url.LastIndexOf("&action") > 0) // url = url.Remove(url.LastIndexOf("&action")); //Response.Redirect(url + "&action=pil"); Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');", true); #endregion } }
void btnPIL_Click(object sender, EventArgs e) { NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); if (OrderID > 0) { #region Pop-up Report eReportType reportType = eReportType.PIL; dsPIL = facLoadOrder.GetPILData(OrderID.ToString()); DataView dvPIL; if ((bool)dsPIL.Tables[0].Rows[0]["IsPalletNetwork"]) { reportType = Globals.Configuration.PalletNetworkLabelID;; //Need to duplicate the rows for the Pallteforce labels dsPIL.Tables[0].Merge(dsPIL.Tables[0].Copy(), true); dvPIL = new DataView(dsPIL.Tables[0], string.Empty, "OrderId, PalletCount", DataViewRowState.CurrentRows); } else { dvPIL = new DataView(dsPIL.Tables[0]); } Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = reportType; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dvPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); #endregion } }
protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) { base.RaisePostBackEvent(sourceControl, eventArgument); try { if (sourceControl == grdLoadOrder) { string[] eventArgumentData = eventArgument.Split(','); if (eventArgumentData[0] == "RowMoved") { GridItem movedItem = ((grdLoadOrder.MasterTableView.Controls[0] as Table).Rows[int.Parse(eventArgumentData[1])] as GridItem); GridItem beforeItem = ((grdLoadOrder.MasterTableView.Controls[0] as Table).Rows[int.Parse(eventArgumentData[2])] as GridItem); object key1 = grdLoadOrder.MasterTableView.DataKeyValues[movedItem.ItemIndex]["OrderID"]; object key2 = grdLoadOrder.MasterTableView.DataKeyValues[beforeItem.ItemIndex]["OrderID"]; string currentLoadOrder = this.LoadOrder.Tables[0].Rows[0]["CurrentLoadOrder"].ToString(); currentLoadOrder = currentLoadOrder.Replace(key2.ToString(), "??"); currentLoadOrder = currentLoadOrder.Replace(key1.ToString(), "!!"); currentLoadOrder = currentLoadOrder.Replace("??", key1.ToString()); currentLoadOrder = currentLoadOrder.Replace("!!", key2.ToString()); Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); int instructionId = int.Parse(Request.QueryString["instructionID"]); facLoadOrder.UpdateLoadOrder(instructionId, currentLoadOrder, Page.User.Identity.Name); this.LoadOrder = null; grdLoadOrder.Rebind(); } } } catch (Exception ex) { } }
void grdLoadOrder_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { if (OrderList == null) //Use existing dataset if column sorting. { DateTime startDate = dteStartDeliveryDate.SelectedDate.Value; startDate = startDate.Subtract(startDate.TimeOfDay); DateTime endDate = dteEndDeliveryDate.SelectedDate.Value; endDate = endDate.Subtract(endDate.TimeOfDay); endDate = endDate.Add(new TimeSpan(23, 59, 0)); int businessTypeID = 0; bool parsedOK = int.TryParse(cboBusinessType.SelectedValue, out businessTypeID); if (parsedOK) { Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); OrderList = facLoadOrder.GetLoadOrdersForDateAndBusinessType(startDate, endDate, businessTypeID, cboSearchAgainstDate.Items[0].Selected || cboSearchAgainstDate.Items[2].Selected, cboSearchAgainstDate.Items[1].Selected || cboSearchAgainstDate.Items[2].Selected); grdLoadOrder.DataSource = OrderList; } } }
void btnProducePILs_Click(object sender, EventArgs e) { Facade.IOrder facOrder = new Facade.Order(); NameValueCollection reportParams = new NameValueCollection(); DataSet dsPIL = null; List <int> orderIDs = new List <int>(); List <int> jobIDs = new List <int>(); foreach (GridViewRow row in gvManifest.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked) { HiddenField hidJobId = (HiddenField)row.FindControl("hidJobId"); int jobID = int.Parse(hidJobId.Value); // Check if this is a groupage job or not. List <Entities.Order> orders = facOrder.GetForJobID(jobID); //GetPILData no longer accepts JobIds //if (orders.Count == 0) //{ // if (!jobIDs.Contains(jobID)) // jobIDs.Add(jobID); //} //else //{ foreach (Entities.Order order in orders) { if (!orderIDs.Contains(order.OrderID)) { orderIDs.Add(order.OrderID); } } //} } } } Orchestrator.Facade.ICollectDropLoadOrder facLoadOrder = new Orchestrator.Facade.CollectDrop(); if (orderIDs.Count > 0 || jobIDs.Count > 0) { #region Pop-up Report //dsPIL = facLoadOrder.GetPILData(Entities.Utilities.GetCSV(orderIDs), Entities.Utilities.GetCSV(jobIDs)); dsPIL = facLoadOrder.GetPILData(Entities.Utilities.GetCSV(orderIDs)); //------------------------------------------------------------------------------------- // Load Report Section //------------------------------------------------------------------------------------- Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable] = eReportType.PIL; Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable] = reportParams; Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable] = dsPIL; Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable] = String.Empty; Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table"; // Show the user control Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language=\"javascript\">window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');</script>"); #endregion } }
private void CreatePOD(string fileName) { //if (fileName.StartsWith("\\")) // fileName = fileName.Substring(1); Entities.POD pod = null; Facade.POD facPOD = new Orchestrator.Facade.POD(); //Determine the Delivery job and collect drop for this order. if (this.OrderID > 0) { pod = facPOD.GetForOrderID(OrderID); } if (this.CollectDropID > 0) { pod = facPOD.GetPODForCollectDropID(this.CollectDropID); } // Is there already a POD for this collect drop? if (pod == null) { pod = new Orchestrator.Entities.POD(); // get the details we need for the pod record. Facade.Order facOrder = new Orchestrator.Facade.Order(); Facade.ICollectDrop facCollectDrop = new Orchestrator.Facade.CollectDrop(); Dictionary <string, int> orderDetails = null; if (this.OrderID > 0) { orderDetails = facOrder.GetDeliveryDetails(this.OrderID); } else { orderDetails = facCollectDrop.GetDeliveryDetails(this.CollectDropID); } // Do we default to now (upload date) or do we look at the create date of the s pod.CollectDropId = orderDetails["CollectDropID"]; pod.JobId = orderDetails["JobID"]; pod.OrganisationId = orderDetails["CustomerIdentityID"]; pod.FormTypeId = eFormTypeId.POD; } pod.ScannedDateTime = DateTime.Now; pod.SignatureDate = (DateTime)dteSignatureDate.SelectedDate; pod.TicketNo = txtTicketNo.Text; pod.ScannedFormPDF = fileName; try { if (pod.PODId > 0) { facPOD.Update(pod, Page.User.Identity.Name); } else { facPOD.Create(pod, pod.JobId, pod.OrganisationId, pod.CollectDropId, Page.User.Identity.Name); } this.ClientScript.RegisterStartupScript(this.GetType(), "CloseWindow", "<script type=\"text/javascript\">opener.location.href=opener.location.href; window.close();</script>"); } catch (Exception ex) { lblError.Text = ex.Message; lblError.Visible = true; } }