protected void btnSubmit_Click(object sender, EventArgs e) { Alert alert = new Alert(); try { if (Session["BASTFileName"] != null && Session["BASTFileBytes"] != null) { UnloadingModel.UnloadingDetail item = new UnloadingModel.UnloadingDetail(); item.LO_ID = Convert.ToInt64(hf["LO_ID"]); item.UnloadingDate = deUnloading.Date == DateTime.MinValue ? Convert.ToDateTime("1/1/1900") : deUnloading.Date; item.MeasurementMethods = txtMetodePengukuran.Text; item.EIJKBautHeight = Convert.ToInt64(seTinggiEijkBoot.Value ?? 0); item.EIJKBautActual = Convert.ToInt64(seAktualEijkBoot.Value ?? 0); item.SensitivityVolume = Convert.ToInt64(seVolumeKepekaan.Value ?? 0); item.ReceiptVolume = Convert.ToInt64(seVolumePenerimaan.Value ?? 0); item.UnloadingNote = txtUnloadingNote.Text; item.BASTNumber = txtNoBAST.Text; item.CreationBy = UserProfile.Username; item.BASTFileName = Convert.ToString(Session["BASTFileName"]); item.BASTFileBytes = (byte[])Session["BASTFileBytes"]; Session["BASTFileName"] = null; Session["BASTFileBytes"] = null; string res = UnloadingEntity.SubmitUnloading(item); if (res.ToLower().Contains("success")) { alert.MessageString("success", res, Page, GetType()); } else { alert.MessageString("error", res, Page, GetType()); } ASPxEdit.ClearEditorsInContainer(Page, true); cpUnloadingDetail.ClientVisible = false; cpUnloadingList.ClientVisible = true; LoadInitUnloadingList(); } else { alert.MessageString("warning", "Upload BAST is required.", Page, GetType()); } } catch (Exception ex) { alert.MessageString("error", ex.Message, Page, GetType()); } }
protected void cpUnloadingDetail_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) { string[] param = e.Parameter.Split('|'); Int64 itemID = Convert.ToInt64(param[0]); string itemDesc = param[1]; string tbbmName = param[2]; string spshName = param[3]; Int64 quantityVolume = Convert.ToInt64(param[4]); Int64 lo_ID = Convert.ToInt64(param[5]); lblItemDesc.Text = itemDesc; lblTBBMName.Text = tbbmName; lblSPSHName.Text = spshName; hf["LO_ID"] = lo_ID; txtVolumePengiriman.Text = quantityVolume.ToString(); seVolumePenerimaan.Value = quantityVolume; txtLosses.Text = "0"; seVolumePenerimaan.MinValue = 0; seVolumePenerimaan.MaxValue = quantityVolume; UnloadingModel.UnloadingDetail detail = UnloadingEntity.GetUnloadingDetail(lo_ID); //txtNoLO.Text = detail.NoLO; //txtLODate.Text = detail.LODate.ToString("dd-MMM-yyyy"); txtNoDO.Text = detail.NoDO; txtDODate.Text = detail.DODate.ToString("dd-MMM-yyyy"); txtNoPO.Text = detail.NoPO; txtPODate.Text = detail.PODate.ToString("dd-MMM-yyyy"); txtNoOrder.Text = detail.NoOrder; txtOrderDate.Text = detail.OrderDate.ToString("dd-MMM-yyyy"); txtTransporter.Text = detail.TransporterName; txtVehicleType.Text = detail.VehicleType; txtDriver.Text = detail.DriverName; txtVehicleNumber.Text = detail.VehicleNumber; txtDONote.Text = detail.DONote; cpUnloadingDetail.ClientVisible = true; }
public static string SubmitUnloading(UnloadingModel.UnloadingDetail item) { string res = DbTransaction.DbToString("sp_SubmitUnloading", new { LO_ID = item.LO_ID, UnloadingDate = item.UnloadingDate, MeasurementMethods = item.MeasurementMethods, EIJKBautHeight = item.EIJKBautHeight, EIJKBautActual = item.EIJKBautActual, SensitivityVolume = item.SensitivityVolume, ReceiptVolume = item.ReceiptVolume, UnloadingNote = item.UnloadingNote, BASTNumber = item.BASTNumber, BASTFileName = item.BASTFileName, BASTFileBytes = item.BASTFileBytes, CreationBy = item.CreationBy }, true); return(res); }