Exemplo n.º 1
0
 public IHttpActionResult Change(string Name, string Specification, int lotId)
 {
     if (string.IsNullOrWhiteSpace(Name) || string.IsNullOrWhiteSpace(Specification))
     {
         return(BadRequest("Please, correct your inputs"));
     }
     else if (!Regex.IsMatch(Name, @"^[\d|\D]{1,50}$)"))
     {
         return(BadRequest("Name is too longs"));
     }
     else if (!Regex.IsMatch(Specification, @"^[\d|\D]{1,1000}$)"))
     {
         return(BadRequest("Specification is too longs"));
     }
     else
     {
         bool result = LOperations.Change(Name, Specification, lotId);
         if (!result)
         {
             return(BadRequest("Please, input correct information"));
         }
         else
         {
             return(Ok());
         }
     }
 }
Exemplo n.º 2
0
        public IHttpActionResult Change(string Name, string Specification, int lotId)
        {
            bool result = LOperations.Change(Name, Specification, lotId);

            if (!result)
            {
                return(BadRequest("Please, input correct information"));
            }
            else
            {
                return(Ok());
            }
        }