Example #1
0
        public HttpResponseMessage GetServices()
        {
            GlobalVarible.Clear();
            List <ENT.ServiceMasterView> lstEntity = new List <ENT.ServiceMasterView>();

            try
            {
                using (BAL.ServiceMaster objBal = new BAL.ServiceMaster())
                {
                    lstEntity = objBal.GetServices("30B24352-9F4B-485A-AB18-528E74F6F260");
                }

                foreach (ENT.ServiceMasterView s in lstEntity)
                {
                    s.serviceimage = "http://dmt.appsmith.co.in/Uploads/Services/postpaid.png";
                }

                GlobalVarible.AddMessage("Services get successfully.");
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
Example #2
0
        // [OutputCache(Duration = 3600, VaryByParam = "none", NoStore = true)]
        public ActionResult Index()
        {
            DashBoardModels objDashBoardModels = new DashBoardModels();

            try
            {
                if (User.isInRoles("administrator", "apiuser", "masterdistributor", "distributor", "retailer"))
                {
                    ViewBag.PageHeader = "Dashboard";
                    objENTDashboard    = objBalDashboard.GetDashboardData(Guid.Parse(User.Identity.GetUserId()), User.GetUserlevel());
                    objDashBoardModels.TotalCustomers     = objENTDashboard.TotalCustomers;
                    objDashBoardModels.TotalBalance       = objENTDashboard.TotalBalance;
                    objDashBoardModels.TotalTodayRequests = objENTDashboard.TotalTodayRequests;
                    objDashBoardModels.TotalSuccess       = objENTDashboard.TotalSuccess;
                    objDashBoardModels.TotalFailed        = objENTDashboard.TotalFailed;
                    objDashBoardModels.DMTtotalSuccess    = objENTDashboard.DMTtotalSuccess;
                    objDashBoardModels.DMTtotalFailed     = objENTDashboard.DMTtotalFailed;
                    objDashBoardModels.DMTinproccess      = objENTDashboard.DMTinproccess;
                    objDashBoardModels.WalletRequests     = objENTDashboard.WalletRequests;
                    objDashBoardModels.LoginActivity      = objENTDashboard.LoginActivity;
                }
            }
            catch (Exception ex)
            {
                ViewBag.ErrorMessage = ex.Message;
            }

            List <ENT.ServiceMaster> lstService = new List <ENT.ServiceMaster>();

            using (BAL.ServiceMaster objBal = new BAL.ServiceMaster())
            {
                lstService = objBal.GetService("30B24352-9F4B-485A-AB18-528E74F6F260");
            }

            List <ENT.CircleMaster> lstCircles = new List <ENT.CircleMaster>();

            using (BAL.CircleMaster objBal = new BAL.CircleMaster())
            {
                lstCircles = objBal.GetAllActive("IN");
            }

            ViewBag.ServiceMaster = lstService;
            ViewBag.CircleMaster  = lstCircles;

            return(View(objDashBoardModels));
        }
        public JsonResult GetService()
        {
            List <ENT.ServiceMaster> lstEntity = new List <ENT.ServiceMaster>();

            GlobalVarible.Clear();
            try
            {
                using (BAL.ServiceMaster objBal = new BAL.ServiceMaster())
                {
                    lstEntity = objBal.GetService("30B24352-9F4B-485A-AB18-528E74F6F260");
                }
                GlobalVarible.AddMessage("Services get successfully.");
                return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet));
            }
        }