protected void PopulateMultipleExchangeOrderNo() { List <string> exchangeOrderNos = new List <string>(); for (int i = 0; i < Rh.ExchangeOrderNo.Count; i++) { exchangeOrderNos.Add(Rh.ExchangeOrderNo[i]); } multipleExchangeOrderCell = new TableCell(); singelReturnOrderMultipleExchangeOrderLines = LoadControl(singleReturnOrderMultipleExchangeOrderPath); ((SingleReturnOrderExhangeNos)singelReturnOrderMultipleExchangeOrderLines).ExchangeOrderNos = exchangeOrderNos; ((SingleReturnOrderExhangeNos)singelReturnOrderMultipleExchangeOrderLines).PopulateLines(); multipleExchangeOrderCell.Controls.Add(singelReturnOrderMultipleExchangeOrderLines); multipleExchangeOrderCell.ColumnSpan = 7; multipleExchangeOrderCell.Height = new Unit("100%"); multipleExchangeOrderCell.Width = new Unit("50%"); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(new TableCell()); this.expandMultipleExchange.Cells.Add(multipleExchangeOrderCell); this.expandMultipleExchange.ID = "expandMultipleExchange" + CustID.ToString() + "_" + CountID.ToString(); }
protected void PopulateData() { tc = new TableCell(); tr = new TableRow(); lineRow = new TableRow(); lineCell = new TableCell { Text = "<hr class='SeperatorOrders'/>", Height = new Unit("100%"), ColumnSpan = 6 }; singleReturnOrderDetailTable = LoadControl(singleReturnOrderDetailPath); singleReturnOrderDetailTable.ID = "singleReturnOrderDetailTable_" + HeadCount.ToString(); ((SingleReturnOrderDetail)singleReturnOrderDetailTable).Rh = Header; ((SingleReturnOrderDetail)singleReturnOrderDetailTable).CountID = HeadCount; ((SingleReturnOrderDetail)singleReturnOrderDetailTable).CustID = CustID; ((SingleReturnOrderDetail)singleReturnOrderDetailTable).CustomerCount = CustomerCount; tc.Height = new Unit("100%"); tc.ColumnSpan = 6; tc.Controls.Add(singleReturnOrderDetailTable); tr.Cells.Add(tc); tr.ID = "singleReturnOrderDetail_" + CustID.ToString() + "_" + HeadCount.ToString(); this.tblSingleReturnOrderTableHeader.Rows.Add(tr); this.tblSingleReturnOrderTableHeader.Rows.Add(lineRow); }
protected void CreateButtons() { btnCreateExchange.Text = "Create Exchange"; btnCreateExchange.ID = "btnCreateExchange" + CustID.ToString() + "_" + CountID.ToString(); btnCreateExchange.OnClientClick = "return false;"; btnIssueRefund.Text = "Issue Refund"; btnIssueRefund.ID = "btnIssueRefund" + CustID.ToString() + "_" + CountID.ToString(); btnIssueRefund.OnClientClick = "return false;"; btnPrintRMAInstructions.Text = "Print RMA Instructions"; btnPrintRMAInstructions.ID = "btnPrintRMAInstructions" + CustID.ToString() + "_" + CountID.ToString(); btnPrintRMAInstructions.OnClientClick = "return false;"; btnUpdateRMA.Text = "Update RMA"; btnUpdateRMA.ID = "BtnUpdateRMA" + CustID.ToString() + "_" + CountID.ToString(); btnUpdateRMA.OnClientClick = "return false;"; if (AllowLegacyReturnLabel) { btnLegacyReturnLabel.Text = "Legacy Return Label"; btnLegacyReturnLabel.ID = "btnLegacyReturnLabel" + CustID.ToString() + "_" + CountID.ToString(); btnLegacyReturnLabel.OnClientClick = "return false;"; } btnReturnLabel.Text = "Return Label"; btnReturnLabel.ID = "btnReturnLabel" + CustID.ToString() + "_" + CountID.ToString(); btnReturnLabel.OnClientClick = "return false;"; }
protected void Page_Load(object sender, EventArgs e) { this.thcTotalOrders.Text = SalesHeaderList.Count.ToString(); if (SalesOrderCount == 1) { this.btnExpandOrder.Visible = false; } else { this.btnExpandOrder.Visible = true; this.btnExpandOrder.ID = "btnExpandOrder_" + CustID.ToString(); } if (CustomerCount == 1) { Session["SalesHeaders"] = SalesHeaderList; } else { Session["SalesHeaders"] = null; } LoadData(); }
protected void Page_Load(object sender, EventArgs e) { this.thcTotalReturns.Text = ReturnHeaderList.Count.ToString(); if (ReturnOrdersCount == 1) { this.btnExpandReturn.Visible = false; } else { this.btnExpandReturn.Visible = true; this.btnExpandReturn.ID = "btnExpandReturn_" + CustID.ToString(); } if (CustomerCount == 1) { Session["ReturnHeaders"] = ReturnHeaderList; } else { Session["ReturnHeaders"] = null; } PopulateData(); }
protected void PopulateCommentLines() { commentCell = new TableCell(); singelReturnOrderCommentLines = LoadControl(singleReturnOrderCommentLinesPath); ((SingleReturnOrderComments)singelReturnOrderCommentLines).CommentLines = Rh.ReturnComments; ((SingleReturnOrderComments)singelReturnOrderCommentLines).PopulateData(); commentCell.Controls.Add(singelReturnOrderCommentLines); commentCell.ColumnSpan = 8; commentCell.Height = new Unit("100%"); commentCell.Width = new Unit("50%"); this.expandReturnComments.Cells.Add(commentCell); this.expandReturnComments.ID = "expandReturnComments_" + CustID.ToString() + "_" + CountID.ToString(); }
protected void PopulateReceiptLines() { receiptCell = new TableCell(); singleReturnOrderReceiptLines = LoadControl(singleReturnOrderReceiptLinesPath); ((SingleReturnOrderReceipts)singleReturnOrderReceiptLines).ReceiptHeaders = Rh.ReceiptHeaderObj; ((SingleReturnOrderReceipts)singleReturnOrderReceiptLines).PopulateData(); receiptCell.Controls.Add(singleReturnOrderReceiptLines); receiptCell.ColumnSpan = 8; receiptCell.Height = new Unit("100%"); receiptCell.Width = new Unit("100%"); this.expandReceipts.Cells.Add(receiptCell); this.expandReceipts.ID = "expandReceipts_" + CustID.ToString() + "_" + CountID.ToString(); }
protected void PopulateSerialLines() { trackingCell = new TableCell(); singleSalesOrderTrackingLines = LoadControl(singleSalesOrderTrackingLinesPath); ((SingleSalesOrderTrackingNos)singleSalesOrderTrackingLines).PostedPackage = Sh.PostedPackageObject; ((SingleSalesOrderTrackingNos)singleSalesOrderTrackingLines).PopulateData(); trackingCell.Controls.Add(singleSalesOrderTrackingLines); trackingCell.ColumnSpan = 8; trackingCell.Height = new Unit("100%"); trackingCell.Width = new Unit("100%"); this.expandSerialNos.Cells.Add(trackingCell); this.expandSerialNos.ID = "expandSerialNos_" + CustID.ToString() + "_" + CountID.ToString(); }
protected void PopulateShipmentLines() { shipmentCell = new TableCell(); singleSalesOrderShipmentLines = LoadControl(singleSalesOrderShipmentLinesPath); ((SingleSalesOrderShipments)singleSalesOrderShipmentLines).ShipmentHeaders = Sh.ShipmentHeaderObject; ((SingleSalesOrderShipments)singleSalesOrderShipmentLines).PopulateData(); shipmentCell.Controls.Add(singleSalesOrderShipmentLines); shipmentCell.ColumnSpan = 8; shipmentCell.Height = new Unit("100%"); shipmentCell.Width = new Unit("100%"); this.expandShipments.Cells.Add(shipmentCell); this.expandShipments.ID = "expandShipments_" + CustID.ToString() + "_" + CountID.ToString(); }
protected void PopulateZendeskTicketLines() { zendeskReturnCell = new TableCell(); singelReturnOrderZendeskLines = LoadControl(singleReturnOrderZendeskLinesPath); ((SingleReturnOrderZendeskTickets)singelReturnOrderZendeskLines).ZendeskTickets = Rh.Tickets; ((SingleReturnOrderZendeskTickets)singelReturnOrderZendeskLines).PopulateData(); zendeskReturnCell.Controls.Add(singelReturnOrderZendeskLines); zendeskReturnCell.ColumnSpan = 8; zendeskReturnCell.Height = new Unit("100%"); zendeskReturnCell.Width = new Unit("50%"); this.expandReturnZendeskTickets.Cells.Add(zendeskReturnCell); this.expandReturnZendeskTickets.ID = "expandReturnZendeskTickets_" + CustID.ToString() + "_" + CountID.ToString(); }
protected void CreateButtons() { btnCancelOrder.Text = "Cancel Order"; btnCancelOrder.ID = "btnCancelOrder_" + CustID.ToString() + "_" + CountID.ToString(); btnCancelOrder.OnClientClick = "return false;"; btnPartRequest.Text = "Part Request"; btnPartRequest.ID = "btnPartRequest_" + CustID.ToString() + "_" + CountID.ToString(); btnPartRequest.OnClientClick = "return false;"; btnCreateReturn.Text = "Create Return"; btnCreateReturn.ID = "btnCreateReturn_" + CustID.ToString() + "_" + CountID.ToString(); btnCreateReturn.OnClientClick = "return false;"; btnIssueRefund.Text = "Partial Refund"; btnIssueRefund.ID = "btnIssueRefund_" + CustID.ToString() + "_" + CountID.ToString(); btnIssueRefund.OnClientClick = "return false;"; }
public void Save(Context ctx) { CustomerInfo info = new CustomerInfo(); using (IConnection conn = Sync.GetConnection(ctx)) { IPreparedStatement ps; if (IsNew) { ps = conn.PrepareStatement(@"INSERT INTO rcustomer (cst_cod, cst_desc) VALUES (:cst_cod, :cst_desc); SELECT last_insert_id();"); } else { ps = conn.PrepareStatement(@"UPDATE rcustomer SET cst_cod = :cst_cod, cst_desc = :cst_desc WHERE id = :cst_id"); } ps.Set("cst_id", CustID.ToString()); ps.Set("cst_cod", Code); ps.Set("cst_desc", Name); if (IsNew) { IResultSet set = ps.ExecuteQuery(); if (set.Next()) { CustID = set.GetInt(0); } set.Close(); } else { ps.Execute(); } ps.Close(); conn.Commit(); conn.Release(); } }
protected void PopulateData() { foreach (ReturnHeader returnHeader in ReturnHeaderList) { tr = new TableRow(); tc = new TableCell(); singleReturnOrderHeader = LoadControl(singleReturnOrderHeaderPath); singleReturnOrderHeader.ID = "singleSalesReturnHeader_" + returnCount.ToString(); ((SingleReturnOrderTableHeader)singleReturnOrderHeader).Header = returnHeader; ((SingleReturnOrderTableHeader)singleReturnOrderHeader).HeadCount = returnCount; ((SingleReturnOrderTableHeader)singleReturnOrderHeader).CustID = CustID; ((SingleReturnOrderTableHeader)singleReturnOrderHeader).CustomerCount = CustomerCount; ((SingleReturnOrderTableHeader)singleReturnOrderHeader).ReturnOrdersCount = ReturnOrdersCount; tc.Height = new Unit("100%"); tc.ColumnSpan = 4; tc.Controls.Add(singleReturnOrderHeader); tr.Cells.Add(tc); tr.ID = "salesReturnDetailHeader_" + CustID.ToString() + "_" + returnCount.ToString(); this.tblReturnOrderHeader.Rows.Add(tr); returnCount++; } }
protected void LoadData() { foreach (SalesHeader salesHeader in SalesHeaderList) { tr = new TableRow(); tc = new TableCell(); singleSalesOrderHeader = LoadControl(singleSalesOrderHeaderPath); singleSalesOrderHeader.ID = "singleSalesOrderHeader_" + salesCount.ToString(); ((SingleSalesOrderTableHeader)singleSalesOrderHeader).Header = salesHeader; ((SingleSalesOrderTableHeader)singleSalesOrderHeader).HeadCount = salesCount; ((SingleSalesOrderTableHeader)singleSalesOrderHeader).CustID = CustID; ((SingleSalesOrderTableHeader)singleSalesOrderHeader).CustomerCount = CustomerCount; ((SingleSalesOrderTableHeader)singleSalesOrderHeader).SalesOrderCount = SalesOrderCount; tc.Height = new Unit("100%"); tc.ColumnSpan = 4; tc.Controls.Add(singleSalesOrderHeader); tr.Cells.Add(tc); tr.ID = "salesOrderDetailHeader_" + CustID.ToString() + "_" + salesCount.ToString(); this.tblSalesOrderHeader.Rows.Add(tr); salesCount++; } }
protected void Page_Load(object sender, EventArgs e) { this.thcRMANo.Text = Header.RMANo; SellToCustomers sellToCust = SellToCustomers.Invalid; Enum.TryParse(Header.SellToCustomerNo, out sellToCust); this.thcExternalDocumentNo.Text = SetExternalDocumentNo(sellToCust, Header.ExternalDocumentNo); if (ReturnOrdersCount == 1) { this.ReturnOrderSequence.Text = "Return"; this.btnExpandCurrentReturn.Visible = false; } else { this.btnExpandCurrentReturn.Visible = true; this.ReturnOrderSequence.Text = "Return " + HeadCount.ToString(); this.btnExpandCurrentReturn.ID = "btnExpandCurrentReturn_" + CustID.ToString() + "_" + HeadCount.ToString(); } PopulateData(); }
protected void PopulateDetail() { int totalTrackingNos = 0; string shipmentMethod = string.Empty; this.tcOrderStatus.Text = Sh.OrderStatus; this.tcOrderDate.Text = Sh.OrderDate; this.tcSalesOrderNo.Text = Sh.SalesOrderNo; this.tcChannelName.Text = Sh.ChannelName; this.tcOrderStatus.ToolTip = Sh.OrderStatus; this.tcOrderDate.ToolTip = Sh.OrderDate; this.tcSalesOrderNo.ToolTip = Sh.SalesOrderNo; this.tcChannelName.ToolTip = Sh.ChannelName; TrackingTypeEnum trackType = TrackingTypeEnum.Invalid; this.tcIsExchangeOrder.Text = Sh.IsExchangeOrder ? "Yes" : "No"; this.tcIsPartRequest.Text = Sh.IsPartRequest ? "Yes" : "No"; if (Sh.RMANo != string.Empty) { this.tcRMANoTitle.Visible = true; this.tcRMANo.Visible = true; this.tcRMANo.Text = Sh.RMANo; } else { this.tcRMANo.Visible = false; this.tcRMANoTitle.Visible = false; } if (Sh.QuoteOrderNo != string.Empty) { this.tcOrderNoTitle.Visible = true; this.tcOriginalOrderNo.Visible = true; this.tcOriginalOrderNo.Text = Sh.QuoteOrderNo; } else { this.tcOrderNoTitle.Visible = false; this.tcOriginalOrderNo.Visible = false; } if (Sh.IsPartRequest) { if (Sh.SalesOrderNo.ToUpper().Contains("SQ")) { this.tcOrderStatus.Text = "Pending Approval"; this.lblOrderLabelNo.Text = "Quote No:"; } else { this.tcOrderStatus.Text = "Approved"; this.lblOrderLabelNo.Text = "Sales Order No:"; } } OrderNo = Sh.SalesOrderNo; DocNo = Sh.ExternalDocumentNo; if (Sh.ShipmentHeaderObject.Count > 0) { if (!Sh.ShipmentHeaderObject[0].GeneratedFromSalesHeader) { this.tcShipmentDate.Text = Sh.ShipmentHeaderObject[0].ShippingDate; this.tcShipmentDate.ToolTip = Sh.ShipmentHeaderObject[0].ShippingDate; shipmentMethod = Sh.ShipmentHeaderObject[0].ShippingAgentCode; shipmentMethod += " " + Sh.ShipmentHeaderObject[0].ShippingAgentService; this.tcShipMethod.Text = shipmentMethod; this.tcShipMethod.ToolTip = shipmentMethod; Enum.TryParse(Sh.ShipmentHeaderObject[0].ShippingAgentCode, out trackType); this.tcShipmentsTotal.Text = "<a href='javascript:expandShipments" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Sh.ShipmentHeaderObject.Count.ToString() + "</a>"; this.tcShipmentsTotal.ID = "tcShipmentsTotal_" + CustID.ToString() + "_" + CountID.ToString(); PopulateShipmentLines(); } else { this.tcShipmentsTotal.Text = "<a href='javascript:expandShipments" + CustID.ToString() + "" + CountID.ToString() + "()'>0</a>"; this.tcShipmentsTotal.ID = "tcShipmentsTotal_" + CustID.ToString() + "_" + CountID.ToString(); this.tcShipmentDate.Text = string.Empty; this.tcShipmentDate.ToolTip = string.Empty; this.tcShipMethod.Text = string.Empty; this.tcShipMethod.ToolTip = string.Empty; } } else { this.tcShipmentDate.Text = string.Empty; this.tcShipmentDate.ToolTip = string.Empty; this.tcShipMethod.Text = string.Empty; this.tcShipMethod.ToolTip = string.Empty; } if (Sh.PostedPackageObject.Count > 0) { totalTrackingNos = Sh.PostedPackageObject.Count; PopulatePackageLines(); if (totalTrackingNos != 1) { PopulateSerialLines(); this.tcTrackingNo.Text = "<a href='javascript:expandSerialNos" + CustID.ToString() + "" + CountID.ToString() + "()'>" + "Multiple</a>"; } else { string trackNo = Sh.PostedPackageObject[0].TrackingNo; this.tcTrackingNo.Text = SetTrackingNo(trackType, trackNo); this.tcTrackingNo.ToolTip = trackNo; } } this.tcPackagesCount.Text = "<a href='javascript:expandPackages" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Sh.PostedPackageObject.Count.ToString() + "</a>"; this.tcPackagesCount.ID = "tcPackagesTotal" + CustID.ToString() + "_" + CountID.ToString(); if (Sh.WarrantyProp != null) { this.tcStatus.Text = Sh.WarrantyProp.Status; if (Sh.WarrantyProp.Status.ToUpper() == "OPEN") { this.tcStatus.Attributes.Add("bgcolor", "LawnGreen"); } else if (Sh.WarrantyProp.Status.ToUpper() == "CLOSED") { this.tcStatus.Attributes.Add("bgcolor", "Crimson"); } else { this.tcStatus.Attributes.Add("bgcolor", "White"); } this.tcPolicy.Text = Sh.WarrantyProp.Policy; this.tcDaysRemaining.Text = Sh.WarrantyProp.DaysRemaining.ToString(); this.tcWarrantyType.Text = Sh.WarrantyProp.WarrantyType; if (Sh.WarrantyProp.IsPDA == "YES") { this.tcPDAStamp.Text = "PDA Replacement Warranty Program"; this.tcPDAStamp.BackColor = Color.LawnGreen; this.tcPDAStamp.HorizontalAlign = HorizontalAlign.Center; this.tcPDAStamp.Font.Bold = true; } else { this.tcPDAStamp.Text = string.Empty; this.tcPDAStamp.BackColor = Color.White; } } this.imgOrderComments.ID = "imgOrderComments_" + CustID.ToString() + "_" + CountID.ToString(); lblOrderComment.ID = "lblOrderComment_" + CustID.ToString() + "_" + CountID.ToString(); if (Sh.OrderComments.Count > 0) { lblOrderComment.Visible = true; imgOrderComments.Visible = true; PopulateCommentLines(); imgOrderComments.OnClientClick = "return expandOrderComments" + CustID.ToString() + CountID.ToString() + "()"; } else { lblOrderComment.Visible = false; imgOrderComments.Visible = false; } tcZendeskTickets.Text = Sh.Tickets.Count > 0 ? "<a href='javascript:expandSalesOrderZendeskTickets" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Sh.Tickets.Count.ToString() + "</a>" : Sh.Tickets.Count.ToString(); if (Sh.Tickets.Count > 0) { PopulateZendeskTicketLines(); } }
protected void PopulateLines() { double total = 0; TableRow totalRow = new TableRow(); TableCell totalString = new TableCell(); TableCell totalCell = new TableCell(); int lineCount = 0; foreach (ShipmentHeader header in Sh.ShipmentHeaderObject) { foreach (ShipmentLine line in header.ShipmentLines) { if (line.Quantity > 0) { lineCount++; TableRow singleRow = new TableRow(); string itemNoS = string.Empty; string firstSerialNo = string.Empty; int packageSerialCount = 0; List <string> moreLines = new List <string>(); TableCell itemNo = new TableCell(); TableCell desc = new TableCell(); TableCell crossRefNo = new TableCell(); TableCell qty = new TableCell(); TableCell qtyShipped = new TableCell(); TableCell price = new TableCell(); TableCell lineAmount = new TableCell(); TableCell serialNo = new TableCell(); TableCell moreSerial = new TableCell(); itemNoS = line.ItemNo; itemNo.Text = line.ItemNo; itemNo.ToolTip = line.ItemNo; desc.Text = line.Description; desc.ToolTip = line.Description; crossRefNo.Text = line.CrossRefNo; crossRefNo.ToolTip = line.CrossRefNo; qty.Text = line.Quantity.ToString(); qtyShipped.Text = line.QuantityShipped.ToString(); total += line.LineAmount; price.Text = "$ " + line.Price.ToGBString(); lineAmount.Text = "$ " + line.LineAmount.ToGBString(); qty.HorizontalAlign = HorizontalAlign.Center; qtyShipped.HorizontalAlign = HorizontalAlign.Center; price.HorizontalAlign = HorizontalAlign.Right; lineAmount.HorizontalAlign = HorizontalAlign.Right; foreach (PostedPackage package in Sh.PostedPackageObject) { foreach (PostedPackageLine packageLine in package.PostedPackageLines) { if (packageLine.ItemNo == itemNoS && package.PostedSourceID == header.No) { packageSerialCount++; if (packageSerialCount == 1) { firstSerialNo = packageLine.SerialNo; } else { moreLines.Add(packageLine.SerialNo); } } } } serialNo.Text = firstSerialNo; serialNo.ToolTip = firstSerialNo; serialNo.HorizontalAlign = HorizontalAlign.Center; singleRow.ID = "salesInfoLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); if (packageSerialCount > 1) { moreSerial.Text = "<a id='expandMoreClickOrderLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString() + "' href ='javascript:expandMoreOrderLines" + CustID.ToString() + CountID.ToString() + "(" + lineCount + ")'>Show More</a>"; moreSerial.ID = "expandShowMoreOrderLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); } singleRow.Cells.Add(itemNo); singleRow.Cells.Add(desc); singleRow.Cells.Add(crossRefNo); singleRow.Cells.Add(qty); singleRow.Cells.Add(qtyShipped); singleRow.Cells.Add(price); singleRow.Cells.Add(lineAmount); singleRow.Cells.Add(serialNo); singleRow.Cells.Add(moreSerial); if (lineCount % 2 == 0) { singleRow.BackColor = Color.White; } else { singleRow.BackColor = ColorTranslator.FromHtml("#EFF3FB"); } singleRow.Attributes.CssStyle.Add("border-collapse", "collapse"); this.tblOrderDetailLines.Rows.Add(singleRow); int moreLineCount = 0; foreach (string serial in moreLines) { moreLineCount++; TableCell moreSerialNo = new TableCell { Text = serial, HorizontalAlign = HorizontalAlign.Center, ToolTip = serial }; TableRow moreTableRow = new TableRow(); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(moreSerialNo); moreTableRow.Cells.Add(new TableCell()); if (lineCount % 2 == 0) { moreTableRow.BackColor = Color.White; } else { moreTableRow.BackColor = ColorTranslator.FromHtml("#EFF3FB"); } moreTableRow.Attributes.CssStyle.Add("border-collapse", "collapse"); moreTableRow.ID = "showMoreOrderLines_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString() + "_" + moreLineCount.ToString(); this.tblOrderDetailLines.Rows.Add(moreTableRow); } if (moreLines.Count > 0) { TableRow blankRow = new TableRow(); TableCell blankCell = new TableCell { Text = "<br />" }; blankRow.Cells.Add(blankCell); blankRow.ID = "showMoreOrderLines_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); this.tblOrderDetailLines.Rows.Add(blankRow); } } } } totalString.Text = "Total:"; totalString.Font.Bold = true; totalCell.Text = "$ " + total.ToGBString(); totalCell.Font.Bold = true; totalString.HorizontalAlign = HorizontalAlign.Right; totalCell.HorizontalAlign = HorizontalAlign.Right; totalString.Attributes.CssStyle.Add("border-top", "2px solid black"); totalString.Attributes.CssStyle.Add("border-collapse", "collapse"); totalCell.Attributes.CssStyle.Add("border-top", "2px solid black"); totalCell.Attributes.CssStyle.Add("border-collapse", "collapse"); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(totalString); totalRow.Cells.Add(totalCell); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); this.tblOrderDetailLines.Rows.Add(totalRow); TableCell breakCell = new TableCell(); TableRow breakRow = new TableRow(); breakCell.Text = "<br/>"; breakRow.Cells.Add(breakCell); this.tblOrderDetailLines.Rows.Add(breakRow); if (CustomerCount == 1) { cancelOrderCell.Controls.Add(btnCancelOrder); partRequestCell.Controls.Add(btnPartRequest); createReturnCell.Controls.Add(btnCreateReturn); issueRefundcell.Controls.Add(btnIssueRefund); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(cancelOrderCell); buttonRow.Cells.Add(partRequestCell); buttonRow.Cells.Add(createReturnCell); buttonRow.Cells.Add(issueRefundcell); this.tblOrderDetailLines.Rows.Add(buttonRow); } }
protected void LoadData() { this.tcReturnStatus.Text = Rh.ReturnStatus; this.tcDateCreated.Text = Rh.DateCreated; this.tcChannelName.Text = Rh.ChannelName; this.tcOrderDate.Text = Rh.OrderDate; this.tcEmail.Text = Rh.Email; this.tcIMEINo.Text = Rh.IMEINo; this.tcReturnStatus.ToolTip = Rh.ReturnStatus; this.tcDateCreated.ToolTip = Rh.DateCreated; this.tcChannelName.ToolTip = Rh.ChannelName; this.tcOrderDate.ToolTip = Rh.OrderDate; this.tcEmail.ToolTip = Rh.Email; this.tcIMEINo.ToolTip = Rh.IMEINo; this.tcUPSReturnLabelCreated.Text = Rh.ReturnLabelCreated == true ? "Yes" : "No"; int exchangeCounter = 0; int totalCounter = 0; foreach (ReceiptHeader head in Rh.ReceiptHeaderObj) { foreach (ReceiptLine line in head.ReceiptLines) { totalCounter += line.QuantityReceived; exchangeCounter += line.QuantityExchanged; totalCounter -= line.QuantityRefunded; } } if (exchangeCounter == totalCounter && exchangeCounter != 0) { this.tcExchangeStatus.Text = "Completed"; } else if (exchangeCounter == 0) { this.tcExchangeStatus.Text = "No"; } else { this.tcExchangeStatus.Text = "Partial Exchanged"; } TrackingTypeEnum trackType = TrackingTypeEnum.Invalid; RMANo = Rh.RMANo; DocNo = Rh.ExternalDocumentNo; if (Rh.PostedReceiveObj.Count > 0) { PopulateReceiveLines(); } this.tcPackagesCount.Text = "<a href='javascript:expandReceives" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Rh.PostedReceiveObj.Count.ToString() + "</a>"; if (Rh.ReceiptHeaderObj.Count > 0) { if (!Rh.ReceiptHeaderObj[0].PopulatedFromShipmentHeader) { Enum.TryParse(Rh.ReceiptHeaderObj[0].ShippingAgentCode, out trackType); this.tcReceiptDate.Text = Rh.ReceiptHeaderObj[0].ReceiptDate; this.tcReceiptDate.ToolTip = Rh.ReceiptHeaderObj[0].ReceiptDate; this.tcReceiptsTotal.Text = "<a href='javascript:expandReceipts" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Rh.ReceiptHeaderObj.Count.ToString() + "</a>"; PopulateReceiptLines(); } else { this.tcReceiptsTotal.Text = "<a href='javascript:expandReceipts" + CustID.ToString() + "" + CountID.ToString() + "()'>0</a>"; } } string trackNo = Rh.ReturnTrackingNo; this.tcReturnTrackingNo.Text = SetTrackingNo(trackType, trackNo); this.tcReturnTrackingNo.ToolTip = trackNo; if (Rh.ExchangeCreated) { if (Rh.ExchangeOrderNo.Count > 1) { this.tcExchangeOrderNo.Text = "<a href='javascript:expandMultipleExchange" + CustID.ToString() + "" + CountID.ToString() + "()'>Multiple</a>"; PopulateMultipleExchangeOrderNo(); } else { this.tcExchangeOrderNo.Text = Rh.ExchangeOrderNo[0]; } } this.imgReturnComments.ID = "imgReturnComments_" + CustID.ToString() + "_" + CountID.ToString(); lblReturnComment.ID = "lblReturnComment_" + CustID.ToString() + "_" + CountID.ToString(); if (Rh.ReturnComments.Count > 0) { lblReturnComment.Visible = true; imgReturnComments.Visible = true; PopulateCommentLines(); imgReturnComments.OnClientClick = "return expandReturnComments" + CustID.ToString() + CountID.ToString() + "()"; } else { lblReturnComment.Visible = false; imgReturnComments.Visible = false; } tcZendeskTickets.Text = Rh.Tickets.Count > 0 ? "<a href='javascript:expandReturnZendeskTickets" + CustID.ToString() + "" + CountID.ToString() + "()'>" + Rh.Tickets.Count.ToString() + "</a>" : Rh.Tickets.Count.ToString(); PopulateZendeskTicketLines(); }
protected void PopulateLines() { double total = 0; TableRow totalRow = new TableRow(); TableCell totalString = new TableCell(); TableCell totalCell = new TableCell(); List <ReturnReason> rrList = (List <ReturnReason>)Session["ReturnReasons"]; int lineCount = 0; foreach (ReceiptHeader header in Rh.ReceiptHeaderObj) { foreach (ReceiptLine line in header.ReceiptLines) { if (line.Quantity > 0) { lineCount++; TableRow lineRow = new TableRow(); string itemNoS = string.Empty; string firstSerialNo = string.Empty; int receiveSerialCount = 0; List <string> moreLines = new List <string>(); TableCell itemNo = new TableCell(); TableCell desc = new TableCell(); TableCell crossRefNo = new TableCell(); TableCell qty = new TableCell(); TableCell qtyReceived = new TableCell(); TableCell qtyExchanged = new TableCell(); TableCell qtyRefunded = new TableCell(); TableCell price = new TableCell(); TableCell lineAmount = new TableCell(); TableCell serialNo = new TableCell(); TableCell returnReason = new TableCell(); TableCell reqReturnAction = new TableCell(); TableCell moreSerial = new TableCell(); itemNoS = line.ItemNo; itemNo.Text = line.ItemNo; itemNo.ToolTip = line.ItemNo; desc.Text = line.Description; desc.ToolTip = line.Description; crossRefNo.Text = line.CrossRefNo; crossRefNo.ToolTip = line.CrossRefNo; qty.Text = line.Quantity.ToString(); qtyReceived.Text = line.QuantityReceived.ToString(); qtyExchanged.Text = line.QuantityExchanged.ToString(); qtyRefunded.Text = line.QuantityRefunded.ToString(); total += line.LineAmount; price.Text = "$ " + line.Price.ToGBString(); lineAmount.Text = "$ " + line.LineAmount.ToGBString(); foreach (ReturnReason rr in rrList) { if (line.ReturnReasonCode == rr.ReasonCode) { returnReason.Text = rr.Display; } } reqReturnAction.Text = line.REQReturnAction; qty.HorizontalAlign = HorizontalAlign.Center; qtyReceived.HorizontalAlign = HorizontalAlign.Center; qtyExchanged.HorizontalAlign = HorizontalAlign.Center; qtyRefunded.HorizontalAlign = HorizontalAlign.Center; price.HorizontalAlign = HorizontalAlign.Right; lineAmount.HorizontalAlign = HorizontalAlign.Right; foreach (PostedReceive receive in Rh.PostedReceiveObj) { foreach (PostedReceiveLine receiveLine in receive.PostedReceiveLines) { if (receiveLine.ItemNo == itemNoS && receive.PostedSourceID == header.No) { receiveSerialCount++; if (receiveSerialCount == 1) { firstSerialNo = receiveLine.SerialNo; } else { moreLines.Add(receiveLine.SerialNo); } } } } serialNo.Text = firstSerialNo; serialNo.ToolTip = firstSerialNo; serialNo.HorizontalAlign = HorizontalAlign.Center; lineRow.ID = "returnInfoLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); if (receiveSerialCount > 1) { moreSerial.Text = "<a id='expandMoreClickReturnLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString() + "' href ='javascript:expandMoreReturnLines" + CustID.ToString() + CountID.ToString() + "(" + lineCount + ")'>Show More</a>"; moreSerial.ID = "expandShowMoreReturnLine_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); } lineRow.Cells.Add(itemNo); lineRow.Cells.Add(desc); lineRow.Cells.Add(crossRefNo); lineRow.Cells.Add(qty); lineRow.Cells.Add(qtyReceived); lineRow.Cells.Add(qtyExchanged); lineRow.Cells.Add(qtyRefunded); lineRow.Cells.Add(price); lineRow.Cells.Add(lineAmount); lineRow.Cells.Add(returnReason); lineRow.Cells.Add(reqReturnAction); lineRow.Cells.Add(serialNo); lineRow.Cells.Add(moreSerial); if (lineCount % 2 == 0) { lineRow.BackColor = Color.White; } else { lineRow.BackColor = ColorTranslator.FromHtml("#EFF3FB"); } lineRow.Attributes.CssStyle.Add("border-collapse", "collapse"); this.tblReturnDetailLines.Rows.Add(lineRow); int moreLineCount = 0; foreach (string serial in moreLines) { moreLineCount++; TableCell moreSerialNo = new TableCell { Text = serial, HorizontalAlign = HorizontalAlign.Center, ToolTip = serial }; TableRow moreTableRow = new TableRow(); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(new TableCell()); moreTableRow.Cells.Add(moreSerialNo); moreTableRow.Cells.Add(new TableCell()); if (lineCount % 2 == 0) { moreTableRow.BackColor = Color.White; } else { moreTableRow.BackColor = ColorTranslator.FromHtml("#EFF3FB"); } moreTableRow.Attributes.CssStyle.Add("border-collapse", "collapse"); moreTableRow.ID = "showMoreReturnLines_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString(); this.tblReturnDetailLines.Rows.Add(moreTableRow); } if (moreLines.Count > 0) { TableRow blankRow = new TableRow(); TableCell blankCell = new TableCell { Text = "<br />" }; blankRow.Cells.Add(blankCell); blankRow.ID = "showMoreReturnLines_" + CustID.ToString() + "_" + CountID.ToString() + "_" + lineCount.ToString() + "_" + moreLineCount.ToString(); this.tblReturnDetailLines.Rows.Add(blankRow); } } } } totalString.Text = "Total:"; totalString.Font.Bold = true; totalCell.Text = "$ " + total.ToGBString(); totalCell.Font.Bold = true; totalString.HorizontalAlign = HorizontalAlign.Right; totalCell.HorizontalAlign = HorizontalAlign.Right; totalString.Attributes.CssStyle.Add("border-top", "2px solid black"); totalString.Attributes.CssStyle.Add("border-collapse", "collapse"); totalCell.Attributes.CssStyle.Add("border-top", "2px solid black"); totalCell.Attributes.CssStyle.Add("border-collapse", "collapse"); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(totalString); totalRow.Cells.Add(totalCell); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); this.tblReturnDetailLines.Rows.Add(totalRow); TableCell breakCell = new TableCell(); TableRow breakRow = new TableRow(); breakCell.Text = "<br/>"; breakRow.Cells.Add(breakCell); this.tblReturnDetailLines.Rows.Add(breakRow); if (CustomerCount == 1) { createExchangeCell.Controls.Add(btnCreateExchange); issueRefundCell.Controls.Add(btnIssueRefund); updateRMA.Controls.Add(btnUpdateRMA); printRMAInstructions.Controls.Add(btnPrintRMAInstructions); if (AllowLegacyReturnLabel) { legacyReturnLabel.Controls.Add(btnLegacyReturnLabel); } issueReturnLabel.Controls.Add(btnReturnLabel); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); buttonRow.Cells.Add(new TableCell()); if (!AllowLegacyReturnLabel) { buttonRow.Cells.Add(new TableCell()); } buttonRow.Cells.Add(createExchangeCell); buttonRow.Cells.Add(issueRefundCell); if (AllowLegacyReturnLabel) { buttonRow.Cells.Add(legacyReturnLabel); } buttonRow.Cells.Add(issueReturnLabel); buttonRow.Cells.Add(printRMAInstructions); this.tblReturnDetailLines.Rows.Add(buttonRow); } }
public ActionResult Index(int SelectedCustId = -1, int SelectedContractId = -1) { string auth = GetCookie("Auth"); AbzHash abzHash = hashRepo.GetHash(auth); string usr = abzHash.Email; if ((SelectedCustId > 0) && ((int)abzHash.CustID != SelectedCustId)) { abzHash.CustID = SelectedCustId; contract = repo.GetContract((int)abzHash.CustID); if (contract == null) { ContractID = 0; } else { ContractID = contract.ContractID; } abzHash.ContractID = ContractID; hashRepo.UpdateHash(abzHash); } else { if ((SelectedContractId > 0) && ((int)abzHash.ContractID != SelectedContractId)) { abzHash.ContractID = SelectedContractId; hashRepo.UpdateHash(abzHash); } } contract = repo.GetContract((int)abzHash.CustID); if (contract == null) { ContractID = 0; } else { ContractID = contract.ContractID; } Cust cust = db.Custs.Find((int)abzHash.CustID); contracts = repo.GetContracts((int)abzHash.CustID); ViewData["Contract"] = new SelectList(contracts, "ContractID", "Num", ContractID); IEnumerable <OrgView> orgView = repo.GetCust(usr); ViewData["Cust"] = new SelectList(orgView, "ID", "Txt", abzHash.CustID); ViewBag.MenuItem = "recv"; ViewBag.User = usr; BalanceRepository bl = new BalanceRepository(); ViewBag.customer = cust.SmalName; ViewBag.balance = bl.GetBalance(CustID, (int)abzHash.ContractID).ToString(); ViewBag.contractn = ""; Contract contractcc = db.Contracts.Find((int)abzHash.ContractID); if (contractcc != null) { ViewBag.contractn = "Договор № " + contractcc.Num; } SetCookie("custid", CustID.ToString()); SetCookie("contractid", abzHash.ContractID.ToString()); SetCookie("customer", ViewBag.customer); SetCookie("balance", ViewBag.balance); SetCookie("contract", ViewBag.contractn); return(View("Index", cust)); }