Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
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>");
            }
        }
        //#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);
            }
        }
Exemplo n.º 5
0
        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>");
            }
        }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
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>");
            }
        }
Exemplo n.º 10
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>");
            }
        }