private void dgvReleaseDistribution_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dgvReleaseDistribution.Columns["MessageColumn"].Index == e.ColumnIndex) { SelecDistReq = (VW_ReleaseDistributionRequest)dgvReleaseDistribution.CurrentRow.DataBoundItem; if (!SelecDistReq.msg.Equals("")) { My.MyProject.Forms.FrmDistributeRecChangeMsg.LoadForm(SelecDistReq); MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmDistributeRecChangeMsg, this); LoadInformation(inboutTabs.SelectedIndex); } } if (e.ColumnIndex == 0) { var value = dgvReleaseDistribution.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; if (!Information.IsNothing(value) && value.Equals(" ")) { dgvReleaseDistribution.Rows[e.RowIndex].Cells[0].Value = "✔"; } else { dgvReleaseDistribution.Rows[e.RowIndex].Cells[0].Value = " "; } } CheckButtons(); }
public void PopulateInfo(VW_RelOrderPickUpDropOffLocation relPudo, VW_ReleaseDistributionRequest relDistReq) { RelDistReqVW = relDistReq; lblReleaseNumb.Text = relDistReq.ReleaseNumber; nudQtyCans.Maximum = Conversions.ToDecimal(Operators.SubtractObject(relPudo.QtyPickUpDropOff, GetSumCansCarriers())); nudQtyCans.Value = relDistReq.QtyRequested; cboCarrier.SelectedValue = relDistReq.CarrierId; }
private void dgvReleaseDistribution_SelectionChanged(object sender, EventArgs e) { if (dgvReleaseDistribution.Rows.Count > 0 && !firstLoad) { SelecDistReq = (VW_ReleaseDistributionRequest)dgvReleaseDistribution.CurrentRow.DataBoundItem; dgvDistributionDetails.DataSource = GetDistAcceptedList(); dgvDistributionDetails.ColumnHeadersVisible = true; } }
public void PopulateInfo(VW_ReleaseDistributionRequest dist, RelDistRequestSchedule distSch) { distVW = dist; distSchedule = distSch; dtpFromDate.Value = distSch.FromDate; dtpToDate.Value = distSch.ToDate; nudQtyCans.Maximum = distSch.QtyRequested + nudQtyCans.Maximum; nudQtyCans.Value = distSch.QtyRequested; }
private void BunifuButton9_Click(object sender, EventArgs e) { My.MyProject.Forms.FrmAddEditDistRequest.isNewRecord = true; SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem; My.MyProject.Forms.FrmAddEditDistRequest.LoadForm(SelRelDistReq, PUDOSchDateList); MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditDistRequest, this); RefreshList(2); CheckButtons(); }
/// <summary> /// 0 = RelOrderPudoList; 1 = RelDistReqList; 2 = PUDODateList /// </summary> public void RefreshList(int listId) { switch (listId) { case 0: { firstLoad = true; var list = RelOrderPickUpDropOffLocationService.GetAllByOpenStatus(tgOpenCloseRequest.Value); RelOrderPudoList = new SortableBindingList <VW_RelOrderPickUpDropOffLocation>(list); VWRelOrderPickUpDropOffLocationBindingSource.DataSource = null; VWRelOrderPickUpDropOffLocationBindingSource.DataSource = RelOrderPudoList; firstLoad = false; break; } case 1: { firstLoad = true; var list = ReleaseDistributionRequestService.GetByRelPUDOId(SelectedRelPUDORow.RelOrderPickUpDropOffLocationId); RelDistReqList = new SortableBindingList <VW_ReleaseDistributionRequest>(list); VWReleaseDistributionRequestBindingSource.DataSource = RelDistReqList; dgvRelDistReq.Refresh(); if (RelDistReqList.Count > 0) { SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem; CalculateTotals(); firstLoad = false; RefreshList(2); } else { RelDistRequestScheduleBindingSource.DataSource = null; } firstLoad = false; break; } case 2: { firstLoad = true; var list = RelDistRequestScheduleService.GetAllByRelDistReqId(SelRelDistReq.ReleaseDistributionRequestId); PUDOSchDateList = new SortableBindingList <RelDistRequestSchedule>(list); RelDistRequestScheduleBindingSource.DataSource = PUDOSchDateList; firstLoad = false; CalculateTotals(); break; } } }
private void dgvRelDistReq_SelectionChanged(object sender, EventArgs e) { if (dgvRelDistReq.Rows.Count > 0 && !firstLoad) { SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem; RefreshList(2); return; } else { RelDistRequestScheduleBindingSource.DataSource = null; } CheckButtons(); }
private void dgvPUDODates_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem; My.MyProject.Forms.FrmAddEditDistRequest.isNewRecord = false; My.MyProject.Forms.FrmAddEditDistRequest.LoadForm(SelRelDistReq, PUDOSchDateList); My.MyProject.Forms.FrmAddEditDistRequest.PopulateInfo(SelRelDistReq, SelPUDODate); MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditDistRequest, this); PUDOSchDateList = new SortableBindingList <RelDistRequestSchedule>(RelDistRequestScheduleService.GetAllByRelDistReqId(SelRelDistReq.ReleaseDistributionRequestId)); RelDistRequestScheduleBindingSource.DataSource = PUDOSchDateList; CheckButtons(); CalculateTotals(); } }
private void btnRemove_Click(object sender, EventArgs e) { SelRelDistReq = (VW_ReleaseDistributionRequest)dgvRelDistReq.CurrentRow.DataBoundItem; var result = My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("Delete carrier request?", "All pick up date range will be deleted. This can not be undone." + Constants.vbNewLine + "Are you sure you want to delete this carrier request?", My.Resources.Resources.warning, this); if (result == DialogResult.Yes) { var relDistService = new ReleaseDistributionRequestService(); if (relDistService.Delete(SelRelDistReq.ReleaseDistributionRequestId)) { RefreshList(1); } else { My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Information not deleted", "Something went wrong and the information was not deleted. Please try again.", this); } } CheckButtons(); }
public void LoadForm(VW_ReleaseDistributionRequest dist, SortableBindingList <RelDistRequestSchedule> PUDOSchList) { string dateBgnTimeStr = DateAndTime.Now.ToShortDateString() + " 00:00:00"; string dateEndTimeStr = DateAndTime.Now.ToShortDateString() + " 23:59:59"; lblReleaseNumb.Text = dist.ReleaseNumber; lblPickUpCode.Text = dist.PickUpTerminalCode; lblDropOff.Text = dist.YardName; lblCarrierCode.Text = dist.CarrierCode; dtpFromDate.Value = Convert.ToDateTime(dateBgnTimeStr); dtpToDate.Value = Convert.ToDateTime(dateEndTimeStr); nudQtyCans.Value = 0m; distVW = dist; int SumTotalSch = 0; foreach (var item in PUDOSchList) { SumTotalSch += item.QtyRequested; } nudQtyCans.Value = dist.QtyRequested - SumTotalSch; nudQtyCans.Maximum = dist.QtyRequested - SumTotalSch; }
public void LoadForm(VW_ReleaseDistributionRequest r) { RequestStatusList = RequestStatusService.GetByFlowType("INBOUND"); focusedReleaseDistribution = ReleaseDistributionRequestService.GetById(r.ReleaseDistributionRequestId); { var withBlock = cboDistReqStatus; withBlock.DataSource = RequestStatusList; withBlock.DisplayMember = "StatusName"; withBlock.ValueMember = "RequestStatusId"; } tbNotes.Text = ""; var list = RelDistChangeSchRequestedService.GetByRelDistRequestId(r.ReleaseDistributionRequestId); VWRelDistChangeSchRequestedBindingSource.DataSource = null; VWRelDistChangeSchRequestedBindingSource.DataSource = list; sch = new RelDistRequestSchedule(); focusedRow = (VW_RelDistChangeSchRequested)dgvProposedChange.CurrentRow.DataBoundItem; sch = RelDistRequestScheduleService.GetById(focusedRow.RelDistRequestScheduleId); cboDistReqStatus.SelectedValue = r.RequestStatusId; tbNotes.Text = list[0].WTCMessage; lblCarrierNotes.Text = list[0].CarrierMessage; AddComboBoxCol(); }