Esempio n. 1
0
 private void FillSelf(ClientAccess model)
 {
     Id             = model.Id;
     IdClientEtalon = model.IdClientEtalon;
     Name           = model.Name;
     FullName       = model.FullName;
     AdSid          = model.AdSid;
     Login          = model.Login;
     Password       = model.Password;
     ZipAccess      = model.ZipAccess;
     CounterAccess  = model.CounterAccess;
 }
        public ActionResult Edit(ClientAccess model)
        {
            if (!CurUser.HasAccess(AdGroup.ServiceClaimClientAccess)) RedirectToAction("AccessDenied", "Error");
            try
            {
                ResponseMessage responseMessage;
                bool complete = model.Update(out responseMessage);
                if (!complete) throw new Exception(responseMessage.ErrorMessage);

                return RedirectToAction("List");
            }
            catch (Exception ex)
            {
                TempData["error"] = ex.Message;
                return View("Edit", model);
            }
        }
Esempio n. 3
0
 private void FillSelf(ClientAccess model)
 {
     Id = model.Id;
     IdClientEtalon = model.IdClientEtalon;
     Name = model.Name;
     FullName = model.FullName;
     AdSid = model.AdSid;
     Login = model.Login;
     Password = model.Password;
     ZipAccess = model.ZipAccess;
     CounterAccess = model.CounterAccess;
 }
 public ActionResult Edit(int id)
 {
     if (!CurUser.HasAccess(AdGroup.ServiceClaimClientAccess, AdGroup.ServiceControler)) RedirectToAction("AccessDenied", "Error");
     var model = new ClientAccess(id);
     return View(model);
 }
 public ActionResult ClientSheet(int id)
 {
     var model = new ClientAccess(id);
     return View(model);
 }
        public ActionResult New(ClientAccess model)
        {
            if (!CurUser.HasAccess(AdGroup.ServiceClaimClientAccess)) RedirectToAction("AccessDenied", "Error");
            try
            {
                ResponseMessage responseMessage;
                //dep.Creator = new Employee(){AdSid = GetCurUser().Sid};
                string ctrIdStr = Request.Form["ctrList"];
                int idClientEtalon;
                int.TryParse(ctrIdStr, out idClientEtalon);
                model.IdClientEtalon = idClientEtalon;
                bool complete = model.SaveNew(out responseMessage);
                if (!complete) throw new Exception(responseMessage.ErrorMessage);

                return RedirectToAction("List");
            }
            catch (Exception ex)
            {
                TempData["error"] = ex.Message;
                return View("New", model);
            }
        }