/// <summary> /// Set Grid Data source /// </summary> /// <param name="addRow"></param> /// <param name="deleteRow"></param>e private void BindGrid(bool addRow, bool deleteRow) { NeverAttendedSchoolBLL ConcernBLLobj = new NeverAttendedSchoolBLL(); grdNASchool.DataSource = ConcernBLLobj.GetAllNeverAttendedSchool(); grdNASchool.DataBind(); }
/// <summary> /// To update details to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private string EditNASchoolDetails() { string message = string.Empty; NeverAttendedSchoolBLL NeverAttendedSchoolBLLObj = new NeverAttendedSchoolBLL(); try { NeverAttendedSchoolBO NeverAttendedSchoolBOObj = new NeverAttendedSchoolBO(); if (ViewState["NVR_ATT_SCH_REASONID"] != null) { NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASONID = Convert.ToInt32(ViewState["NVR_ATT_SCH_REASONID"].ToString()); } string uID = Session["USER_ID"].ToString(); NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASON = NeverAttndSchlTextBox.Text.ToString().Trim(); NeverAttendedSchoolBOObj.DESCRIPTION = DescriptionTextBox.Text.ToString().Trim(); NeverAttendedSchoolBOObj.UpdatedBy = Convert.ToInt32(uID); //BLL.NeverAttendedSchoolBLL NeverAttendedSchoolBLLObj = new BLL.NeverAttendedSchoolBLL(); message = NeverAttendedSchoolBLLObj.EDITNASCHOOL(NeverAttendedSchoolBOObj); } catch (Exception ex) { throw ex; } finally { NeverAttendedSchoolBLLObj = null; } return(message); }
/// <summary> /// Update Database Make data as Obsoluted /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void IsObsolete_CheckedChanged(Object sender, EventArgs e) { string message = string.Empty; try { CheckBox chk = (CheckBox)sender; GridViewRow gr = (GridViewRow)chk.Parent.Parent; string NVR_ATT_SCH_REASONID = ((Literal)gr.FindControl("litNeverattentedSchoolID")).Text; NeverAttendedSchoolBLL ConcernBLLobj = new NeverAttendedSchoolBLL(); message = ConcernBLLobj.ObsoleteNASchool(Convert.ToInt32(NVR_ATT_SCH_REASONID), Convert.ToString(chk.Checked)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data updated successfully"; } BindGrid(false, true); if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } } catch (Exception ex) { throw ex; } }
///<summary> ///To delete details ///</summary> private void DeleteNASchoolDetails(int NASchoolID) { string message = string.Empty; NeverAttendedSchoolBLL NeverAttendedSchoolBLLobj = new NeverAttendedSchoolBLL(); message = NeverAttendedSchoolBLLobj.DeleteNASchoolById(NASchoolID); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data Deleted successfully"; } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } }
///<summary> ///To fetch details ///</summary> private void GetNASchoolDetails() { NeverAttendedSchoolBLL NeverAttendedSchoolBLLobj = new NeverAttendedSchoolBLL(); int NVRATTSCHREASONID = 0; if (ViewState["NVR_ATT_SCH_REASONID"] != null) { NVRATTSCHREASONID = Convert.ToInt32(ViewState["NVR_ATT_SCH_REASONID"]); } NeverAttendedSchoolBO NeverAttendedSchoolBOObj = new NeverAttendedSchoolBO(); NeverAttendedSchoolBOObj = NeverAttendedSchoolBLLobj.GetNASchoolById(NVRATTSCHREASONID); NeverAttndSchlTextBox.Text = NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASON; DescriptionTextBox.Text = NeverAttendedSchoolBOObj.DESCRIPTION; //int ConcernID_test = Convert.ToInt32(ConcernObj.ConcernID); }
/// <summary> /// To save details to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private string SaveNASchoolDetails() { string message = string.Empty; NeverAttendedSchoolBOObj = new NeverAttendedSchoolBO(); string NeverAttndSchl = string.Empty; string Description = string.Empty; string uID = Session["USER_ID"].ToString(); NeverAttndSchl = NeverAttndSchlTextBox.Text.ToString().Trim(); Description = DescriptionTextBox.Text.ToString().Trim(); NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASON = NeverAttndSchl; NeverAttendedSchoolBOObj.DESCRIPTION = Description; //NeverAttendedSchoolBOObj.IsDeleted = "false"; NeverAttendedSchoolBOObj.CreatedBy = Convert.ToInt32(uID); NeverAttendedSchoolBLLobj = new NeverAttendedSchoolBLL(); // Data sending to Next layer BAL try { message = NeverAttendedSchoolBLLobj.InsertIntoNeverAttendedSchool(NeverAttendedSchoolBOObj); // Value passing to Next layer } catch (Exception ee) // find the Exception { throw ee; } finally // set the finally class nothing but Empty the object emp_mst_Bal { NeverAttendedSchoolBLLobj = null; } return(message); }