Ejemplo n.º 1
0
        public static bool ProductCreate(Dictionary <string, object> data,
                                         out string result,
                                         out string name,
                                         out string comment)
        {
            result  = string.Empty;
            name    = data["name"].ToString();
            comment = data["comment"].ToString();

            if (!Valid.Name(name))
            {
                result = "{\"RESULT\":8}";
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
 public static bool ProductModify(Dictionary <string, object> data,
                                  out string result,
                                  out int productid,
                                  out string name,
                                  out string comment)
 {
     result    = string.Empty;
     productid = Convert.ToInt32(data["productid"]);
     name      = data["name"].ToString();
     comment   = data["comment"].ToString();
     if (!Valid.ID(productid))
     {
         result = "{\"RESULT\":6}";
         return(false);
     }
     if (!Valid.Name(name))
     {
         result = "{\"RESULT\":8}";
         return(false);
     }
     return(true);
 }