protected void Btnsave_Click(object sender, EventArgs e)
{
try
{
//if (DDlStandard.SelectedValue !=null)
//{
nv.Clear();
nv.Add("@Flag", "Insert");
string TimeTableId = hlp.GetNextNoMax("TimeTblMstr", "TimeTblId", "TT", "3");
nv.Add("@TimeTblId", TimeTableId);
nv.Add("@StdId", DDlStandard.SelectedValue.ToString());
nv.Add("@DivId", DDlDivision.SelectedValue.ToString());
nv.Add("@SubjId", DDlSubj.SelectedValue.ToString());
for ( int i = 0; i < GridView1.Rows.Count; i++ )
{
CheckBox chkMon = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkMon");
if ( chkMon.Checked )
{
nv.Add("@sessionId", GridView1.Rows[i].ToString());
nv.Add("@Mon", "Y");
}
else
{
nv.Add("@Mon", "N");
}
CheckBox chkTue = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkTue");
if ( chkTue.Checked )
{
nv.Add("@sessionId", GridView1.Rows[0].ToString());
nv.Add("@Tue", "Y");
}
else
{
nv.Add("@Tue", "N");
}
CheckBox chkWed = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkWed");
if ( chkWed.Checked )
{
}
CheckBox chkThu = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkThu");
if ( chkThu.Checked )
{
}
CheckBox chkFri = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkFri");
if ( chkFri.Checked )
{
}
CheckBox chkTue = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chk");
if ( chkTue.Checked )
{
}
}
int ans = Convert.ToInt32(hlp.Insert("[SPTimeTbl]", nv));
if ( ans == 1 )
{
ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Successfully Submitted');", true);
}
else
{
ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Problem In Submitting...Try Again');", true);
}
}
catch
{
}
}
samedi 5 octobre 2019
how to retrive data from gridview with multiple checkbox in c# for insert data in datatable
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire