Exemplo n.º 1
0
        public async Task <ActionResult> Savedata(List <Usage> lstUsage)
        {
            UsageHelper helper = new UsageHelper();

            try
            {
                bool res = await helper.SaveData(lstUsage);

                if (res)
                {
                    ViewBag.Messages = "Thanks for submitting data.Your data has been successfully saved.";
                    return(Json(new { redirectTo = Url.Action("Result", "Home") }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    ViewBag.Messages = "Not able to update the data now. Please try again after some time.";
                    return(Json(new { redirectTo = Url.Action("Result", "Home") }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                ViewBag.Messages = "Some error occurred. Please try again. " + ex.Message;
                return(Json(new { redirectTo = Url.Action("Result", "Home") }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public ActionResult _DisplayUserDetails(string UserID)
        {
            List <Usage> lstUsage = new List <Usage>();
            UsageHelper  helper   = new UsageHelper();

            lstUsage = helper.GetListofMailbox(UserID);
            return(PartialView(lstUsage));
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            List <Usage> lstUsage = new List <Usage>();
            UsageHelper  helper   = new UsageHelper();
            string       UUID     = Request.QueryString["UUID"] != null ? Request.QueryString["UUID"].ToString() : string.Empty;

            TempData["UserName"] = helper.GetUserName(UUID);
            Session["UserID"]    = UUID;
            lstUsage             = helper.GetListofMailbox(UUID);
            ViewBag.Title        = "Mailbox Usage Survey";
            return(View(lstUsage));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> ViewUserDetails()
        {
            UsageHelper helper = new UsageHelper();
            List <User> user   = await helper.GetListOfUsers();

            if (user != null && user.Count > 0)
            {
                SelectList selectList = new SelectList(user, "UserID", "FullName");
                ViewBag.USERS = selectList;
            }
            ViewBag.Title = "User Details";
            return(View());
        }
Exemplo n.º 5
0
 protected override int HandleData(string[] data)
 {
     UsageHelper.ShowUsage();
     return(ReturnCode.IncorrectFunction);
 }