protected void BindGrid() { Hashtable vHashtable = new Hashtable(); vHashtable.Add("ASE_ID", TXTID.Value); vHashtable.Add("ASER_DISID", DDLDIS.SelectedValue); vHashtable.Add("AGRP_ID", DDLAGE.SelectedValue); vHashtable.Add("TYPE", "GET"); DataTable dt = DBManager.Get(vHashtable, "GET_MASTER_ASSESSMENT"); if (dt.Columns.Count == 12) { GV_NEWTEMPLATE1.DataSource = dt; GV_NEWTEMPLATE1.DataBind(); } else { GV_NEWTEMPLATE1.DataSource = dt; GV_NEWTEMPLATE1.DataBind(); } if (dt.Columns.Count > 24) { if (Panel1.Visible == true) { for (int j = 0; j < GV_NEWTEMPLATE1.Rows.Count; j++) { string prod_nam1 = dt.Rows[j][0].ToString(); if (prod_nam1 != null) { TextBox ASER_PERCENTAGE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[4].FindControl("ASER_PERCENTAGE"); TextBox ASER_SCALE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[5].FindControl("ASER_SCALE"); TextBox ASER_KEYWORD = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[6].FindControl("ASER_KEYWORD"); ASER_PERCENTAGE.Text = dt.Rows[j][21].ToString(); ASER_SCALE.Text = dt.Rows[j][22].ToString(); ASER_KEYWORD.Text = dt.Rows[j][27].ToString(); } } } else { BindGrid(); } } }
protected void btnSearch_Click(object sender, EventArgs e) { if (DDLAGE.SelectedItem.Text != null) { Hashtable vHashtable = new Hashtable(); vHashtable.Add("AGDM_ID", AGDM_ID.Value); vHashtable.Add("DIS_ID", DDLDIS.SelectedValue); vHashtable.Add("AGRP_ID", DDLAGE.SelectedValue); vHashtable.Add("ASE_ID", TXTID.Value); vHashtable.Add("ASER_DISID", DDLDIS.SelectedValue); DataTable dt = DBManager.Get(vHashtable, "GET_ASER_ID"); DataRow vDR2 = RetDR(DBManager.Get(vHashtable, "GET_ASER_ID")); if (dt.Columns.Count == 14) { if (vDR2 != null) { GV_NEWTEMPLATE1.DataSource = dt; GV_NEWTEMPLATE1.DataBind(); Templatenew.Visible = true; btnSave.Visible = true; } else { GV_NEWTEMPLATE1.DataSource = dt; GV_NEWTEMPLATE1.DataBind(); Templatenew.Visible = true; btnSave.Visible = false; } foreach (GridViewRow gdr in GV_NEWTEMPLATE1.Rows) { gdr.Cells[9].Visible = false; } } else { GV_NEWTEMPLATE1.DataSource = dt; GV_NEWTEMPLATE1.DataBind(); Templatenew.Visible = true; btnSave.Visible = false; } if (dt.Columns.Count > 24) { if (Panel1.Visible == true) { for (int j = 0; j < GV_NEWTEMPLATE1.Rows.Count; j++) { string prod_nam1 = dt.Rows[j][0].ToString(); if (prod_nam1 != null) { TextBox ASER_PERCENTAGE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[4].FindControl("ASER_PERCENTAGE"); TextBox ASER_SCALE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[5].FindControl("ASER_SCALE"); TextBox ASER_KEYWORD = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[6].FindControl("ASER_KEYWORD"); ASER_PERCENTAGE.Text = dt.Rows[j][21].ToString(); ASER_SCALE.Text = dt.Rows[j][22].ToString(); ASER_KEYWORD.Text = dt.Rows[j][27].ToString(); ASER_KEYWORD.Enabled = false; ASER_PERCENTAGE.Enabled = false; ASER_SCALE.Enabled = false; } } } } } }
protected void Page_Load(object sender, EventArgs e) { vATSession = (ATSession)Session["User"]; if (vATSession == null) { Response.Redirect("Default.aspx"); } String vID = Request.QueryString["ID"]; if (!IsPostBack) { dt = new DataTable(); DataColumn coldisname = new DataColumn(); coldisname.DataType = Type.GetType("System.String"); coldisname.ColumnName = "DCAT_NAME"; dt.Columns.Add(coldisname); DataColumn coltypgroup = new DataColumn(); coltypgroup.DataType = Type.GetType("System.String"); coltypgroup.ColumnName = "DSCAT_DESC"; dt.Columns.Add(coltypgroup); DataColumn coltypgroup1 = new DataColumn(); coltypgroup1.DataType = Type.GetType("System.String"); coltypgroup1.ColumnName = "DOBS_DESC"; dt.Columns.Add(coltypgroup1); DataColumn coldID = new DataColumn(); coldID.DataType = Type.GetType("System.String"); coldID.ColumnName = "AGDD_ID"; dt.Columns.Add(coldID); DataColumn ASE = new DataColumn(); ASE.DataType = Type.GetType("System.String"); ASE.ColumnName = "ASE_ID"; dt.Columns.Add(ASE); DataColumn ASER_DISID = new DataColumn(); ASER_DISID.DataType = Type.GetType("System.String"); ASER_DISID.ColumnName = "ASER_DISID"; dt.Columns.Add(ASER_DISID); DataColumn coldcname = new DataColumn(); coldcname.DataType = Type.GetType("System.String"); coldcname.ColumnName = "ASER_PERCENTAGE"; dt.Columns.Add(coldcname); DataColumn coldesc = new DataColumn(); coldesc.DataType = Type.GetType("System.String"); coldesc.ColumnName = "ASER_SCALE"; dt.Columns.Add(coldesc); ViewState["datagrid"] = dt; Templatenew.Visible = false; try { ValidateUserAccess(); ATCommon.FillDrpDown(DDLAGE, DBManager.Get(new Hashtable(), "CMB_AGE_GRP_MASTER"), "Select Group Name", "AGRP_GROUP", "AGRP_ID", "0");// hard valus anm_id=2 ATCommon.FillDrpDown(DDLDIS, DBManager.Get(new Hashtable(), "CMB_DIS_MASTER"), "Select Disorder Name", "DIS_NAME", "DIS_ID", "0"); if (vID != null) { TextBox ASER_PERCENTAGE = (TextBox)FindControl("ASER_PERCENTAGE"); TextBox ASER_SCALE = (TextBox)FindControl("ASER_SCALE"); Hashtable vHashtable = new Hashtable(); vHashtable.Add("ASE_ID", vID); vHashtable.Add("ASER_DISID", DDLDIS.SelectedValue); vHashtable.Add("AGRP_ID", DDLAGE.SelectedValue); vHashtable.Add("TYPE", "GET"); DataRow vDR = RetDR(DBManager.Get(vHashtable, "GET_ASSESS_MASTER")); if (vDR != null) { TXTID.Value = vDR["ASE_ID"].ToString(); ASSESSMENT_TXT.Text = vDR["ASE_NAME"].ToString(); DDLAGE.Text = vDR["AGRP_ID"].ToString(); ASSESSMENT_TXT.Enabled = false; DDLAGE.Enabled = false; } else { ShowMsg("Invalid Assessment ID"); } } if (vID != null) { Hashtable vHashtable4 = new Hashtable(); vHashtable4.Add("ASE_ID", vID); DataRow vDR4 = RetDR(DBManager.Get(vHashtable4, "GET_ASSESS_ID")); if (vDR4 != null) { DDLDIS.SelectedItem.Text = vDR4["DIS_NAME"].ToString(); DDLDIS.SelectedValue = vDR4["ASER_DISID"].ToString(); } } if (DDLAGE.SelectedValue != "0") { Hashtable vHashtable = new Hashtable(); vHashtable.Add("ASE_ID", TXTID.Value); vHashtable.Add("ASER_DISID", DDLDIS.SelectedValue); vHashtable.Add("AGRP_ID", DDLAGE.SelectedValue); vHashtable.Add("TYPE", "GET"); DataTable dt4 = DBManager.Get(vHashtable, "GET_MASTER_ASSESSMENT"); if (dt4.Columns.Count > 0) { GV_NEWTEMPLATE1.Visible = false; GV_NEWTEMPLATE1.Visible = true; GV_NEWTEMPLATE1.DataSource = dt4; GV_NEWTEMPLATE1.DataBind(); } if (dt4.Columns.Count > 24) { if (Panel1.Visible == true) { for (int j = 0; j < GV_NEWTEMPLATE1.Rows.Count; j++) { TextBox ASER_PERCENTAGE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[4].FindControl("ASER_PERCENTAGE"); TextBox ASER_SCALE = (TextBox)GV_NEWTEMPLATE1.Rows[j].Cells[5].FindControl("ASER_SCALE"); ASER_PERCENTAGE.Text = dt4.Rows[j][21].ToString(); ASER_SCALE.Text = dt4.Rows[j][22].ToString(); ASER_PERCENTAGE.Enabled = false; ASER_SCALE.Enabled = false; ASER_ID.Value = dt4.Rows[j][19].ToString(); } } btnSave.Visible = false; } } } catch (Exception xe) { ShowMsg(xe); } } }