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>"); } }
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>"); } }