Esempio n. 1
0
        void TestRequestsRepository()
        {
            var newrequest = new Requests()
            {
                Description  = "ZZZ", Justification = "ZZZ", RejectionReason = null,
                DeliveryMode = "Pickup", UserId = UsersRepository.GetByPk(2).Id
            };

            if (!RequestsRepository.Insert(newrequest))
            {
                throw new Exception("Request insert failed!");
            }
            DisplayAllRequests();
            newrequest.Description = "YYY";
            if (!RequestsRepository.Update(newrequest))
            {
                throw new Exception("Request update failed!");
            }
            DisplayAllRequests();
            if (!RequestsRepository.Delete(newrequest))
            {
                throw new Exception("Request delete failed!");
            }
            DisplayAllRequests();
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "REQ_IDE_REQUEST,REQ_IDE_USER,REQ_IDE_AREA,REQ_DES_TYPE_GASTO,REQ_DES_CONCEPT,REQ_DES_QUANTITY,REQ_DES_OBSERVATIONS,REQ_IDE_STATUS_APROV,REQ_FH_CREATED")] Request request)
 {
     if (ModelState.IsValid)
     {
         if (db.Update(request))
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View(request));
 }