Exemplo n.º 1
0
        public ActionResult ChangePassword(ChangePasswordModel model)
        {
            if (ModelState.IsValid)
            {
                // ChangePassword will throw an exception rather
                // than return false in certain failure scenarios.
                bool changePasswordSucceeded;
                try
                {
                    changePasswordSucceeded = SimSoDepRepository.ChangePassword(Username, model.OldPassword, model.NewPassword);
                }
                catch (Exception)
                {
                    changePasswordSucceeded = false;
                }

                if (changePasswordSucceeded)
                {
                    return(RedirectToAction("ChangePasswordSuccess"));
                }
                else
                {
                    ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 2
0
        //
        // GET: /Administrator/NamSinhManager/Edit/5

        public ActionResult Edit(int id)
        {
            var result = SimSoDepRepository.GetNamSinhById(id);

            ViewBag.NguHanh = new SelectList(SimSoDepRepository.GetListNguHanh(), "IdNguHanh", "Ten", result.IdNguHanh);
            return(View(result));
        }
Exemplo n.º 3
0
        public ActionResult ChiTiet(string id)
        {
            var result = SimSoDepRepository.GetListSimSoByLoaiSim(id);

            ViewBag.DataDisplay = SimSoDepRepository.GetTenLoaiSim(id);
            return(View(result));
        }
Exemplo n.º 4
0
        //
        // GET: /Administrator/KinhDichManager/Create

        public ActionResult Create()
        {
            ViewBag.LoaiQue   = GetLoaiQue();
            ViewBag.QueThuong = new SelectList(SimSoDepRepository.GetListBatQuai(), "IdQueBatQuai", "TenQue");
            ViewBag.QueHa     = new SelectList(SimSoDepRepository.GetListBatQuai(), "IdQueBatQuai", "TenQue");
            return(View());
        }
Exemplo n.º 5
0
        //
        // GET: /Administrator/ImportExcel/

        public ActionResult Index()
        {
            var result = SimSoDepRepository.GetListDaiLy();

            ViewBag.DaiLy = new SelectList(result, "Id", "Ten");
            return(View());
        }
Exemplo n.º 6
0
        public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (SimSoDepRepository.ValidateUser(model.UserName, model.Password))
                {
                    FormsAuthentication.SetAuthCookie(model.UserName, false);
                    Username = model.UserName;
                    if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") &&
                        !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                    {
                        return(Redirect(returnUrl));
                    }
                    else
                    {
                        return(RedirectToAction("Index", "ImportExcel"));
                    }
                }
                else
                {
                    ModelState.AddModelError("", "The user name or password provided is incorrect.");
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 7
0
        public ActionResult BoiPhongThuy(PhongThuyModel phongThuyModel)
        {
            var isdataTime = false;

            try
            {
                var vnCal = new VietnameseCalendar();
                var date  = new DateTime(phongThuyModel.Nam, phongThuyModel.Thang, phongThuyModel.Ngay);
                isdataTime = true;
                phongThuyModel.SoDienThoai = phongThuyModel.SoDienThoai.Trim();
                int yyyy, mm, dd;
                vnCal.FromDateTime(date, out yyyy, out mm, out dd);
                var result   = SimSoDepRepository.BoiPhongThuy(phongThuyModel.SoDienThoai, yyyy);
                var tenNam   = vnCal.GetYearName(yyyy);
                var tenThang = vnCal.GetMonthName(yyyy, mm);
                var tenNgay  = vnCal.GetDayName(date);
                return(PartialView("BoiPhongThuy"));
            }
            catch (Exception)
            {
                if (!isdataTime)
                {
                    return(PartialView("NgayThangKhongDung"));
                }
                return(PartialView("ExceptionBreak"));
            }
        }
Exemplo n.º 8
0
        public ActionResult Edit(int id)
        {
            ViewBag.StatusId = GetDanhMucStatus();
            var result = SimSoDepRepository.GetLoaiSimById(id);

            return(View(result));
        }
Exemplo n.º 9
0
        public ActionResult GetMenuNhaMang()
        {
            var result = SimSoDepRepository.GetMenuNhaMang(true);

            //ViewBag.ListLoaiSim = SimSoDepRepository.GetMenuLoaiSim();
            return(PartialView(result));
        }
Exemplo n.º 10
0
        public ActionResult Index(TimKiemModel timKiemModel)
        {
            timKiemModel.SearchString = (string.IsNullOrEmpty(timKiemModel.SearchString))?string.Empty:timKiemModel.SearchString.Trim();
            ViewBag.SearchStr         = timKiemModel.SearchString;
            var result = SimSoDepRepository.TimKiemSimSo(timKiemModel);

            return(View(result));
        }
Exemplo n.º 11
0
        public ActionResult Edit(int id)
        {
            ViewBag.StatusId = GetDanhMucStatus();
            var result = SimSoDepRepository.GetDauSoById(id);

            ViewBag.NhaMang = new SelectList(SimSoDepRepository.GetMenuNhaMang(null), "Id", "Ten", result.MaNhaMang);
            return(View(result));
        }
        //
        // GET: /Administrator/LoaiSimSoChiTietManager/

        public ActionResult Add()
        {
            ViewBag.StatusId = GetDanhMucStatus();
            var listParent = SimSoDepRepository.GetListLoaiSimSo();

            ViewBag.LoaiSimSo = new SelectList(listParent, "Id", "Ten");
            return(View());
        }
Exemplo n.º 13
0
        //
        // GET: /Administrator/KinhDichManager/Edit/5

        public ActionResult Edit(int id)
        {
            var result = SimSoDepRepository.GetKinhDichById(id);

            ViewBag.QueThuong = new SelectList(SimSoDepRepository.GetListBatQuai(), "IdQueBatQuai", "TenQue", result.IdQueThuong);
            ViewBag.QueHa     = new SelectList(SimSoDepRepository.GetListBatQuai(), "IdQueBatQuai", "TenQue", result.IdQueHa);
            ViewBag.LoaiQue   = GetLoaiQue(result.IdLoaiQue);
            return(View(result));
        }
        public ActionResult Edit(int id)
        {
            ViewBag.StatusId = GetDanhMucStatus();
            var result     = SimSoDepRepository.GetLoaiSimChiTietById(id);
            var listParent = SimSoDepRepository.GetListLoaiSimSo();

            ViewBag.LoaiSimSo = new SelectList(listParent, "Id", "Ten", result.Id);
            return(View(result));
        }
Exemplo n.º 15
0
        public ActionResult DatSim(long id)
        {
            var result    = SimSoDepRepository.GetSimSoById(id);
            var khachHang = new KhachHangModel {
                SimSoModel = result
            };

            return(View(khachHang));
        }
Exemplo n.º 16
0
        public ActionResult Import(ImportModel importModel)
        {
            // Verify that the user selected a file


            var importSuccess = SimSoDepRepository.ImportExcel(importModel);

            ViewBag.Result = importSuccess;
            return(View());
        }
Exemplo n.º 17
0
        public ActionResult DatSim(long id, KhachHangModel khachHangModel)
        {
            var result = SimSoDepRepository.DatSim(id, khachHangModel);

            if (result)
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Loi"));
        }
        public ActionResult TimSo(string so, int?madaily)
        {
            if (string.IsNullOrEmpty(so) && madaily == null)
            {
                return(RedirectToAction("Index"));
            }
            var result = SimSoDepRepository.TimKiemSoManager(so, madaily);

            ViewBag.SearchStr = so;
            ViewBag.madaily   = new SelectList(SimSoDepRepository.GetListDaiLy(), "Id", "Ten");
            return(View("Index", result));
        }
Exemplo n.º 19
0
 public ActionResult Edit(int id, BatQuaiModel collection)
 {
     try
     {
         // TODO: Add update logic here
         var result = SimSoDepRepository.SaveBatQuai(id, collection);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 20
0
 public ActionResult Create(BatQuaiModel batQuaiModel)
 {
     try
     {
         // TODO: Add insert logic here
         var result = SimSoDepRepository.AddBatQuai(batQuaiModel);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 21
0
 public ActionResult Edit(NamSinhModel namSinhModel)
 {
     try
     {
         // TODO: Add update logic here
         var result = SimSoDepRepository.SaveNameSinh(namSinhModel);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 22
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         var result = SimSoDepRepository.DeleteKinhDich(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 23
0
 public ActionResult Edit(int id, KinhDichModel kinhDichModel)
 {
     try
     {
         // TODO: Add update logic here
         var result = SimSoDepRepository.SaveKinhDich(kinhDichModel);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 24
0
        //
        // GET: /Administrator/CheckSim/Details/5

        public ActionResult Details(string txtString)
        {
            // Verify that the user selected a file

            var importSuccess = SimSoDepRepository.CheckSo(txtString);

            if (importSuccess != null)
            {
                return(View(importSuccess));
            }

            // redirect back to the index action to show the form once again
            return(RedirectToAction("Index"));
        }
Exemplo n.º 25
0
        public ActionResult Create(KinhDichModel kinhDichModel)
        {
            try
            {
                // TODO: Add insert logic here
                var result = SimSoDepRepository.SaveKinhDich(kinhDichModel);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 26
0
        protected void Session_Start(object sender, EventArgs e)
        {
            var ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

            if (!string.IsNullOrEmpty(ip))
            {
                if (ip.IndexOf(",") > 0)
                {
                    string[] ipRange = ip.Split(',');
                    int      le      = ipRange.Length - 1;
                    ip = ipRange[le];
                }
            }
            else
            {
                ip = Request.UserHostAddress;
            }
            var logUser = new SimSoDepRepository();

            logUser.AddLogUser(ip);
            var simSoModel = logUser.ThongKeSim();

            SessionManagerModel.ThongKeSimSession = simSoModel;
        }
        public ActionResult DeletePost(int id)
        {
            var result = SimSoDepRepository.DeleteLoaiSimChiTietById(id);

            return(RedirectToAction("LoaiSimSoChiTiet", "Catagory"));
        }
        public ActionResult Delete(int id)
        {
            var result = SimSoDepRepository.GetLoaiSimChiTietById(id);

            return(View(result));
        }
        public ActionResult Edit(LoaiSimChiTietModel loaiSimSoModel)
        {
            var result = SimSoDepRepository.SaveLoaiSimSoChiTiet(loaiSimSoModel);

            return(RedirectToAction("LoaiSimSoChiTiet", "Catagory"));
        }
Exemplo n.º 30
0
        //
        // GET: /LoaiSim/

        //
        // GET: /Menu/

        public ActionResult GetMenuLoaiSim()
        {
            var result = SimSoDepRepository.GetMenuLoaiSim();

            return(PartialView(result));
        }