public void PopulateInfo(InboundReqDeclinedQty ro, int maxToDecline) { InReqDeclined = ro; tbNotes.Text = InReqDeclined.Notes; nudQtyCans.Value = InReqDeclined.QtyDeclined; cboDelineStatus.SelectedItem = InReqDeclined.DeclineStatus; IsGoodToGo(); }
public void PopulateInfo(VW_InboundRequest req) { LoadForm(); firstLoad = true; btnManageBal.Enabled = true; RelReq = req; cbStatus.SelectedValue = req.RequestStatusId; lblSSLineName.Text = req.SSLineCode; lblRelType.Text = req.ReleaseType; lblSize.Text = req.ContainerSizeName; lblReqDate.Text = req.DateRequested.ToString("dd-MMMd-yyyy"); fu = InboundFollowUpService.GetByOpenInboundRequestId(req.InboundRequestId); ReleaseList = ReleaseService.GetAllVWByInboundReqId(RelReq.InboundRequestId); if (!Information.IsNothing(fu)) { followUpQty = RelReq.TotalQtyAccptOfRequest - SumAddedLocations; var newRel = new VW_Release(); newRel.ReleaseNumber = "FOLLOW UP"; newRel.TotalQtyAccepted = followUpQty; pnlFollowUp.Show(); ReleaseList.Add(newRel); } var inReqDeclinedList = ReleaseList.Where(r => r.InboundReqDeclinedQtyId != 0).ToList(); if (inReqDeclinedList.Count > 0) { InReqDeclined = InboundReqDeclinedQtyService.GetById(inReqDeclinedList[0].InboundReqDeclinedQtyId); var newRel = new VW_Release(); newRel.ReleaseNumber = InReqDeclined.DeclineStatus; newRel.TotalQtyAccepted = InReqDeclined.QtyDeclined; ReleaseList.Add(newRel); btnManageBal.Enabled = false; } VWReleaseBindingSource.DataSource = null; VWReleaseBindingSource.DataSource = ReleaseList; dgvRelease.DataSource = null; dgvRelease.DataSource = VWReleaseBindingSource.DataSource; if (!Information.IsNothing(dgvRelease.CurrentRow) && dgvRelease.Rows.Count > 0 && InReqDeclined.InboundReqDeclinedQtyId == 0) { VW_Release focusedRel = (VW_Release)dgvRelease.CurrentRow.DataBoundItem; RelOrderList = ReleaseOrderService.GetAllVWByReleaseId(focusedRel.ReleaseId); cboRelOrder.DataSource = RelOrderList; cboRelOrder.DisplayMember = "RelOrder"; cboRelOrder.ValueMember = "ReleaseOrderId"; } firstLoad = false; CalculateQtys(); }
public void LoadForm(VW_InboundRequest inreq) { { var withBlock = cboDelineStatus; withBlock.Items.Clear(); var list = RequestStatusService.GetByFlowType("INBOUND - BAL"); foreach (var item in list) { withBlock.Items.Add(item.StatusName); } withBlock.SelectedIndex = 0; } tbNotes.Text = ""; nudQtyCans.Value = 0m; InReqDeclined = new InboundReqDeclinedQty(); InReqDeclined.InboundRequestId = inreq.InboundRequestId; btnComplete.Enabled = false; }
public bool Delete(int InboundReqDeclinedQtyId) { bool isSaved = true; using (WTCCeresEntities db = new WTCCeresEntities()) { try { irdq = db.InboundReqDeclinedQty.Find(InboundReqDeclinedQtyId); db.InboundReqDeclinedQty.Remove(irdq); db.SaveChanges(); } catch { isSaved = false; } } return(isSaved); }
public bool AddOrUpdate(InboundReqDeclinedQty inboundReqDeclinedQty) { bool isSaved = true; using (WTCCeresEntities db = new WTCCeresEntities()) { try { irdq = inboundReqDeclinedQty; db.InboundReqDeclinedQty.AddOrUpdate(irdq); db.SaveChanges(); } catch (Exception ex) { isSaved = false; } } return(isSaved); }
public bool AddOrUpdate(InboundReqDeclinedQty inboundReqDeclinedQty) { return(repository.AddOrUpdate(inboundReqDeclinedQty)); }