Ejemplo n.º 1
0
        public ActionResult Dashboard()
        {
            decimal?USER_NO = Session["sess_USER_NO"] as decimal?;

            DashboardSearchModel model = new DashboardSearchModel();
            ObjectResult <DASHBOARD_REPORT_Result> dashboard = null;

            model.Search_AM_User = null;

            DateTime now             = DateTime.Now;
            DateTime FirstDayOfMonth = new DateTime(now.Year, now.Month, 1);

            model.Search_Date_From = FirstDayOfMonth;

            model.Search_Date_To = DateTime.Now;

            if (!string.IsNullOrEmpty(Request.QueryString["Search"]))
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Search_AM_User"]))
                {
                    model.Search_AM_User = decimal.Parse(Request.QueryString["Search_AM_User"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_Date_From"]))
                {
                    model.Search_Date_From = DateTime.Parse(Request.QueryString["Search_Date_From"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_Date_To"]))
                {
                    model.Search_Date_To = DateTime.Parse(Request.QueryString["Search_Date_To"]);
                }
            }

            dashboard = db.DASHBOARD_REPORT(null, model.Search_AM_User, USER_NO,
                                            model.Search_Date_From, model.Search_Date_To);

            ViewBag.Search_Model = model;

            return(View(dashboard));
        }