protected void btnSaveNewSubCategory_Click(object sender, EventArgs e) { try { obj_MC = new clsManageMasterTables(); obj = new TBL_SUB_CATEGORY(); obj.SUBCAT_ID = 0; obj.MAIN_COURSE_ID = Convert.ToInt32(ddlMainCourse.SelectedValue); obj.SUBCAT_NAME = txtSubCategoryName.Text; obj.SUBCAT_DESC = txtSubCategoryDesc.Text; obj.CREATED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.CREATED_BY = 1000000001; obj.MODIFIED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_BY = 1000000001; obj.PURGEFLAG = "A"; obj_MC.SubCategoryInsertUpdate(obj); Bind_grdSubCategory(); txtSubCategoryName.Text = txtSubCategoryDesc.Text = string.Empty; ddlMainCourse.SelectedValue = "0"; } catch (Exception ex) { Response.Write(ex.Message); } }
protected void grdMainCourse_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = grdMainCourse.Rows[e.RowIndex]; TextBox txtMainCourseNameGRD = (TextBox)row.FindControl("txtMainCourseNameGRD"); TextBox txtMainCourseDescGRD = (TextBox)row.FindControl("txtMainCourseDescGRD"); int resultNo = 0; string resultDesc = string.Empty; obj_MC = new clsManageMasterTables(); obj = new TBL_MAIN_COURSE(); obj.MAIN_COURSE_ID = Convert.ToInt32(grdMainCourse.DataKeys[e.RowIndex].Value.ToString()); obj.COURSE_NAME = txtMainCourseNameGRD.Text; obj.COURSE_DESC = txtMainCourseDescGRD.Text; obj.CREATED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.CREATED_BY = 1000000001; obj.MODIFIED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_BY = 1000000001; obj.PURGEFLAG = "A"; obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc); Response.Write(resultDesc); Bind_grdMainCourse(); txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty; grdMainCourse.EditIndex = -1; Bind_grdMainCourse(); }
protected void btnSaveNewMainCourse_Click(object sender, EventArgs e) { try { int resultNo = 0; string resultDesc = string.Empty; obj_MC = new clsManageMasterTables(); obj = new TBL_MAIN_COURSE(); obj.MAIN_COURSE_ID = 0; obj.COURSE_NAME = txtMainCourseName.Text; obj.COURSE_DESC = txtMainCourseDesc.Text; obj.CREATED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.CREATED_BY = 1000000001; obj.MODIFIED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_BY = 1000000001; obj.PURGEFLAG = "A"; obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc); Response.Write(resultDesc); Bind_grdMainCourse(); txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty; } catch (Exception ex) { Response.Write(ex.Message); } }
protected void chkPURGEFLAG_OnCheckedChanged(object sender, EventArgs e) { CheckBox chkPURGEFLAG = (CheckBox)sender; GridViewRow row = (GridViewRow)chkPURGEFLAG.NamingContainer; HiddenField hdnfPurgeFlag = (HiddenField)row.FindControl("hdnfPurgeFlag"); int rowindex = row.RowIndex; int resultNo = 0; string resultDesc = string.Empty; obj_MC = new clsManageMasterTables(); obj = new TBL_MAIN_COURSE(); obj.MAIN_COURSE_ID = Convert.ToInt32(grdMainCourse.DataKeys[rowindex].Value.ToString()); obj.CREATED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_BY = 1000000001; if (chkPURGEFLAG.Checked) { obj.PURGEFLAG = "A"; } else { obj.PURGEFLAG = "I"; } obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc); Response.Write(resultDesc); Bind_grdMainCourse(); txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty; grdMainCourse.EditIndex = -1; Bind_grdMainCourse(); }
private void Bind_grdSubject() { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.SubjectSelectAll(DropDownSelectionType.All); grdSubject.DataSource = dt; grdSubject.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
private void Bind_grdMainCourse() { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.MainCourseSelectAll(DropDownSelectionType.All); grdMainCourse.DataSource = dt; grdMainCourse.DataBind(); //div_grdMainCourse.Visible = true; } catch (Exception ex) { Response.Write(ex.Message); } }
protected void ddlSubject_SelectedIndexChanged(object sender, EventArgs e) { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.SubCategoryWithCourseNameForList(ddlSubject.SelectedValue, DropDownSelectionType.Active); chklMainCourseSubCategory.DataSource = dt; chklMainCourseSubCategory.DataValueField = "CODE"; chklMainCourseSubCategory.DataTextField = "NAME"; chklMainCourseSubCategory.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
private void Bind_chklMainCourseSubCategory() { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.SubCategoryWithCourseNameForList(DropDownSelectionType.Active); chklMainCourseSubCategory.DataSource = dt; chklMainCourseSubCategory.DataValueField = "CODE"; chklMainCourseSubCategory.DataTextField = "NAME"; chklMainCourseSubCategory.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
private void Bind_ddlSubject() { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.SubejctForList(DropDownSelectionType.Active, DbConnect.CommaSeparatedValues(chklMainCourseSubCategory)); ddlSubject.DataSource = dt; ddlSubject.DataValueField = "CODE"; ddlSubject.DataTextField = "NAME"; ddlSubject.DataBind(); ddlSubject.Items.Insert(0, new ListItem("-- Select a Subject --", "0")); } catch (Exception ex) { Response.Write(ex.Message); } }
private void Bind_ddlMainCourse() { try { obj_MC = new clsManageMasterTables(); DataTable dt = obj_MC.MainCourseSelectAll(DropDownSelectionType.Active); ddlMainCourse.DataSource = dt; ddlMainCourse.DataValueField = "MAIN_COURSE_ID"; ddlMainCourse.DataTextField = "COURSE_NAME"; ddlMainCourse.DataBind(); ddlMainCourse.Items.Insert(0, new ListItem("-- Select a Main Course --", "0")); } catch (Exception ex) { Response.Write(ex.Message); } }
protected void btnSaveNewSubCategory_Click(object sender, EventArgs e) { try { obj_MC = new clsManageMasterTables(); obj = new TBL_SUBJECT(); obj.SUBJECT_ID = 0; obj.SUBCAT_ID = string.Join(",", (chklMainCourseSubCategory.Items.Cast <ListItem>().Where(li => li.Selected).ToList()).Select(i => i.Value)); obj.SUBJECT_NAME = txtSubjectName.Text; obj.CREATED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.CREATED_BY = 1000000001; obj.MODIFIED_ON = DbConnect.GetCurrentDateTimeIndia(); obj.MODIFIED_BY = 1000000001; obj.PURGEFLAG = "A"; obj_MC.SubjectInsertUpdate(obj); Bind_grdSubject(); txtSubjectName.Text = string.Empty; chklMainCourseSubCategory.ClearSelection(); } catch (Exception ex) { Response.Write(ex.Message); } }