public void BindEmployeeList() { string[] FieldstoDisplay; FieldstoDisplay = ViewState["Feilds"].ToString().Split(','); ApplicationResult objResult = new ApplicationResult(); EmployeeMBL objEmployeeBl = new EmployeeMBL(); objResult = objEmployeeBl.EmployeeM_Select_ForList(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]), Convert.ToInt32(ddlDepartment.SelectedValue), Convert.ToInt32(ddlDesignation.SelectedValue), Convert.ToInt32(ddlEmployeeRole.SelectedValue)); if (objResult.resultDT.Rows.Count > 0) { for (int i = 87; i > 0; i--) { if (FieldstoDisplay.Contains(i.ToString()) == false) { objResult.resultDT.Columns.Remove(objResult.resultDT.Columns[i - 1]); } } gvReport.DataSource = objResult.resultDT; gvReport.DataBind(); divReport.Visible = true; //btnPrintDetail.Visible = true; pnlEmployeeInfo.Visible = false; lblTrust.Text = Session[ApplicationSession.TRUSTNAME].ToString(); if (ddlDepartment.SelectedValue == "-1") { lblDepartmenmt.Text = "All"; } else { lblDepartmenmt.Text = ddlDepartment.SelectedItem.ToString(); } if (ddlDesignation.SelectedValue == "-1") { lblDesignation.Text = "All"; } else { lblDesignation.Text = ddlDesignation.SelectedItem.ToString(); } if (ddlEmployeeRole.SelectedValue == "-1") { lblRole.Text = "All"; } else { lblRole.Text = ddlEmployeeRole.SelectedItem.ToString(); } } else { divReport.Visible = false; // btnPrintDetail.Visible = false; ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true); pnlEmployeeInfo.Visible = true; ClearAll(); } }
public void BindEmployeeDataList() { ApplicationResult objResult = new ApplicationResult(); EmployeeMBL objEmployeeBl = new EmployeeMBL(); objResult = objEmployeeBl.EmployeeM_Select_InformationForReport(Convert.ToInt32(hfEmployeeMID.Value)); dlEmployee.DataSource = objResult.resultDT; dlEmployee.DataBind(); dlEmployee1.DataSource = objResult.resultDT; dlEmployee1.DataBind(); if (objResult.resultDT.Rows.Count > 0) { divEmployee.Visible = true; pnlEmployeeInfo.Visible = false; btnPrintDetail.Visible = true; btnBack1.Visible = true; } else { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true); divEmployee.Visible = false; btnPrintDetail.Visible = false; pnlEmployeeInfo.Visible = true; btnBack1.Visible = false; ClearAll(); } }
protected void btnGo_OnClick(object sender, EventArgs e) { try { EmployeeMBL objEmployeeBL = new EmployeeMBL(); EmployeeMBO objEmployeeBO = new EmployeeMBO(); ApplicationResult objResultProgram = new ApplicationResult(); objResultProgram = objEmployeeBL.Employee_Search_By_NameAndCode(txtSearchName.Text, Convert.ToInt32(ddlSearchBy.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID])); if (objResultProgram != null) { if (objResultProgram.resultDT.Rows.Count > 0) { gvEmployee.Visible = true; gvEmployee.DataSource = objResultProgram.resultDT; gvEmployee.DataBind(); } else { ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='javascript'>alert('No Record Found.');</script>"); gvEmployee.Visible = false; } } PanelVisibility(false, false, false, false); } catch (Exception ex) { logger.Error("Error", ex); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>"); } }
//#region Go button Event //protected void btnGo_Click(object sender, EventArgs e) //{ // BindStudentList(); //} //#endregion #region Bind Student Gridview public void BindStudentList() { ApplicationResult objResult = new ApplicationResult(); EmployeeMBL objEmployeeBl = new EmployeeMBL(); objResult = objEmployeeBl.EmployeeMDetail_ForCategoryWiseReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID])); if (objResult.resultDT.Rows.Count > 0) { gvReport.DataSource = objResult.resultDT; gvReport.DataBind(); gvReport1.DataSource = objResult.resultDT; gvReport1.DataBind(); divReport.Visible = true; //btnPrintDetail.Visible = true; //pnlStudentInfo.Visible = false; lblSchoolName.Text = "નવચેતન અંગ્રેજી અને ગુજરાતી માધ્યમિક શાળા, ખરચ"; lblSchoolName1.Text = "નવચેતન અંગ્રેજી અને ગુજરાતી માધ્યમિક શાળા, ખરચ"; } else { divReport.Visible = false; // btnPrintDetail.Visible = false; // pnlStudentInfo.Visible = true; ClearAll(); ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true); } }
public static string[] GetAllEmployeeNameForReport(string prefixText, int TrustMID, int SchoolMID) { EmployeeMBL objEmployeeMbl = new EmployeeMBL(); ApplicationResult objResult = new ApplicationResult(); string strSearchText = prefixText + "%"; List <string> result = new List <string>(); objResult = objEmployeeMbl.EmployeeM_Select_ForAutoComplete(strSearchText, TrustMID, SchoolMID); if (objResult != null) { for (int i = 0; i < objResult.resultDT.Rows.Count; i++) { string strEmployeeCodeName = objResult.resultDT.Rows[i]["EmployeeName"].ToString(); string strEmployeeMID = objResult.resultDT.Rows[i][EmployeeMBO.EMPLOYEEM_EMPLOYEEMID].ToString(); result.Add(string.Format("{0}~{1}", strEmployeeCodeName, strEmployeeMID)); } } return(result.ToArray()); }
protected void BindEmpolyeeGrid() { try { EmployeeattendanceBl objEmployeeAttendenceBL = new EmployeeattendanceBl(); ApplicationResult objResult = new ApplicationResult(); EmployeeMBL objEmployeeBL = new EmployeeMBL(); objResult = objEmployeeBL.Select_Employee_ForAttandance(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID])); if (objResult != null) { gvEmployee.DataSource = objResult.resultDT; gvEmployee.DataBind(); if (objResult.resultDT.Rows.Count > 0) { divGrid.Visible = true; btnSave.Enabled = true; gvEmployee.Visible = true; objResult = objEmployeeAttendenceBL.Select_Employee_ForAttandanceDateWise(txtdate.Text); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { ViewState["Mode"] = "Edit"; ViewState["EmployeeAttendenceMID"] = objResult.resultDT.Rows[0][EmployeeattendanceBo.EMPLOYEEATTENDANCE_EMPLOYEEATTANDENCEMID].ToString(); foreach (GridViewRow row in gvEmployee.Rows) { for (int i = 0; i < objResult.resultDT.Rows.Count; i++) { if (row.Cells[0].Text == objResult.resultDT.Rows[i][ EmployeeattendanceBo.EMPLOYEEATTENDANCE_EMPLOYEEMID].ToString()) { ((CheckBox)row.FindControl("chkChild")).Checked = true; (((TextBox)row.FindControl("txtIntime")).Text) = objResult.resultDT.Rows[i][ EmployeeattendanceBo.EMPLOYEEATTENDANCE_INTIME].ToString(); (((TextBox)row.FindControl("txtOuttime")).Text) = objResult.resultDT.Rows[i][ EmployeeattendanceBo.EMPLOYEEATTENDANCE_OUTTIME].ToString(); (((Label)row.FindControl("lblTime")).Text) = objResult.resultDT.Rows[i][ EmployeeattendanceBo.EMPLOYEEATTENDANCE_TIME].ToString(); (((TextBox)row.FindControl("txtTotalTime")).Text) = objResult.resultDT.Rows[i][ EmployeeattendanceBo.EMPLOYEEATTENDANCE_TotalTime].ToString(); } } } } else { ViewState["Mode"] = "Save"; Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "CheckAll();", true); } } } else { btnSave.Enabled = false; divGrid.Visible = false; ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='javascript'>alert('Insert Employee For Attendence.');</script>"); } } } catch (Exception ex) { logger.Error("Error", ex); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>"); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { if (Session[ApplicationSession.USERID] == null) { lblMsg.Visible = false; EmployeeMBL objEmployeeMBL = new EmployeeMBL(); ApplicationResult objResult = new ApplicationResult(); objResult = objEmployeeMBL.Employee_CheckForLogin(txtUsername.Text.Trim(), txtPassword.Text.Trim()); if (objResult != null) { DataTable dtEmployee = new DataTable(); dtEmployee = objResult.resultDT; if (dtEmployee.Rows.Count > 0) { Session[ApplicationSession.USERID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_EMPLOYEEMID].ToString(); Session[ApplicationSession.USERNAME] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_USERNAME].ToString(); Session[ApplicationSession.ROLEID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_ROLEID].ToString(); Session[ApplicationSession.SCHOOLID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); //if (dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString() == "0") //{ // Session[ApplicationSession.TRUSTID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_TRUSTMID].ToString(); //} //else if (dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString() != "0") //{ // Session[ApplicationSession.TRUSTID] = dtEmployee.Rows[0]["SchTrustMID"].ToString(); // //Session[ApplicationSession.TRUSTID] = "0"; //} //if (dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString() != "0") //{ // Session[ApplicationSession.SCHOOLID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); //} //log4net.LogicalThreadContext.Properties["UserID"] = Convert.ToInt32(Session[ApplicationSession.USERID]); //logger.Info("User Login"); if (dtEmployee.Rows[0]["TrustMID"].ToString() != "0" && dtEmployee.Rows[0]["SchoolMID"].ToString() == "0") { Session[ApplicationSession.TRUSTID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_TRUSTMID].ToString(); Session[ApplicationSession.TRUSTNAME] = dtEmployee.Rows[0]["TrustNameEng"].ToString(); Session[ApplicationSession.SCHOOLID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); Session[ApplicationSession.ISPANEL] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); Response.Redirect("Client.UI/TrustHome.aspx", false); } else if (dtEmployee.Rows[0]["SchoolMID"].ToString() != "0") { Session[ApplicationSession.TRUSTID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_TRUSTMID].ToString(); Session[ApplicationSession.TRUSTNAME] = dtEmployee.Rows[0]["TrustNameEng"].ToString(); Session[ApplicationSession.SCHOOLID] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); Session[ApplicationSession.SCHOOLNAME] = dtEmployee.Rows[0]["SchoolNameEng"].ToString(); Session[ApplicationSession.ISPANEL] = dtEmployee.Rows[0][EmployeeMBO.EMPLOYEEM_SCHOOLMID].ToString(); Response.Redirect("Client.UI/SchoolHome.aspx", false); } else { Response.Redirect("../UserLogin.aspx", false); } } else { lblMsg.Visible = true; lblMsg.Text = "UserName or Password Incorrect."; txtPassword.Text = ""; txtUsername.Text = ""; } } else { lblMsg.Visible = true; lblMsg.Text = "UserName or Password Incorrect."; txtPassword.Text = ""; txtUsername.Text = ""; } } else { int UserId = 0; UserId = Convert.ToInt32(ApplicationSession.USERID); Session.Abandon(); Response.Redirect("UserLogin.aspx", false); //if (UserId != null || UserId != 0) //{ // Response.Redirect("Client.UI/TrustHome.aspx", false); //} //lblMsg.Visible = true; //lblMsg.Text = "User Already Logged In."; } } catch (Exception ex) { throw ex; } }
public void ProcessRequest(HttpContext context) { DataTable dtResult = new DataTable(); SchoolBL objSchoolBL = new SchoolBL(); StudentBL objStudentBL = new StudentBL(); EmployeeMBL objEmployeeBL = new EmployeeMBL(); TrustBL objTrustBL = new TrustBL(); ApplicationResult objResult = new ApplicationResult(); Controls objControl = new Controls(); byte[] imgByte = { }; if (context.Request.QueryString["StudentMID"] != null) { objResult = objStudentBL.Student_Select(Convert.ToInt32(context.Request.QueryString["StudentMID"].ToString()), 0); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { imgByte = (byte[])objResult.resultDT.Rows[0]["StudentPhoto"]; } } } else if (context.Request.QueryString["SchoolMID"] != null) { objResult = objSchoolBL.School_Select(Convert.ToInt32(context.Request.QueryString["SchoolMID"].ToString())); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { imgByte = (byte[])objResult.resultDT.Rows[0]["SchoolLogo"]; } } } else if (context.Request.QueryString["EmployeeMID"] != null) { objResult = objEmployeeBL.EmployeeM_Select(Convert.ToInt32(context.Request.QueryString["EmployeeMID"].ToString())); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { imgByte = (byte[])objResult.resultDT.Rows[0]["Photo"]; } } } else { objResult = objTrustBL.Trust_Select(Convert.ToInt32(context.Request.QueryString["TrustMID"].ToString())); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { imgByte = (byte[])objResult.resultDT.Rows[0]["TrustLogo"]; } } } // objResult = objVisitorBL.Visitor_Select(1); context.Response.BinaryWrite(imgByte); context.Response.End(); context.Response.Clear(); context.Response.ClearHeaders(); context.Response.ClearContent(); }
protected void btnSave_Click(object sender, EventArgs e) { try { EmployeeMBO objEmployeeBo = new EmployeeMBO(); ApplicationResult objResults = new ApplicationResult(); EmployeeMBL objEmployeeBl = new EmployeeMBL(); Controls objControls = new Controls(); DatabaseTransaction.OpenConnectionTransation(); for (int i = 0; i < gvExcelFile.Rows.Count; i++) { if (ddlOrganisation.SelectedItem.Text == "Trust") { objEmployeeBo.TrustMID = Convert.ToInt32(ddlOrgName.SelectedValue); objEmployeeBo.SchoolMID = 0; } else { objEmployeeBo.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]); objEmployeeBo.SchoolMID = Convert.ToInt32(ddlOrgName.SelectedValue); } objEmployeeBo.DepartmentID = Convert.ToInt32(ddlDepartment.SelectedValue); objEmployeeBo.DesignationID = Convert.ToInt32(ddldesignation.SelectedValue); objEmployeeBo.EmployeeCode = gvExcelFile.Rows[i].Cells[0].Text.Replace(" ", ""); objEmployeeBo.EmployeeFNameENG = gvExcelFile.Rows[i].Cells[1].Text.Replace(" ", ""); objEmployeeBo.EmployeeFNameGUJ = gvExcelFile.Rows[i].Cells[2].Text.Replace(" ", ""); objEmployeeBo.EmployeeLNameENG = gvExcelFile.Rows[i].Cells[3].Text.Replace(" ", ""); objEmployeeBo.EmployeeLNameGUJ = gvExcelFile.Rows[i].Cells[4].Text.Replace(" ", ""); objEmployeeBo.EmployeeMNameENG = gvExcelFile.Rows[i].Cells[5].Text.Replace(" ", ""); objEmployeeBo.EmployeeMNameGUJ = gvExcelFile.Rows[i].Cells[6].Text.Replace(" ", ""); objEmployeeBo.Photo = ImageToByteArrayFromFilePath("../Images/NoImage-big.jpg"); objEmployeeBo.Gender = gvExcelFile.Rows[i].Cells[7].Text.Replace(" ", ""); objEmployeeBo.GenderGuj = gvExcelFile.Rows[i].Cells[8].Text.Replace(" ", ""); objEmployeeBo.DateOfBirth = gvExcelFile.Rows[i].Cells[9].Text.Replace(" ", ""); objEmployeeBo.BirthDistrictENG = gvExcelFile.Rows[i].Cells[10].Text.Replace(" ", ""); objEmployeeBo.BirthDistrictGUJ = gvExcelFile.Rows[i].Cells[11].Text.Replace(" ", ""); objEmployeeBo.BirthTalukaENG = gvExcelFile.Rows[i].Cells[12].Text.Replace(" ", ""); objEmployeeBo.BirthTalukaGUJ = gvExcelFile.Rows[i].Cells[13].Text.Replace(" ", ""); objEmployeeBo.BirthCityVillageENG = gvExcelFile.Rows[i].Cells[14].Text.Replace(" ", ""); objEmployeeBo.BirthCityVillageGUJ = gvExcelFile.Rows[i].Cells[15].Text.Replace(" ", ""); objEmployeeBo.NationalityENG = gvExcelFile.Rows[i].Cells[16].Text.Replace(" ", ""); objEmployeeBo.NationalityGUJ = gvExcelFile.Rows[i].Cells[17].Text.Replace(" ", ""); objEmployeeBo.ReligionENG = gvExcelFile.Rows[i].Cells[18].Text.Replace(" ", ""); objEmployeeBo.ReligionGUJ = gvExcelFile.Rows[i].Cells[19].Text.Replace(" ", ""); objEmployeeBo.Caste = gvExcelFile.Rows[i].Cells[20].Text.Replace(" ", ""); objEmployeeBo.MaritalStatus = gvExcelFile.Rows[i].Cells[21].Text.Replace(" ", ""); objEmployeeBo.BloodGroup = gvExcelFile.Rows[i].Cells[22].Text.Replace(" ", ""); objEmployeeBo.MotherLanguage = gvExcelFile.Rows[i].Cells[23].Text.Replace(" ", ""); objEmployeeBo.CurrentAddressENG = gvExcelFile.Rows[i].Cells[24].Text.Replace(" ", ""); objEmployeeBo.CurrentAddressGUJ = gvExcelFile.Rows[i].Cells[25].Text.Replace(" ", ""); objEmployeeBo.CurrentLandmarkENG = gvExcelFile.Rows[i].Cells[26].Text.Replace(" ", ""); objEmployeeBo.CurrentLandmarkGUJ = gvExcelFile.Rows[i].Cells[27].Text.Replace(" ", ""); objEmployeeBo.CurrentCityENG = gvExcelFile.Rows[i].Cells[28].Text.Replace(" ", ""); objEmployeeBo.CurrentCityGUJ = gvExcelFile.Rows[i].Cells[29].Text.Replace(" ", ""); objEmployeeBo.CurrentStateENG = gvExcelFile.Rows[i].Cells[30].Text.Replace(" ", ""); objEmployeeBo.CurrentStateGUJ = gvExcelFile.Rows[i].Cells[31].Text.Replace(" ", ""); objEmployeeBo.CurrentPinCode = gvExcelFile.Rows[i].Cells[32].Text.Replace(" ", ""); objEmployeeBo.PermenantAddressEng = gvExcelFile.Rows[i].Cells[33].Text.Replace(" ", ""); objEmployeeBo.PermenantAddressGuj = gvExcelFile.Rows[i].Cells[34].Text.Replace(" ", ""); objEmployeeBo.PermenantCityEng = gvExcelFile.Rows[i].Cells[35].Text.Replace(" ", ""); objEmployeeBo.PermenantCityGuj = gvExcelFile.Rows[i].Cells[36].Text.Replace(" ", ""); objEmployeeBo.PermenantLandmarkEng = gvExcelFile.Rows[i].Cells[37].Text.Replace(" ", ""); objEmployeeBo.PermenantLandmarkGuj = gvExcelFile.Rows[i].Cells[38].Text.Replace(" ", ""); objEmployeeBo.PermenantStateEng = gvExcelFile.Rows[i].Cells[39].Text.Replace(" ", ""); objEmployeeBo.PermenantStateGuj = gvExcelFile.Rows[i].Cells[40].Text.Replace(" ", ""); objEmployeeBo.PermenantPincode = gvExcelFile.Rows[i].Cells[41].Text.Replace(" ", ""); objEmployeeBo.TelephoneNo = gvExcelFile.Rows[i].Cells[42].Text.Replace(" ", ""); objEmployeeBo.MobileNo = gvExcelFile.Rows[i].Cells[43].Text.Replace(" ", ""); objEmployeeBo.EmailId = gvExcelFile.Rows[i].Cells[44].Text.Replace(" ", ""); objEmployeeBo.Hobbies = gvExcelFile.Rows[i].Cells[45].Text.Replace(" ", ""); objEmployeeBo.RightVision = ""; objEmployeeBo.LeftVision = ""; objEmployeeBo.RectificationDevice = ""; objEmployeeBo.Height = ""; objEmployeeBo.Weight = ""; objEmployeeBo.PhysicalIdentificationENG = gvExcelFile.Rows[i].Cells[46].Text.Replace(" ", ""); objEmployeeBo.PhysicalIdentificationGUJ = gvExcelFile.Rows[i].Cells[47].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenFNameENG = gvExcelFile.Rows[i].Cells[48].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenFNameGUJ = gvExcelFile.Rows[i].Cells[49].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenLNameENG = gvExcelFile.Rows[i].Cells[52].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenLNameGUJ = gvExcelFile.Rows[i].Cells[53].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenMNameENG = gvExcelFile.Rows[i].Cells[50].Text.Replace(" ", ""); objEmployeeBo.MotherMaidenMNameGUJ = gvExcelFile.Rows[i].Cells[51].Text.Replace(" ", ""); objEmployeeBo.BankName = gvExcelFile.Rows[i].Cells[54].Text.Replace(" ", ""); objEmployeeBo.BranchName = gvExcelFile.Rows[i].Cells[55].Text.Replace(" ", ""); objEmployeeBo.BranchCode = gvExcelFile.Rows[i].Cells[56].Text.Replace(" ", ""); objEmployeeBo.AccountNo = gvExcelFile.Rows[i].Cells[57].Text.Replace(" ", ""); objEmployeeBo.PFNo = gvExcelFile.Rows[i].Cells[58].Text.Replace(" ", ""); objEmployeeBo.PANNo = gvExcelFile.Rows[i].Cells[59].Text.Replace(" ", ""); objEmployeeBo.ESICNo = gvExcelFile.Rows[i].Cells[60].Text.Replace(" ", ""); objEmployeeBo.IFSCCode = gvExcelFile.Rows[i].Cells[61].Text.Replace(" ", ""); objEmployeeBo.GPFAccountNo = gvExcelFile.Rows[i].Cells[62].Text.Replace(" ", ""); objEmployeeBo.CPFAccountNo = gvExcelFile.Rows[i].Cells[63].Text.Replace(" ", ""); objEmployeeBo.DepartmentJoiningDate = gvExcelFile.Rows[i].Cells[64].Text.Replace(" ", ""); objEmployeeBo.OrganisationJoiningDate = gvExcelFile.Rows[i].Cells[65].Text.Replace(" ", ""); objEmployeeBo.TypeOfAppointment = "Direct"; objEmployeeBo.ReplacementSchoolInfoENG = ""; objEmployeeBo.ReplacementSchoolInfoGUJ = ""; objEmployeeBo.RetirementDate = gvExcelFile.Rows[i].Cells[66].Text.Replace(" ", ""); objEmployeeBo.TermEndRetirementDate = gvExcelFile.Rows[i].Cells[67].Text.Replace(" ", ""); objEmployeeBo.IsResigned = 0; objEmployeeBo.ResignedDate = ""; objEmployeeBo.ResignReasonEng = ""; objEmployeeBo.ResignReasonGuj = ""; objEmployeeBo.BreakInfoENG = gvExcelFile.Rows[i].Cells[68].Text.Replace(" ", ""); objEmployeeBo.BreakInfoGUJ = gvExcelFile.Rows[i].Cells[69].Text.Replace(" ", ""); objEmployeeBo.OtherAchivementDetailsENG = gvExcelFile.Rows[i].Cells[70].Text.Replace(" ", ""); objEmployeeBo.OtherAchivementDetailsGUJ = gvExcelFile.Rows[i].Cells[71].Text.Replace(" ", ""); objEmployeeBo.IsUser = Convert.ToInt32(gvExcelFile.Rows[i].Cells[72].Text.Replace(" ", "")); objEmployeeBo.UserName = gvExcelFile.Rows[i].Cells[73].Text.Replace(" ", ""); objEmployeeBo.Password = gvExcelFile.Rows[i].Cells[74].Text.Replace(" ", ""); objEmployeeBo.RoleID = Convert.ToInt32(ddlEmployeeRole.SelectedValue); objEmployeeBo.IsTeacher = Convert.ToInt32(gvExcelFile.Rows[i].Cells[75].Text.Replace(" ", ""));; objEmployeeBo.IsPrincipal = Convert.ToInt32(gvExcelFile.Rows[i].Cells[76].Text.Replace(" ", "")); objEmployeeBo.AllowAccountAccess = Convert.ToInt32(gvExcelFile.Rows[i].Cells[77].Text.Replace(" ", "")); objEmployeeBo.CategoryEng = ""; objEmployeeBo.CategoryGuj = ""; objEmployeeBo.LastModifiedDate = DateTime.UtcNow.AddHours(5.5).ToString(); objEmployeeBo.LastModifiedUserID = Convert.ToInt32(Session[ApplicationSession.USERID]); objEmployeeBo.CreatedDate = DateTime.UtcNow.AddHours(5.5).ToString(); objEmployeeBo.CreatedUserID = Convert.ToInt32(Session[ApplicationSession.USERID]); objResults = objEmployeeBl.EmployeeM_Insert(objEmployeeBo); if (objResults != null) { if (objResults.resultDT.Rows.Count > 0) { ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Data Saved Successfully.');</script>"); } } } DatabaseTransaction.CommitTransation(); string Extension = string.Empty; Extension = Path.GetExtension(FileUpload1.FileName); System.IO.File.Delete(Server.MapPath("../_ImportData/" + ddlOrgName.SelectedItem.Text.Replace(" ", "").ToString() + Extension)); } catch (Exception ex) { DatabaseTransaction.RollbackTransation(); logger.Error("Error", ex); string Extension = string.Empty; Extension = Path.GetExtension(FileUpload1.FileName); System.IO.File.Delete(Server.MapPath("../_ImportData/" + ddlOrgName.SelectedItem.Text.Replace(" ", "").ToString() + Extension)); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>"); } }
protected void btnLogIn_Click(object sender, EventArgs e) { try { string strFromDate = txtFrom.Text; string strToDate = txtTo.Text; string LastTwoDigit, strYear; int intNo; LastTwoDigit = strToDate.Substring(strToDate.Length - 2); intNo = Convert.ToInt32(LastTwoDigit) - 1; strYear = intNo.ToString() + LastTwoDigit; LockBL objLockBl = new LockBL(); LockBo objLockBo = new LockBo(); ApplicationResult objResult = new ApplicationResult(); if (chkLock.Checked == true) { objLockBo.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]); objLockBo.SchoolMID = Convert.ToInt32(Session[ApplicationSession.SCHOOLID]); objLockBo.FromDate = strFromDate; objLockBo.ToDate = strToDate; objLockBo.LockYear = Convert.ToInt32(strYear); objResult = objLockBl.Lock_Insert(objLockBo); if (objResult.status == ApplicationResult.CommonStatusType.SUCCESS) { } } else { objResult = objLockBl.Lock_SelectbyYear(Convert.ToInt32(strYear)); if (objResult != null) { if (objResult.resultDT.Rows.Count > 0) { ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('The Data of financial year " + strYear + " has been locked.');</script>"); } else { EmployeeMBL objEmployeeMBL = new EmployeeMBL(); EmployeeMBO objEmployeeMBO = new EmployeeMBO(); ApplicationResult objResultValidate = new ApplicationResult(); objResultValidate = objEmployeeMBL.Employee_CheckForLoginAccount(txtUserName.Text, txtPassword.Text, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID])); if (objResultValidate != null) { DataTable dtResult = new DataTable(); dtResult = objResultValidate.resultDT; if (dtResult.Rows.Count > 0) { if (Convert.ToInt32(Session[ApplicationSession.USERID]) == Convert.ToInt32(dtResult.Rows[0]["EmployeeMID"])) { Session[ApplicationSession.HASACCESSACCOUNTUSERID] = Convert.ToInt32(dtResult.Rows[0]["EmployeeMID"]); Session[ApplicationSession.ACCOUNTFROMDATE] = txtFrom.Text; Session[ApplicationSession.ACCOUNTTODATE] = txtTo.Text; Session[ApplicationSession.FINANCIALYEAR] = strYear; Response.Redirect( Convert.ToInt32(Session[ApplicationSession.SCHOOLID]) == 0 ? "../Accounting/Home.aspx?mode=TU" : "../Accounting/Home.aspx", false); } else { ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Invalid username & password.');</script>"); } } else { ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('You do not have permission to access this module.');</script>"); } } else { } } } } } catch (Exception ex) { logger.Error("Error", ex); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>"); } }