private void loadGridOptions() { DataSet dsOptions = WorkRequest.GetAvailableOptions(); if (dsOptions != null && dsOptions.Tables.Count > 0) { if (dsOptions.Tables.Contains("Priority")) { _dtPriority = dsOptions.Tables["Priority"]; } if (dsOptions.Tables.Contains("User")) { _dtUsers = dsOptions.Tables["User"]; } if (dsOptions.Tables.Contains("Status")) { _dtTDStatus = dsOptions.Tables["Status"].Copy(); _dtTDStatus.DefaultView.RowFilter = " StatusType = 'TD' "; _dtTDStatus = _dtTDStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtTDStatus", JsonConvert.SerializeObject(_dtTDStatus, Newtonsoft.Json.Formatting.None)); _dtCDStatus = dsOptions.Tables["Status"].Copy(); _dtCDStatus.DefaultView.RowFilter = " StatusType = 'CD' "; _dtCDStatus = _dtCDStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtCDStatus", JsonConvert.SerializeObject(_dtCDStatus, Newtonsoft.Json.Formatting.None)); _dtCStatus = dsOptions.Tables["Status"].Copy(); _dtCStatus.DefaultView.RowFilter = " StatusType = 'C' "; _dtCStatus = _dtCStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtCStatus", JsonConvert.SerializeObject(_dtCStatus, Newtonsoft.Json.Formatting.None)); _dtITStatus = dsOptions.Tables["Status"].Copy(); _dtITStatus.DefaultView.RowFilter = " StatusType = 'IT' "; _dtITStatus = _dtITStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtITStatus", JsonConvert.SerializeObject(_dtITStatus, Newtonsoft.Json.Formatting.None)); _dtCVTStatus = dsOptions.Tables["Status"].Copy(); _dtCVTStatus.DefaultView.RowFilter = " StatusType = 'CVT' "; _dtCVTStatus = _dtCVTStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtCVTStatus", JsonConvert.SerializeObject(_dtCVTStatus, Newtonsoft.Json.Formatting.None)); _dtAStatus = dsOptions.Tables["Status"].Copy(); _dtAStatus.DefaultView.RowFilter = " StatusType = 'Adopt' "; _dtAStatus = _dtAStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtAStatus", JsonConvert.SerializeObject(_dtAStatus, Newtonsoft.Json.Formatting.None)); _dtCRStatus = dsOptions.Tables["Status"].Copy(); _dtCRStatus.DefaultView.RowFilter = " StatusType = 'CR' "; _dtCRStatus = _dtCRStatus.DefaultView.ToTable(); Page.ClientScript.RegisterArrayDeclaration("_dtCRStatus", JsonConvert.SerializeObject(_dtCRStatus, Newtonsoft.Json.Formatting.None)); } } }
private void loadLookupData() { DataSet dsOptions = WorkRequest.GetAvailableOptions(); if (dsOptions == null || dsOptions.Tables.Count == 0) { return; } ListItem item = null; if (dsOptions.Tables.Contains("Contract")) { ddlContract.DataSource = dsOptions.Tables["Contract"]; ddlContract.DataTextField = "CONTRACT"; ddlContract.DataValueField = "CONTRACTID"; ddlContract.DataBind(); } if (dsOptions.Tables.Contains("Organization")) { ddlOrganization.DataSource = dsOptions.Tables["Organization"]; ddlOrganization.DataTextField = "ORGANIZATION"; ddlOrganization.DataValueField = "ORGANIZATIONID"; ddlOrganization.DataBind(); } if (dsOptions.Tables.Contains("RequestType")) { ddlRequestType.DataSource = dsOptions.Tables["RequestType"]; ddlRequestType.DataTextField = "REQUESTTYPE"; ddlRequestType.DataValueField = "REQUESTTYPEID"; ddlRequestType.DataBind(); } if (dsOptions.Tables.Contains("RequestGroup")) { ddlRequestGroup.DataSource = dsOptions.Tables["RequestGroup"]; ddlRequestGroup.DataTextField = "RequestGroup"; ddlRequestGroup.DataValueField = "RequestGroupID"; ddlRequestGroup.DataBind(); } if (dsOptions.Tables.Contains("Scope")) { ddlScope.DataSource = dsOptions.Tables["Scope"]; ddlScope.DataTextField = "SCOPE"; ddlScope.DataValueField = "WTS_SCOPEID"; ddlScope.DataBind(); } if (dsOptions.Tables.Contains("Effort")) { ddlEffort.DataSource = dsOptions.Tables["Effort"]; ddlEffort.DataTextField = "EFFORT"; ddlEffort.DataValueField = "EFFORTID"; ddlEffort.DataBind(); } if (dsOptions.Tables.Contains("Priority")) { ddlPriority.DataSource = dsOptions.Tables["Priority"]; ddlPriority.DataTextField = "PRIORITY"; ddlPriority.DataValueField = "PRIORITYID"; ddlPriority.DataBind(); } if (dsOptions.Tables.Contains("User")) { item = null; string name = string.Empty; foreach (DataRow row in dsOptions.Tables["User"].Rows) { name = string.Format("{0} {1}", row["FIRST_NAME"].ToString(), row["LAST_NAME"].ToString()); item = new ListItem(name, row["WTS_RESOURCEID"].ToString()); item.Attributes.Add("username", row["USERNAME"].ToString()); item.Attributes.Add("organizationID", row["ORGANIZATIONID"].ToString()); ddlSubmittedBy.Items.Add(item); if (this.WorkRequestID == 0) { item = ddlSubmittedBy.Items.FindByValue(UserManagement.GetUserId_FromUsername().ToString()); if (item != null) { item.Selected = true; } } name = string.Format("{0} {1}", row["FIRST_NAME"].ToString(), row["LAST_NAME"].ToString()); item = new ListItem(name, row["WTS_RESOURCEID"].ToString()); item.Attributes.Add("username", row["USERNAME"].ToString()); item.Attributes.Add("organizationID", row["ORGANIZATIONID"].ToString()); ddlSME.Items.Add(item); item = new ListItem(name, row["WTS_RESOURCEID"].ToString()); item.Attributes.Add("username", row["USERNAME"].ToString()); item.Attributes.Add("organizationID", row["ORGANIZATIONID"].ToString()); ddlLead_IA_TW.Items.Add(item); item = new ListItem(name, row["WTS_RESOURCEID"].ToString()); item.Attributes.Add("username", row["USERNAME"].ToString()); item.Attributes.Add("organizationID", row["ORGANIZATIONID"].ToString()); ddlLeadResource.Items.Add(item); } } }