private void InitializeJobDescriptionGrid() { System.Data.DataTable jobDescriptionTable = new System.Data.DataTable(); jobDescriptionTable.Columns.Add("CorrespondenceId"); jobDescriptionTable.Columns.Add("CorrespondenceName"); jobDescriptionTable.Columns.Add("CorrespondenceContentId"); jobDescriptionTable.Columns.Add("CorrespondenceContentDescription"); jobDescriptionTable.Columns.Add("PrinterResolution"); jobDescriptionTable.Columns.Add("PrinterColor"); jobDescriptionTable.Columns.Add("PrinterInputBin"); jobDescriptionTable.Columns.Add("PrinterOutputBin"); JobDescriptionGrid.DataSource = jobDescriptionTable; JobDescriptionGrid.DataBind(); return; }
private void bindJobDescriptionView() { var id = Request.QueryString["Id"]; String strConnString = ConfigurationManager.ConnectionStrings["OFOConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); con.Open(); SqlCommand command = new SqlCommand("dbo.ViewJobDescription", con); command.Parameters.AddWithValue("@OFOCode", id); command.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(command); DataTable dt = new DataTable(); da.Fill(dt); JobDescriptionGrid.DataSource = dt; JobDescriptionGrid.DataBind(); JobDescriptionGrid.Visible = true; }
protected void JobCorrespondenceSelection_OnItemCheck(Object sender, Telerik.Web.UI.RadListBoxItemEventArgs e) { InitializeJobDescriptionGrid(); System.Data.DataTable jobDescriptionTable = (System.Data.DataTable)JobDescriptionGrid.DataSource; Client.Core.Reference.Correspondence selectedCorrespondence = MercuryApplication.CorrespondenceGet(Convert.ToInt64(e.Item.Value), true); if (selectedCorrespondence != null) { foreach (Client.Core.Reference.CorrespondenceContent currentContent in selectedCorrespondence.Content.Values) { jobDescriptionTable.Rows.Add( selectedCorrespondence.Id, selectedCorrespondence.Name, currentContent.Id, currentContent.ReportNameRaw, String.Empty, String.Empty, String.Empty, String.Empty ); } } JobDescriptionGrid.Rebind(); return; }