Пример #1
0
        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>");
            }
        }
Пример #2
0
        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("&nbsp;", "");
                    objEmployeeBo.EmployeeFNameENG          = gvExcelFile.Rows[i].Cells[1].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmployeeFNameGUJ          = gvExcelFile.Rows[i].Cells[2].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmployeeLNameENG          = gvExcelFile.Rows[i].Cells[3].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmployeeLNameGUJ          = gvExcelFile.Rows[i].Cells[4].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmployeeMNameENG          = gvExcelFile.Rows[i].Cells[5].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmployeeMNameGUJ          = gvExcelFile.Rows[i].Cells[6].Text.Replace("&nbsp;", "");
                    objEmployeeBo.Photo                     = ImageToByteArrayFromFilePath("../Images/NoImage-big.jpg");
                    objEmployeeBo.Gender                    = gvExcelFile.Rows[i].Cells[7].Text.Replace("&nbsp;", "");
                    objEmployeeBo.GenderGuj                 = gvExcelFile.Rows[i].Cells[8].Text.Replace("&nbsp;", "");
                    objEmployeeBo.DateOfBirth               = gvExcelFile.Rows[i].Cells[9].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthDistrictENG          = gvExcelFile.Rows[i].Cells[10].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthDistrictGUJ          = gvExcelFile.Rows[i].Cells[11].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthTalukaENG            = gvExcelFile.Rows[i].Cells[12].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthTalukaGUJ            = gvExcelFile.Rows[i].Cells[13].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthCityVillageENG       = gvExcelFile.Rows[i].Cells[14].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BirthCityVillageGUJ       = gvExcelFile.Rows[i].Cells[15].Text.Replace("&nbsp;", "");
                    objEmployeeBo.NationalityENG            = gvExcelFile.Rows[i].Cells[16].Text.Replace("&nbsp;", "");
                    objEmployeeBo.NationalityGUJ            = gvExcelFile.Rows[i].Cells[17].Text.Replace("&nbsp;", "");
                    objEmployeeBo.ReligionENG               = gvExcelFile.Rows[i].Cells[18].Text.Replace("&nbsp;", "");
                    objEmployeeBo.ReligionGUJ               = gvExcelFile.Rows[i].Cells[19].Text.Replace("&nbsp;", "");
                    objEmployeeBo.Caste                     = gvExcelFile.Rows[i].Cells[20].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MaritalStatus             = gvExcelFile.Rows[i].Cells[21].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BloodGroup                = gvExcelFile.Rows[i].Cells[22].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherLanguage            = gvExcelFile.Rows[i].Cells[23].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentAddressENG         = gvExcelFile.Rows[i].Cells[24].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentAddressGUJ         = gvExcelFile.Rows[i].Cells[25].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentLandmarkENG        = gvExcelFile.Rows[i].Cells[26].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentLandmarkGUJ        = gvExcelFile.Rows[i].Cells[27].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentCityENG            = gvExcelFile.Rows[i].Cells[28].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentCityGUJ            = gvExcelFile.Rows[i].Cells[29].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentStateENG           = gvExcelFile.Rows[i].Cells[30].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentStateGUJ           = gvExcelFile.Rows[i].Cells[31].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CurrentPinCode            = gvExcelFile.Rows[i].Cells[32].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantAddressEng       = gvExcelFile.Rows[i].Cells[33].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantAddressGuj       = gvExcelFile.Rows[i].Cells[34].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantCityEng          = gvExcelFile.Rows[i].Cells[35].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantCityGuj          = gvExcelFile.Rows[i].Cells[36].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantLandmarkEng      = gvExcelFile.Rows[i].Cells[37].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantLandmarkGuj      = gvExcelFile.Rows[i].Cells[38].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantStateEng         = gvExcelFile.Rows[i].Cells[39].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantStateGuj         = gvExcelFile.Rows[i].Cells[40].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PermenantPincode          = gvExcelFile.Rows[i].Cells[41].Text.Replace("&nbsp;", "");
                    objEmployeeBo.TelephoneNo               = gvExcelFile.Rows[i].Cells[42].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MobileNo                  = gvExcelFile.Rows[i].Cells[43].Text.Replace("&nbsp;", "");
                    objEmployeeBo.EmailId                   = gvExcelFile.Rows[i].Cells[44].Text.Replace("&nbsp;", "");
                    objEmployeeBo.Hobbies                   = gvExcelFile.Rows[i].Cells[45].Text.Replace("&nbsp;", "");
                    objEmployeeBo.RightVision               = "";
                    objEmployeeBo.LeftVision                = "";
                    objEmployeeBo.RectificationDevice       = "";
                    objEmployeeBo.Height                    = "";
                    objEmployeeBo.Weight                    = "";
                    objEmployeeBo.PhysicalIdentificationENG = gvExcelFile.Rows[i].Cells[46].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PhysicalIdentificationGUJ = gvExcelFile.Rows[i].Cells[47].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenFNameENG      = gvExcelFile.Rows[i].Cells[48].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenFNameGUJ      = gvExcelFile.Rows[i].Cells[49].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenLNameENG      = gvExcelFile.Rows[i].Cells[52].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenLNameGUJ      = gvExcelFile.Rows[i].Cells[53].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenMNameENG      = gvExcelFile.Rows[i].Cells[50].Text.Replace("&nbsp;", "");
                    objEmployeeBo.MotherMaidenMNameGUJ      = gvExcelFile.Rows[i].Cells[51].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BankName                  = gvExcelFile.Rows[i].Cells[54].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BranchName                = gvExcelFile.Rows[i].Cells[55].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BranchCode                = gvExcelFile.Rows[i].Cells[56].Text.Replace("&nbsp;", "");
                    objEmployeeBo.AccountNo                 = gvExcelFile.Rows[i].Cells[57].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PFNo                      = gvExcelFile.Rows[i].Cells[58].Text.Replace("&nbsp;", "");
                    objEmployeeBo.PANNo                     = gvExcelFile.Rows[i].Cells[59].Text.Replace("&nbsp;", "");
                    objEmployeeBo.ESICNo                    = gvExcelFile.Rows[i].Cells[60].Text.Replace("&nbsp;", "");
                    objEmployeeBo.IFSCCode                  = gvExcelFile.Rows[i].Cells[61].Text.Replace("&nbsp;", "");
                    objEmployeeBo.GPFAccountNo              = gvExcelFile.Rows[i].Cells[62].Text.Replace("&nbsp;", "");
                    objEmployeeBo.CPFAccountNo              = gvExcelFile.Rows[i].Cells[63].Text.Replace("&nbsp;", "");
                    objEmployeeBo.DepartmentJoiningDate     = gvExcelFile.Rows[i].Cells[64].Text.Replace("&nbsp;", "");
                    objEmployeeBo.OrganisationJoiningDate   = gvExcelFile.Rows[i].Cells[65].Text.Replace("&nbsp;", "");
                    objEmployeeBo.TypeOfAppointment         = "Direct";
                    objEmployeeBo.ReplacementSchoolInfoENG  = "";
                    objEmployeeBo.ReplacementSchoolInfoGUJ  = "";
                    objEmployeeBo.RetirementDate            = gvExcelFile.Rows[i].Cells[66].Text.Replace("&nbsp;", "");
                    objEmployeeBo.TermEndRetirementDate     = gvExcelFile.Rows[i].Cells[67].Text.Replace("&nbsp;", "");
                    objEmployeeBo.IsResigned                = 0;
                    objEmployeeBo.ResignedDate              = "";
                    objEmployeeBo.ResignReasonEng           = "";
                    objEmployeeBo.ResignReasonGuj           = "";
                    objEmployeeBo.BreakInfoENG              = gvExcelFile.Rows[i].Cells[68].Text.Replace("&nbsp;", "");
                    objEmployeeBo.BreakInfoGUJ              = gvExcelFile.Rows[i].Cells[69].Text.Replace("&nbsp;", "");
                    objEmployeeBo.OtherAchivementDetailsENG = gvExcelFile.Rows[i].Cells[70].Text.Replace("&nbsp;", "");
                    objEmployeeBo.OtherAchivementDetailsGUJ = gvExcelFile.Rows[i].Cells[71].Text.Replace("&nbsp;", "");
                    objEmployeeBo.IsUser                    = Convert.ToInt32(gvExcelFile.Rows[i].Cells[72].Text.Replace("&nbsp;", ""));
                    objEmployeeBo.UserName                  = gvExcelFile.Rows[i].Cells[73].Text.Replace("&nbsp;", "");
                    objEmployeeBo.Password                  = gvExcelFile.Rows[i].Cells[74].Text.Replace("&nbsp;", "");
                    objEmployeeBo.RoleID                    = Convert.ToInt32(ddlEmployeeRole.SelectedValue);
                    objEmployeeBo.IsTeacher                 = Convert.ToInt32(gvExcelFile.Rows[i].Cells[75].Text.Replace("&nbsp;", ""));;
                    objEmployeeBo.IsPrincipal               = Convert.ToInt32(gvExcelFile.Rows[i].Cells[76].Text.Replace("&nbsp;", ""));
                    objEmployeeBo.AllowAccountAccess        = Convert.ToInt32(gvExcelFile.Rows[i].Cells[77].Text.Replace("&nbsp;", ""));
                    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>");
            }
        }
Пример #3
0
        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>");
            }
        }