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)); }
// // 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)); }
public ActionResult ChiTiet(string id) { var result = SimSoDepRepository.GetListSimSoByLoaiSim(id); ViewBag.DataDisplay = SimSoDepRepository.GetTenLoaiSim(id); return(View(result)); }
// // 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()); }
// // GET: /Administrator/ImportExcel/ public ActionResult Index() { var result = SimSoDepRepository.GetListDaiLy(); ViewBag.DaiLy = new SelectList(result, "Id", "Ten"); return(View()); }
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)); }
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")); } }
public ActionResult Edit(int id) { ViewBag.StatusId = GetDanhMucStatus(); var result = SimSoDepRepository.GetLoaiSimById(id); return(View(result)); }
public ActionResult GetMenuNhaMang() { var result = SimSoDepRepository.GetMenuNhaMang(true); //ViewBag.ListLoaiSim = SimSoDepRepository.GetMenuLoaiSim(); return(PartialView(result)); }
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)); }
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()); }
// // 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)); }
public ActionResult DatSim(long id) { var result = SimSoDepRepository.GetSimSoById(id); var khachHang = new KhachHangModel { SimSoModel = result }; return(View(khachHang)); }
public ActionResult Import(ImportModel importModel) { // Verify that the user selected a file var importSuccess = SimSoDepRepository.ImportExcel(importModel); ViewBag.Result = importSuccess; return(View()); }
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)); }
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()); } }
public ActionResult Create(BatQuaiModel batQuaiModel) { try { // TODO: Add insert logic here var result = SimSoDepRepository.AddBatQuai(batQuaiModel); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(NamSinhModel namSinhModel) { try { // TODO: Add update logic here var result = SimSoDepRepository.SaveNameSinh(namSinhModel); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here var result = SimSoDepRepository.DeleteKinhDich(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, KinhDichModel kinhDichModel) { try { // TODO: Add update logic here var result = SimSoDepRepository.SaveKinhDich(kinhDichModel); return(RedirectToAction("Index")); } catch { return(View()); } }
// // 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")); }
public ActionResult Create(KinhDichModel kinhDichModel) { try { // TODO: Add insert logic here var result = SimSoDepRepository.SaveKinhDich(kinhDichModel); return(RedirectToAction("Index")); } catch { return(View()); } }
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")); }
// // GET: /LoaiSim/ // // GET: /Menu/ public ActionResult GetMenuLoaiSim() { var result = SimSoDepRepository.GetMenuLoaiSim(); return(PartialView(result)); }