//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()); } }