protected void dgJobCollections_ItemDataBound(object sender, DataGridItemEventArgs e) { // If any null values within DataGrid's DataSource, DataGrid will change these // to  . Since passing data to the report, set any such cells' Text // property to an empty string, "", so   is not displayed in the report. if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { for (int i = 0; i < e.Item.Cells.Count; i++) { if (e.Item.Cells[i].Text == " ") { e.Item.Cells[i].Text = ""; } } } if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) && m_instructionId == int.Parse(e.Item.Cells[9].Text)) { pnlEnterInformation.Visible = true; btnReport.Enabled = true; RdoBtnGrouper rbgCollection = (RdoBtnGrouper)e.Item.FindControl("rbgCollection"); if (rbgCollection != null) { ViewState["DataGridItemIndex"] = e.Item.ItemIndex; rbgCollection.Checked = true; // Get the docket numbers being collected at this point. GetDocketNumbers(m_instructionId); } } }
protected void rbgCollection_CheckedChanged(object sender, EventArgs e) { RdoBtnGrouper grouper = (RdoBtnGrouper)sender; if (grouper.Checked) { btnReport.Enabled = true; pnlEnterInformation.Visible = true; DataGridItem dgi = (DataGridItem)grouper.Parent.Parent; ViewState["DataGridItemIndex"] = dgi.ItemIndex; // Get the docket numbers being collected at this point. int instructionId = Convert.ToInt32(dgi.Cells[9].Text); GetDocketNumbers(instructionId); } }
private int FindSelectedPoint() { foreach (DataGridItem dgItem in dgDeliveryPoint.Items) { // Get RdoBtnGrouper object RdoBtnGrouper selectRadioButton = dgItem.FindControl("selectRadioButton") as RdoBtnGrouper; if (selectRadioButton != null && selectRadioButton.Checked) { int pointId = Convert.ToInt32(selectRadioButton.Attributes["Value"]); return(pointId); } } // There are no buttons selected return(0); }
protected void btnAddToJob_Click(object sender, System.EventArgs e) { int collectDropId = 0; int PODId = 0; Entities.POD podToAssign = null; // Find the Collect Drop ID for the selected collect drop portion foreach (DataGridItem cdsItem in dgCollectionDropSummary.Items) { DataGrid dgCollectionDrop = (DataGrid)cdsItem.FindControl("dgCollectionDrop"); foreach (DataGridItem cdItem in dgCollectionDrop.Items) { RdoBtnGrouper rbgCollectionDrop = (RdoBtnGrouper)cdItem.FindControl("rbgCollectionDrop"); if (rbgCollectionDrop.Checked) { collectDropId = int.Parse(cdItem.Cells[0].Text); } } } // Find the POD ID of the selected POD foreach (DataGridItem PODItem in dgUnassignedPODs.Items) { RdoBtnGrouper rbgPODId = (RdoBtnGrouper)PODItem.FindControl("rbgPODId"); if (rbgPODId.Checked) { PODId = int.Parse(PODItem.Cells[0].Text); podToAssign = new Entities.POD(PODId, PODItem.Cells[1].Text, DateTime.Parse(PODItem.Cells[2].Text), m_jobId, collectDropId); } } if (podToAssign != null && collectDropId > 0 && PODId > 0) { Facade.IPOD facPOD = new Facade.POD(); facPOD.AssignToJob(podToAssign, ((Entities.CustomPrincipal)Page.User).UserName); } else { lblAddToJobError.Text = "Select POD and drop to which to assign."; lblAddToJobError.Visible = true; } PopulatePODs(); }
/// <summary> /// Load PCV /// </summary> private void LoadPCV() { // May be required to be shown if PCV's are allowed to be deleted once created //chkDelete.Visible = true; //pnlPCVDeleted.Visible = true; if (ViewState["pcv"] == null) { Facade.IPCV facPCV = new Facade.PCV(); pcv = facPCV.GetForPCVId(m_PCVId); ViewState["pcv"] = pcv; } else { pcv = (Entities.PCV)ViewState["pcv"]; } if (m_isUpdate) { txtJobPCVId.Text = pcv.PCVId.ToString(); } else { txtJobPCVId.Text = m_jobId.ToString(); } txtVoucherNo.Text = pcv.VoucherNo.ToString(); txtNoOfPallets.Text = pcv.NoOfPalletsReceived.ToString(); dteDateOfIssue.SelectedDate = pcv.DateOfIssue; txtDepotId.Text = pcv.DepotId.ToString(); cboPCVStatus.Items.FindByValue(pcv.PCVStatusId.ToString()).Selected = true; cboPCVRedemptionStatus.Items.FindByValue(pcv.PCVRedemptionStatusId.ToString()).Selected = true; // Load dgDeliveryPoints with the relevant fields and markers int deliveryPointId = pcv.DeliverPointId; // Get point and mark it checked in the grid Facade.IPoint facPoint = new Facade.Point(); DataSet ds = facPoint.GetPointForPointId(deliveryPointId, "DataSet"); dgDeliveryPoint.DataSource = ds; dgDeliveryPoint.DataBind(); foreach (DataGridItem dgItem in dgDeliveryPoint.Items) { // Get RdoBtnGrouper object RdoBtnGrouper selectRadioButton = dgItem.FindControl("selectRadioButton") as RdoBtnGrouper; // Make the row highlight the radiobutton selectRadioButton.Checked = true; } txtSignings.Text = pcv.NoOfSignings.ToString(); //if (pcv.PCVStatus == ePCVStatus.NotApplicable) // chkDelete.Checked = true; Header1.Title = "Update PCV"; Header1.subTitle = "Please make any changes neccessary."; btnAdd.Text = "Update"; }