//Fetch Records Student Information Leaving ceritificate #region Student Leaving Ceritificate public DataSet DL_LeavingCertificate(EWA_LC objEWA) { DataSet ds = new DataSet(); try { prmList = new string[4]; prmList[0] = "@Action"; prmList[1] = "FetchLeavingCertificate"; prmList[2] = "@UserCode"; prmList[3] = Convert.ToString(objEWA.Usercode); //Stored procedure name ds = ObjHelper.FillControl(prmList, "SP_LeavingCertificate"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } } catch (Exception exp) { // GeneralErr(exp.Message.ToString()); throw exp; } return(ds); }
//To Bind Usercode #region BindUsercode public DataSet BindUsercode_DL(EWA_LC objEWA) { DataSet ds = new DataSet(); try { prmList = new string[8]; prmList[0] = "@Action"; prmList[1] = "GetStudentUsercode"; prmList[2] = "@ClassId"; prmList[3] = objEWA.ClassId; prmList[4] = "@DivisionId"; prmList[5] = objEWA.DivisionId; prmList[6] = "@OrgId"; prmList[7] = objEWA.OrgId; ds = ObjHelper.FillControl(prmList, "SP_LeavingCertificate"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } } catch (Exception ex) { throw ex; } return(ds); }
//Get Student Information #region [Get Student Information] public DataSet GetStudentInformation(EWA_LC objEWA) { DataSet ds = new DataSet(); try { prmList = new string[8]; prmList[0] = "@Action"; prmList[1] = "GetStudentInformation"; prmList[2] = "@OrgId"; prmList[3] = objEWA.OrgId; prmList[4] = "@AcademicYearId"; prmList[5] = Convert.ToString(objEWA.AcademicYearId); prmList[6] = "@StudentId"; prmList[7] = objEWA.StudentId; //Stored procedure name ds = ObjHelper.FillControl(prmList, "SP_LeavingCertificate"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } } catch (Exception exp) { throw exp; } return(ds); }
//Return Application Id #region Get Application Id public DataSet DL_StudentLC(EWA_LC objEWA) { DataSet ds = new DataSet(); try { prmList = new string[8]; prmList[0] = "@Action"; prmList[1] = "FetchLCRecord"; prmList[2] = "@OrgId"; prmList[3] = Convert.ToString(objEWA.OrgId); prmList[4] = "@AcademicYearId"; prmList[5] = Convert.ToString(objEWA.AcademicYearId); prmList[6] = "@StudentId_Name"; prmList[7] = objEWA.StudentId_Name; ds = ObjHelper.FillControl(prmList, "SP_LeavingCertificate"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } } catch (Exception exp) { throw exp; } return(ds); }
//Check Duplicate Record in Leaving Certificate #region [Duplicate Record Findind] public DataSet CheckDuplicateRecord_DL(EWA_LC objEWA) { DataSet ds = new DataSet(); try { prmList = new string[6]; prmList[0] = "@Action"; prmList[1] = "CheckDuplicateRecord"; prmList[2] = "@StudentId"; prmList[3] = objEWA.StudentId; prmList[4] = "@OrgId"; prmList[5] = objEWA.OrgId; //Stored procedure name ds = ObjHelper.FillControl(prmList, "SP_LeavingCertificate"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } else { } } catch (Exception) { throw; } return(ds); }
public int BL_SaveUpdateLC(EWA_LC objEWA) { DL_LC objDL = new DL_LC(); try { int flag = objDL.SaveUpdateLC_DL(objEWA); return flag; } catch (Exception ex) { throw ex; } }
public DataSet BL_StudentLC(EWA_LC objEWA) { try { DL_LC objDL = new DL_LC(); DataSet ds = objDL.DL_StudentLC(objEWA); return ds; } catch (Exception) { throw; } }
public DataSet BL_LeavingCertificate(EWA_LC objEWA) { try { DL_LC objDL = new DL_LC(); DataSet ds = objDL.DL_LeavingCertificate(objEWA); return ds; } catch (Exception) { throw; } }
public DataSet BL_GetStudentInformation(EWA_LC objEWA) { try { DL_LC objDL = new DL_LC(); DataSet ds = objDL.GetStudentInformation(objEWA); return ds; } catch (Exception) { throw; } }
public DataSet BL_CheckDuplicateRecord(EWA_LC objEWA) { try { DL_LC objDL = new DL_LC(); DataSet ds = objDL.CheckDuplicateRecord_DL(objEWA); return ds; } catch (Exception) { throw; } }
public DataSet GetStudentAllRecord(EWA_LC objEWA) { try { DL_LC objDL = new DL_LC(); DataSet ds = objDL.GetStudentAllRecord(objEWA); return ds; } catch (Exception) { throw; } }
//Save Leaving Certificate #region Save LC public int SaveUpdateLC_DL(EWA_LC objEWA) { try { cmd = new SqlCommand("SP_LeavingCertificate", con); cmd.CommandType = CommandType.StoredProcedure; //Save Student Leaving Certificate cmd.Parameters.AddWithValue("@Action", objEWA.Action); cmd.Parameters.AddWithValue("@UserCode", objEWA.StudentId); cmd.Parameters.AddWithValue("@AcademicYearId", objEWA.AcademicYearId); cmd.Parameters.AddWithValue("@StudentName", objEWA.FullName); cmd.Parameters.AddWithValue("@Caste", objEWA.Caste); cmd.Parameters.AddWithValue("@Nationality", objEWA.Nationality); cmd.Parameters.AddWithValue("@BirthPlace", objEWA.BirthPlace); cmd.Parameters.AddWithValue("@DOB", objEWA.DOB); cmd.Parameters.AddWithValue("@LastSchoolAttended", objEWA.LastSchoolAttended); cmd.Parameters.AddWithValue("@DateOfAdmission", objEWA.DateOfAdmission); cmd.Parameters.AddWithValue("@Progress", objEWA.Progress); cmd.Parameters.AddWithValue("@Behaviour", objEWA.Behaviour); cmd.Parameters.AddWithValue("@DateOfLeaving", objEWA.DateOfLeaving); cmd.Parameters.AddWithValue("@YearStudying", objEWA.YearStudying); cmd.Parameters.AddWithValue("@Reaseon", objEWA.Reaseon); cmd.Parameters.AddWithValue("@Remarks", objEWA.Remarks); cmd.Parameters.AddWithValue("@TodayDate", objEWA.TodayDate); //pass OrgId cmd.Parameters.AddWithValue("@OrgId", objEWA.OrgId); con.Open(); int flag = cmd.ExecuteNonQuery(); con.Close(); return(flag); } catch (Exception ex) { throw ex; } }
//Get Student Information #region [Get Student Information] protected void btnGo_Click(object sender, EventArgs e) { //ddlStudentId.Items.Insert(0, "Select"); btnSave.Enabled = true; btnClear.Enabled = true; btnUpdate.Enabled = true; txtStudentName.ReadOnly = false; txtStudentCaste.ReadOnly = false; txtNationality.ReadOnly = false; txtBirthPlace.ReadOnly = false; txtDOB.ReadOnly = false; txtLastSchoolAttended.ReadOnly = false; txtDateOfAdmission.ReadOnly = false; txtYearOfStudying.ReadOnly = false; btnPrint.Enabled = true; //panDetails.Visible = true; EWA_LC objEWA = new EWA_LC(); BL_LC objBL = new BL_LC(); try { if (txtStudentId.Text != "") { objEWA.OrgId = Session["OrgId"].ToString(); objEWA.AcademicYearId = 1; objEWA.StudentId = txtStudentId.Text; DataSet dsUpdate = objBAL.BL_CheckDuplicateRecord(objEWA); if (dsUpdate.Tables[0].Rows.Count > 0) { panDetails.Visible = true; ViewState["StudentData"] = dsUpdate; ClearControl(); txtStudentName.Text = dsUpdate.Tables[0].Rows[0]["StudentName"].ToString(); txtStudentCaste.Text = dsUpdate.Tables[0].Rows[0]["Caste"].ToString(); txtNationality.Text = dsUpdate.Tables[0].Rows[0]["Nationality"].ToString(); txtBirthPlace.Text = dsUpdate.Tables[0].Rows[0]["BirthPlace"].ToString(); txtDOB.Text = DateTime.Parse(dsUpdate.Tables[0].Rows[0]["DOB"].ToString()).ToString("dd/MM/yyyy"); txtLastSchoolAttended.Text = dsUpdate.Tables[0].Rows[0]["LastSchoolAttended"].ToString(); txtDateOfAdmission.Text = DateTime.Parse(dsUpdate.Tables[0].Rows[0]["DateOfAdmission"].ToString()).ToString("dd/MM/yyyy"); txtYearOfStudying.Text = DateTime.Parse(dsUpdate.Tables[0].Rows[0]["YearStudying"].ToString()).ToString("dd/MM/yyyy"); txtTodayDate.Text = DateTime.Parse(dsUpdate.Tables[0].Rows[0]["TodayDate"].ToString()).ToString("dd/MM/yyyy"); txtDateOfLeaving.Text = DateTime.Parse(dsUpdate.Tables[0].Rows[0]["DateOfLeaving"].ToString()).ToString("dd/MM/yyyy"); ddlProgress.Items.FindByText(dsUpdate.Tables[0].Rows[0]["Progress"].ToString()).Selected = true; ddlBehaviour.Items.FindByText(dsUpdate.Tables[0].Rows[0]["Behaviour"].ToString()).Selected = true; txtReaseon.Text = dsUpdate.Tables[0].Rows[0]["Reaseon"].ToString(); txtRemarks.Text = dsUpdate.Tables[0].Rows[0]["Remarks"].ToString(); ViewState["ApplicationId"] = dsUpdate.Tables[0].Rows[0]["ApplicationId"].ToString(); ViewState["UserCode"] = dsUpdate.Tables[0].Rows[0]["UserCode"].ToString(); lblIssuedDate.Text = "Issued On : " + DateTime.Parse(dsUpdate.Tables[0].Rows[0]["TodayDate"].ToString()).ToString("dd/MM/yyyy"); lblIssuedDate.Visible = true; chkDuplicateCopy.Visible = true; btnPrint.Enabled = true; btnSave.Enabled = false; } else { DataSet ds = objBL.BL_GetStudentInformation(objEWA); if (ds.Tables[0].Rows.Count > 0) { panDetails.Visible = true; ControlVisible(); ClearControl(); txtStudentName.Text = ds.Tables[0].Rows[0]["FullName"].ToString(); txtStudentCaste.Text = ds.Tables[0].Rows[0]["Religion"].ToString(); txtNationality.Text = ds.Tables[0].Rows[0]["Nationality"].ToString(); txtBirthPlace.Text = ds.Tables[0].Rows[0]["BirthPlace"].ToString(); txtDOB.Text = DateTime.Parse(ds.Tables[0].Rows[0]["BirthDate"].ToString()).ToString("dd/MM/yyyy"); txtLastSchoolAttended.Text = ds.Tables[0].Rows[0]["LastInstitute"].ToString(); txtDateOfAdmission.Text = DateTime.Parse(ds.Tables[0].Rows[0]["AdmissionDate"].ToString()).ToString("dd/MM/yyyy"); txtYearOfStudying.Text = DateTime.Parse(ds.Tables[0].Rows[0]["AdmissionDate"].ToString()).ToString("dd/MM/yyyy"); btnUpdate.Enabled = false; lblIssuedDate.Visible = false; btnPrint.Enabled = false; } else { panDetails.Visible = false; //GeneralErr("Please Check Student Id!!!"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('Please Check Student Id!!!')", true); } } } else { // GeneralErr("Please Enter Student Id!!!"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('Please Enter Student Id!!!')", true); } } catch (Exception) { } }
//Perform To Action for Save Student Leaving Certificate #region [Save Action Perform] protected void Action(String strAction) { try { EWA_LC objEWA = new EWA_LC(); BL_LC objBAL = new BL_LC(); try { //ViewState["StudentId"] = txtStudentId.Text; objEWA.Action = strAction; objEWA.StudentId = txtStudentId.Text; objEWA.AcademicYearId = Convert.ToInt32(Session["AcademicYearId"].ToString()); objEWA.OrgId = Session["OrgId"].ToString(); objEWA.TodayDate = Convert.ToDateTime(txtTodayDate.Text); objEWA.FullName = txtStudentName.Text; objEWA.Caste = txtStudentCaste.Text; objEWA.Nationality = txtNationality.Text; objEWA.BirthPlace = txtBirthPlace.Text; objEWA.DOB = Convert.ToDateTime(txtDOB.Text); objEWA.LastSchoolAttended = txtLastSchoolAttended.Text; objEWA.DateOfAdmission = Convert.ToDateTime(txtDateOfAdmission.Text); objEWA.Progress = ddlProgress.SelectedValue.ToString(); objEWA.Behaviour = ddlBehaviour.SelectedValue.ToString(); txtDateOfLeaving.ReadOnly = true; objEWA.DateOfLeaving = Convert.ToDateTime(txtDateOfLeaving.Text); txtDateOfLeaving.ReadOnly = true; objEWA.YearStudying = Convert.ToDateTime(txtYearOfStudying.Text); objEWA.Reaseon = txtReaseon.Text; objEWA.Remarks = txtRemarks.Text; objEWA.OrgId = Session["OrgId"].ToString(); int flag = objBAL.BL_SaveUpdateLC(objEWA); if (flag > 0) { ClearControl(); if (strAction == "Save") { msgBox.ShowMessage("Record Saved Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull); } else if (strAction == "Update") { msgBox.ShowMessage("Record Updated Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull); } } else { if (strAction == "Save") { msgBox.ShowMessage("Unable to Saved !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical); } else if (strAction == "Update") { msgBox.ShowMessage("Unable to Update !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical); } } } catch (Exception exp) { throw exp; } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
public DataSet BindUsercode_BL(EWA_LC objEWA) { DL_LC objDL = new DL_LC(); DataSet ds = objDL.BindUsercode_DL(objEWA); return ds; }