コード例 #1
0
        public ActionResult Reports(string month = "", string year = "")
        {
            nominationRepo = new NominationRepo();
            repoResponse   = new RepositoryResponse();
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            repoResponse = nominationRepo.GetReportDetails(_loggedInUserID, month, year);
            if (repoResponse.success)
            {
                ParticipatedCount _model = new ParticipatedCount();
                _model = repoResponse.Data;
                return(View(_model));
            }
            return(Json(new { success = repoResponse.success, message = repoResponse.message }));
        }
コード例 #2
0
        public JsonResult LoadDashboardDetailsForFilter(string dept = "", string fromDate = "", string toDate = "")
        {
            repoResponse = new RepositoryResponse();
            if (dept == "--ALL--")
            {
                dept = "";
            }
            if (string.IsNullOrEmpty(fromDate))
            {
                fromDate = DateTime.Now.ToString("MMMM yyyy");
            }
            else if (!string.IsNullOrEmpty(fromDate))
            {
                string[] monthYear = fromDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                fromDate = month + "-" + year;
            }

            if (string.IsNullOrEmpty(toDate))
            {
                toDate = DateTime.Now.ToString("MMMM yyyy");
            }
            else if (!string.IsNullOrEmpty(toDate))
            {
                string[] monthYear = toDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                toDate = month + "-" + year;
            }
            nominationRepo = new NominationRepo();
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            repoResponse = nominationRepo.GetReportDetails(_loggedInUserID, dept, fromDate, toDate);
            if (repoResponse.success)
            {
                ParticipatedCount partModel = new ParticipatedCount();
                partModel = repoResponse.Data;
                //var _sa = new JsonSerializerSettings();
                //return Json(new { data = partModel });

                return(Json(new { success = repoResponse.success, message = partModel }));
            }
            else
            {
                return(Json(new { success = repoResponse.success, message = repoResponse.message }));
            }
        }
コード例 #3
0
        public ActionResult Index(string dept = "", string fromDate = "", string toDate = "")
        {
            DashboardModel    model     = new DashboardModel();
            ParticipatedCount partModel = new ParticipatedCount();

            repoResponse   = new RepositoryResponse();
            nominationRepo = new NominationRepo();
            loginRepo      = new LoginRepo();
            int    _empSOMRole = int.Parse(System.Web.HttpContext.Current.Session["EmpSOMRole"].ToString());
            string _dept       = System.Web.HttpContext.Current.Session["UserDepartment"].ToString();

            var monthFilter = loginRepo.GetMonthYearFilter();
            var deptFilter  = loginRepo.GetDepartmentDetails();

            model.From_Nom_DateFilterlst = monthFilter;
            model.DeptFilterlst          = deptFilter;


            if (dept == "--Select--")
            {
                dept = "";
            }
            if (string.IsNullOrEmpty(fromDate))
            {
                fromDate = DateTime.Now.ToString("MMMM yyyy");
            }
            else if (!string.IsNullOrEmpty(fromDate))
            {
                string[] monthYear = fromDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                fromDate = month + "-" + year;
            }

            if (string.IsNullOrEmpty(toDate))
            {
                toDate = DateTime.Now.ToString("MMMM yyyy");
            }
            else if (!string.IsNullOrEmpty(toDate))
            {
                string[] monthYear = toDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                toDate = month + "-" + year;
            }

            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            if (_empSOMRole == (int)SOMEmpRole.TQCHead)
            {
            }
            else if (string.IsNullOrEmpty(dept))
            {
                dept             = System.Web.HttpContext.Current.Session["UserDepartment"].ToString();
                model.DeptFilter = dept;
            }
            repoResponse = nominationRepo.GetReportDetails(_loggedInUserID, dept, fromDate, toDate);

            if (repoResponse.success)
            {
                partModel = repoResponse.Data;
                model.participatedCount = partModel;
            }
            model.From_Date = DateTime.Now.ToString("MMMM yyyy");
            model.To_Date   = DateTime.Now.ToString("MMMM yyyy");

            return(View(model));
        }