Exemplo n.º 1
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 GetCircles(string id)
        {
            List <ENT.CircleMaster> lstEntity = new List <ENT.CircleMaster>();

            GlobalVarible.Clear();
            try
            {
                using (BAL.CircleMaster objBal = new BAL.CircleMaster())
                {
                    lstEntity = objBal.GetAllActive("IN");
                }
                GlobalVarible.AddMessage("Circles 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));
            }
        }
 public JsonResult SaveEntry(ENT.CircleMaster model, string circleid)
 {
     try
     {
         List <Guid> dctDuplication = new List <Guid>();
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             List <ENT.CircleMaster> lstResult = new BAL.CircleMaster().CheckDuplicateCombination(dctDuplication, model.circle_name, "none");
             if (lstResult.Count > 0)
             {
                 throw new Exception("Circle Name Already Exists!");
             }
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
             model.circleid        = new Guid(circleid.Replace("/", ""));
             if (objBAL.UpdatePartial(model))
             {
                 GlobalVarible.AddMessage("Record Update Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }