private void DataBindList() { txtMAWB.Focus(true); List <IFields> Getlist = new List <IFields>(); Getlist.Add(dal.CreateIFields().Append("Option", "GetAEMakeConsol") .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text) .Append("str", hidIDList.Text) .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12]) .Append("air_SYS", sys) ); DataSet ds = GetDs("FW_AirExport_ViewConsol_SP", Getlist); if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != null && hidSeed.Text != "") { labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString(); hidLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString(); txtMAWB.Text = ds.Tables[0].Rows[0]["MAWB"].ToString(); //CmbDeparture.setValue(ds.Tables[0].Rows[0]["Departure"].ToString()); //CmbFinalDest.setValue(ds.Tables[0].Rows[0]["Destination"].ToString()); CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString()); CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString()); CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString(); CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString()); CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString(); CmbColoader.setValue(ds.Tables[0].Rows[0]["CoLoader"].ToString()); CmbColoader.Text = ds.Tables[0].Rows[0]["CoLoaderName"].ToString(); CmbCarrierRight.setValue(ds.Tables[0].Rows[0]["Carrier"].ToString()); txtFlightRight.Text = ds.Tables[0].Rows[0]["FlightNo"].ToString(); CmbFromRight.setValue(ds.Tables[0].Rows[0]["From"].ToString()); CmbToRight.setValue(ds.Tables[0].Rows[0]["To"].ToString()); txtETD.Text = ds.Tables[0].Rows[0]["ETD"].ToString(); txtETA.Text = ds.Tables[0].Rows[0]["ETA"].ToString(); txtATD.Text = ds.Tables[0].Rows[0]["ATD"].ToString(); txtATA.Text = ds.Tables[0].Rows[0]["ATA"].ToString(); txtRemark.Text = ds.Tables[0].Rows[0]["Remark"].ToString(); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString())) { txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString())) { txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString())) { txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString())) { txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString())) { txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Rate"].ToString())) { txtRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString(); } bool ismakeMawb = ds.Tables[0].Rows[0]["air_MakeMAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeMAWB"]); string flag = "N"; if (ismakeMawb) { flag = "Y"; } X.AddScript("isMawbFlag='" + flag + "';"); //if (ismakeMawb == true) //{ // txtGWT.Disabled = true; // txtVWT.Disabled = true; // txtCWT.Disabled = true; // txtPiece.Disabled = true; // isMawbFlag.Style.Add("display", "none"); //} //else //{ // txtGWT.Disabled = false; // txtVWT.Disabled = false; // txtCWT.Disabled = false; // txtPiece.Disabled = false; // isMawbFlag.Style.Add("display", "block"); //} if (ds.Tables[1].Rows.Count > 0) { GridFlightList.GetStore().DataSource = ds.Tables[1]; GridFlightList.GetStore().DataBind(); } if (ds.Tables[2].Rows.Count > 0) { gpHAWB.GetStore().DataSource = ds.Tables[2]; gpHAWB.GetStore().DataBind(); double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0; for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { if (ds.Tables[2].Rows[i]["IsSub"].ToString() == "0") { GWT += Convert.ToDouble(ds.Tables[2].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["GWT"].ToString()); VWT += Convert.ToDouble(ds.Tables[2].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["VWT"].ToString()); CWT += Convert.ToDouble(ds.Tables[2].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["CWT"].ToString()); Pieces += Convert.ToDouble(ds.Tables[2].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Piece"].ToString()); Pallets += Convert.ToDouble(ds.Tables[2].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Pallet"].ToString()); } } lblGWT.Text = GWT.ToString("0.000"); lblVWT.Text = VWT.ToString("0.000"); lblCWT.Text = CWT.ToString("0.000"); lblPiece.Text = Pieces.ToString(); lblPallet.Text = Pallets.ToString(); } if (ds.Tables[3].Rows.Count > 0) { gpInvoice.GetStore().DataSource = ds.Tables[3]; gpInvoice.GetStore().DataBind(); } if (ControlBinder.IsDisplayLotNo(txtETD.Text.Trim(), hidLotNo.Text)) { btnUpdateLotNo.Show(); } else { btnUpdateLotNo.Hide(); } if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y") { img_void.Style.Value = "display:none"; } else { img_void.Style.Value = "display:inline"; btnSave.Disabled = true; btnCancel.Disabled = true; btnPull.Disabled = true; btnNew.Disabled = true; btnVoid.Text = "Active"; hidVoid.Text = "1"; btnUpdateLotNo.Hide(); } ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p>Status : Edit No. of <span>" + hidLotNo.Text + "</span></p>", div_bottom); } else { if (ds.Tables[2].Rows.Count > 0) { gpHAWB.GetStore().DataSource = ds.Tables[2]; gpHAWB.GetStore().DataBind(); double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0; for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { if (ds.Tables[2].Rows[i]["IsSub"].ToString() == "0") { GWT += Convert.ToDouble(ds.Tables[2].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["GWT"].ToString()); VWT += Convert.ToDouble(ds.Tables[2].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["VWT"].ToString()); CWT += Convert.ToDouble(ds.Tables[2].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["CWT"].ToString()); Pieces += Convert.ToDouble(ds.Tables[2].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Piece"].ToString()); Pallets += Convert.ToDouble(ds.Tables[2].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Pallet"].ToString()); } } lblGWT.Text = GWT.ToString("0.000"); lblVWT.Text = VWT.ToString("0.000"); lblCWT.Text = CWT.ToString("0.000"); lblPiece.Text = Pieces.ToString(); lblPallet.Text = Pallets.ToString(); } ControlBinder.pageTitleMsg(false, showname, "<p>Status : New Blank No. </p>", div_bottom); } }
private void DataBindList() { txtMAWB.Focus(true); List <IFields> Getlist = new List <IFields>(); Getlist.Add(dal.CreateIFields().Append("Option", "GetAEColoaderDirect") .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text) .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12]) .Append("air_SYS", sys) ); DataSet ds = GetDs("FW_AirExport_CoLoaderDirect_SP", Getlist); if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != "0" && hidSeed.Text != "") { labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString(); hidLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString(); txtMAWB.Text = ds.Tables[0].Rows[0]["MAWB"].ToString(); //CmbDeparture.setValue(ds.Tables[0].Rows[0]["Departure"].ToString()); //CmbFinalDest.setValue(ds.Tables[0].Rows[0]["Destination"].ToString()); CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString()); CmbColoader.setValue(ds.Tables[0].Rows[0]["CoLoader"].ToString()); CmbColoader.Text = ds.Tables[0].Rows[0]["CoLoaderName"].ToString(); CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString()); CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString(); CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString()); CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString(); CmbNP.SelectedItem.Value = ds.Tables[0].Rows[0]["NP"].ToString(); CmbCarrierRight.setValue(ds.Tables[0].Rows[0]["Carrier"].ToString()); txtFlightRight.Text = ds.Tables[0].Rows[0]["FlightNo"].ToString(); CmbFromRight.setValue(ds.Tables[0].Rows[0]["From"].ToString()); CmbToRight.setValue(ds.Tables[0].Rows[0]["To"].ToString()); txtETD.Text = ds.Tables[0].Rows[0]["ETD"].ToString(); txtETA.Text = ds.Tables[0].Rows[0]["ETA"].ToString(); txtATD.Text = ds.Tables[0].Rows[0]["ATD"].ToString(); txtATA.Text = ds.Tables[0].Rows[0]["ATA"].ToString(); txtMAWBRemark.Text = ds.Tables[0].Rows[0]["air_Remark"].ToString(); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString())) { txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString())) { txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString())) { txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString())) { txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString())) { txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString(); } if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Rate"].ToString())) { txtRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString(); } bool ismakeMawb = ds.Tables[0].Rows[0]["air_MakeMAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeMAWB"]); if (ismakeMawb == true) { txtGWT.Disabled = true; txtVWT.Disabled = true; txtCWT.Disabled = true; txtPiece.Disabled = true; isMawbFlag.Style.Add("display", "none"); } else { txtGWT.Disabled = false; txtVWT.Disabled = false; txtCWT.Disabled = false; txtPiece.Disabled = false; isMawbFlag.Style.Add("display", "block"); } if (ds.Tables[1].Rows.Count > 0) { GridFlightList.GetStore().DataSource = ds.Tables[1]; GridFlightList.GetStore().DataBind(); } if (ds.Tables[2].Rows.Count > 0) { gpInvoice.GetStore().DataSource = ds.Tables[2]; gpInvoice.GetStore().DataBind(); } if (ControlBinder.IsDisplayLotNo(txtETD.Text.Trim(), hidLotNo.Text)) { btnUpdateLotNo.Show(); } else { btnUpdateLotNo.Hide(); } if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y") { img_void.Style.Value = "display:none"; } else { img_void.Style.Value = "display:inline"; btnSave.Disabled = true; btnCancel.Disabled = true; btnNext.Disabled = true; btnVoid.Text = "Active"; hidVoid.Text = "1"; btnUpdateLotNo.Hide(); } ControlBinder.pageTitleMsg(false, "AE-M:" + hidLotNo.Text, "<p>Status : Edit MAWB of <span>" + hidLotNo.Text + "</span></p>", div_bottom); } else { ControlBinder.pageTitleMsg(false, "AE-M New", "<p>Status : New Blank MAWB </p>", div_bottom); } }