예제 #1
0
 public ActionResult Irasyti(RestrictRightsViewModel model, int clientid)
 {
     if (ModelState.IsValid)
     {
         Darbuotojas emp    = repository.Set <Darbuotojas>().Find(CurrentUser.UserId);
         Viesbutis   hotel  = repository.Set <Viesbutis>().Find(emp.fk_Viesbutisid);
         Teises      rights = repository.Set <Teises>().Where(x => x.viesbuciu_tinklas == hotel.viesbuciu_tinklas && x.fk_Klientaskliento_kodas == clientid).FirstOrDefault();
         rights.priezastis      = model.Reason;
         rights.data_iki        = model.DateEnd;
         rights.teisiu_statusas = false;
         repository.SaveChanges();
     }
     return(RedirectToAction("Sistemos_klientu_langas"));
 }
예제 #2
0
        public ActionResult Kliento_teisiu_apribojimo_langas(int clientid)
        {
            try
            {
                var model = new RestrictRightsViewModel();
                if (clientid > 0)
                {
                    ViewData["code"] = clientid;
                }

                return(View(model));
            }
            catch (ITPProException ex)
            {
                return(RedirectToAction("Sistemos_klientu_langas"));
            }
        }