Beispiel #1
0
 public JsonResult update(int id, int idProduct, string name, string abbreviation, bool required)
 {
     try
     {
         if (PValidateHeader(Request.Headers["Authorization"].ToString()))
         {
             uspGEProductPropertySearch_Result data = new uspGEProductPropertySearch_Result();
             data.idProperty   = id;
             data.idProduct    = idProduct;
             data.name         = name;
             data.abbreviation = abbreviation;
             data.required     = required;
             DAProductProperty property = new DAProductProperty(PUser);
             ENResult          result   = property.update(data);
             result.token = PCreateToken();
             return(Json(result));
         }
         else
         {
             return(PSecurityError());
         }
     }
     catch (Exception ex)
     {
         return(PUnexpectedError(ex));
     }
 }
Beispiel #2
0
 public JsonResult delete(int idProperty, int idProduct)
 {
     try
     {
         if (PValidateHeader(Request.Headers["Authorization"].ToString()))
         {
             uspGEProductPropertySearch_Result data = new uspGEProductPropertySearch_Result();
             data.idProperty = idProperty;
             data.idProduct  = idProduct;
             DAProductProperty property = new DAProductProperty(PUser);
             ENResult          result   = property.delete(data);
             result.token = PCreateToken();
             return(Json(result));
         }
         else
         {
             return(PSecurityError());
         }
     }
     catch (Exception ex)
     {
         return(PUnexpectedError(ex));
     }
 }