Example #1
0
        //[AllowAnonymous]
        //public CaptchaImageResult ShowCaptchaImage()
        //{
        //    return new CaptchaImageResult();
        //}

        #region Dashboard(AR)

        //[Authorize]
        //[OutputCache(Duration = 300, VaryByParam = "none")]
        public ActionResult Dashboard()
        {
            if (Session["userInfo"] == null)
            {
                return(Redirect(@Url.Action("Index")));
            }
            DashboardDocs _DashboardDocs = null;

            ViewBag.RoleId   = RoleId;
            ViewBag.UserId   = UserId;
            ViewBag.UserName = UserName;
            ViewBag.UserSessionEmployeeId = UserSessionEmployeeId;
            var balance = BAL.PreferencesBAL.GetManageLeaveDetails(this.BusinessId).FirstOrDefault();

            ViewBag.NoOfLeaves = balance == null ? 0 : balance.Leavevalue;
            _DashboardDocs     = BAL.Dashboard.GetDashboardDocs(BusinessId, UserId, RoleId, UserSessionEmployeeId);
            // ViewBag.NoOfLeaves = _DashboardDocs.CountOfNoOfLeaves;
            ViewBag.NoOfResignations   = _DashboardDocs.CountOfNoOfResignations;
            ViewBag.PendingTimesheets  = _DashboardDocs.CountOfPendingTimeSheets;
            ViewBag.NoOfNewJoinees     = _DashboardDocs.CountOfNoOfNewJoinees;
            ViewBag.PayrollHeadCount   = _DashboardDocs.NoOfEmployees;
            ViewBag.PayrollFnfPending  = 0;
            ViewBag.PayrollOnNotice    = 0;
            Session["HeadCount"]       = _DashboardDocs.NoOfEmployees;
            Session["GrossSalary"]     = _DashboardDocs.GrossSalary;
            Session["TotalDeductions"] = _DashboardDocs.TotalDeductions;
            Session["ProvidentFund"]   = _DashboardDocs.ProvidentFund;
            Session["ProfessionTax"]   = _DashboardDocs.ProfessionTax;
            Session["TotalESIC"]       = _DashboardDocs.TotalESIC;
            var loggeduserinfo = (BAL.LoggedUser)Session["userInfo"];

            if (loggeduserinfo.BusinessStatusId != (int)BusinessStatus.Activated)
            {
                return(Redirect(@Url.Action("Index")));
            }

            return(View());
        }
Example #2
0
        public static DashboardDocs GetDashboardDocs(int BusinessId, int UserId, int RoleId, int UserSessionEmployeeId)
        {
            DashboardDocs            _DashboardDocs     = new DashboardDocs();
            List <NoOfLeaves>        _NoOfLeaves        = new List <NoOfLeaves>();
            List <PendingTimeSheets> _PendingTimeSheets = new List <PendingTimeSheets>();
            List <NoOfResignations>  _NoOfResignations  = new List <NoOfResignations>();
            List <NoOfNewJoinees>    _NoOfNewJoinees    = new List <NoOfNewJoinees>();
            List <NoOfEmployessInfo> _NoOfEmployessInfo = new List <NoOfEmployessInfo>();
            List <GrossSalaryInfo>   _GrossSalaryInfo   = new List <GrossSalaryInfo>();
            List <DeductionsInfo>    _DeductionsInfo    = new List <DeductionsInfo>();

            int UserEmployeeId = UserSessionEmployeeId;

            using (var Cmd = new DBSqlCommand())
            {
                try
                {
                    Cmd.AddParameters(BusinessId, CommonConstants.BusinessID, SqlDbType.Int);
                    Cmd.AddParameters(UserId, CommonConstants.UserId, SqlDbType.Int);
                    Cmd.AddParameters(RoleId, CommonConstants.RoleId, SqlDbType.Int);
                    Cmd.AddParameters(UserEmployeeId, CommonConstants.UserEmployeeId, SqlDbType.Int);

                    DataSet ireader  = Cmd.ExecuteDataDataSet(SqlProcedures.usp_EmployeeDashboardDetails);
                    DataSet ireader1 = Cmd.ExecuteDataDataSet(SqlProcedures.usp_HRDashboardDetails);

                    for (var i = 0; i < ireader.Tables[0].Rows.Count; i++)
                    {
                        _DashboardDocs.CountOfNoOfLeaves = (int)ireader.Tables[0].Rows[i]["CountOfNoOfLeaves"];
                    }
                    _DashboardDocs.NoOfLeaves = _NoOfLeaves;

                    for (var i = 0; i < ireader.Tables[0].Rows.Count; i++)
                    {
                        _DashboardDocs.CountOfPendingTimeSheets = (int)ireader.Tables[0].Rows[i]["CountOfPendingTimeSheets"];
                    }
                    _DashboardDocs.PendingTimeSheets = _PendingTimeSheets;

                    for (var i = 0; i < ireader.Tables[0].Rows.Count; i++)
                    {
                        _DashboardDocs.CountOfNoOfResignations = (int)ireader.Tables[0].Rows[i]["CountOfNoOfResignations"];
                    }
                    _DashboardDocs.NoOfResignations = _NoOfResignations;

                    for (var i = 0; i < ireader.Tables[0].Rows.Count; i++)
                    {
                        _DashboardDocs.CountOfNoOfNewJoinees = (int)ireader.Tables[0].Rows[i]["CountOfNoOfNewJoinees"];
                    }
                    _DashboardDocs.NoOfNewJoinees = _NoOfNewJoinees;

                    for (var i = 0; i < ireader1.Tables[0].Rows.Count; i++)
                    {
                        _DashboardDocs.NoOfEmployees = (int)ireader1.Tables[0].Rows[i]["EmployeeCount"];
                    }
                    _DashboardDocs.NoOfEmployessInfo = _NoOfEmployessInfo;

                    for (var i = 0; i < ireader1.Tables[1].Rows.Count; i++)
                    {
                        _DashboardDocs.GrossSalary = (decimal)ireader1.Tables[1].Rows[i]["GrossSalary"];
                        _DashboardDocs.TotalESIC   = (decimal)ireader1.Tables[1].Rows[i]["TotalESIC"];
                    }
                    _DashboardDocs.GrossSalaryInfo = _GrossSalaryInfo;

                    for (var i = 0; i < ireader1.Tables[3].Rows.Count; i++)
                    {
                        _DashboardDocs.ProvidentFund   = (decimal)ireader1.Tables[3].Rows[i]["ProvidentFund"];
                        _DashboardDocs.ProfessionTax   = (int)ireader1.Tables[3].Rows[i]["ProfessionTax"];
                        _DashboardDocs.TotalDeductions = (decimal)ireader1.Tables[3].Rows[i]["TotalDeductions"];
                    }
                    _DashboardDocs.DeductionsInfo = _DeductionsInfo;


                    return(_DashboardDocs);
                }
                catch (Exception Ex)
                {
                    throw Ex;
                    throw new ArgumentException("Exception in GetDashboardDocs. Exception :" + Ex.Message);
                }
                finally
                {
                    _DashboardDocs = null;
                }
            }
        }