コード例 #1
0
        public ActionResult DocumentViewerExportToNhapKho()
        {
            var report = new CongCuDungCu.Reports.rpNhapKho();

            report.getIDDonVi(System.Web.HttpContext.Current.User.Identity.Name);
            report.Fill(AccountDataProvider.GetSystemDate());
            return(DocumentViewerExtension.ExportTo(report));
        }
コード例 #2
0
        public ActionResult rpNhapKhoPartial()
        {
            var report = new CongCuDungCu.Reports.rpNhapKho();

            report.getIDDonVi(System.Web.HttpContext.Current.User.Identity.Name);
            report.Fill(AccountDataProvider.GetSystemDate());
            ViewData["Report"] = report;
            return(PartialView("rpNhapKhoPartial"));
        }
コード例 #3
0
        public ActionResult ChangePassword(ChangePasswordModel model)
        {
            if (Request.Params["btnUpdate"] == null)
            {
                ModelState.Clear();
                return(DemoView("ChangePassword", model));
            }
            if (ModelState.IsValid)
            {
                bool changePasswordSucceeded;
                try
                {
                    changePasswordSucceeded = MembershipService.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword);
                }
                catch (Exception)
                {
                    changePasswordSucceeded = false;
                }

                if (changePasswordSucceeded)
                {
                    AccountDataProvider.UpdateNewPassword(User.Identity.Name, model.NewPassword);

                    AccountDataProvider.UpdateLastPasswordChangeDate(User.Identity.Name);

                    return(RedirectToAction("ChangePasswordSuccess"));
                }
                else
                {
                    ModelState.AddModelError(string.Empty, "Mật khẩu cũ không đúng hoặc mật khẩu mới bị sai!");
                    return(DemoView("ChangePassword", model));
                }
            }


            return(View(model));
        }
コード例 #4
0
 public Consumer(AccountDataProvider dataProvider)
 {
     AccountDataProvider = dataProvider;
 }