protected void btnSaveGrade_Click(object sender, EventArgs e) { string Mode = "A"; DataTable dt = ValidateMin_Max(); if (dt.Rows.Count == 0) { return; } int ID = BLL_Infra_DrillQuestionnaire.INS_UPD_DEL_Grading(null, txtGrade.Text.Trim(), 1, UDFLib.ConvertToInteger(ddlMin.SelectedValue), UDFLib.ConvertToInteger(ddlMax.SelectedValue), UDFLib.ConvertToInteger(ddlDivisions.SelectedValue), Convert.ToInt32(Session["USERID"]), Mode); for (int i = 0; i < rptOptions.Items.Count; i++) { TextBox txtValue = (TextBox)rptOptions.Items[i].FindControl("txtValue"); TextBox txtText = (TextBox)rptOptions.Items[i].FindControl("txtText"); if (txtText != null && txtValue != null) { BLL_Infra_DrillQuestionnaire.INS_UPD_DEL_GradingOption(ID, txtText.Text.Trim(), UDFLib.ConvertToDecimal(txtValue.Text), Convert.ToInt32(Session["USERID"])); } } Bind_Grading(); Get_Grading_ForQuestions(); ClearControls_Grade(); }
protected void grdGrading_RowDeleting(object sender, GridViewDeleteEventArgs e) { int ID = UDFLib.ConvertToInteger(grdGrading.DataKeys[e.RowIndex].Value.ToString()); GridViewRow row = grdGrading.Rows[e.RowIndex]; Label lblGrdUsed = (Label)row.FindControl("lblGradeIsUsed"); string Mode = "D"; BLL_Infra_DrillQuestionnaire.INS_UPD_DEL_Grading(ID, "", null, null, null, null, Convert.ToInt32(Session["USERID"]), Mode); Bind_Grading(); Get_Grading_ForQuestions(); Bind_Question(); }
protected void grdGrading_RowUpdating(object sender, GridViewUpdateEventArgs e) { int ID = UDFLib.ConvertToInteger(grdGrading.DataKeys[e.RowIndex].Value.ToString()); string Grade_Name = e.NewValues["Grade_Name"].ToString(); int Grade_Type = 1;//UDFLib.ConvertToInteger(e.NewValues["Grade_Type"].ToString()); int Min = UDFLib.ConvertToInteger(e.NewValues["Min"].ToString()); int Max = UDFLib.ConvertToInteger(e.NewValues["Max"].ToString()); if (Min > Max) { string js = "alert('Max Point should be Greater than Min Point');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true); return; } int Divisions = UDFLib.ConvertToInteger(e.NewValues["Divisions"].ToString()); BLL_Infra_DrillQuestionnaire.INS_UPD_DEL_Grading(ID, Grade_Name, Grade_Type, Min, Max, Divisions, Convert.ToInt32(Session["USERID"]), "M"); grdGrading.EditIndex = -1; Bind_Grading(); }