コード例 #1
0
 public static Response UpdateProductType(String ID, String TypeName, String Desc)
 {
     if (TypeName == "")
     {
         return(new Response(false, "Product Type Name Cannot Empty"));
     }
     if (TypeName.Length < 5)
     {
         return(new Response(false, "Product Type Name Must Consist of 5 Characters Or More"));
     }
     if (Desc == "")
     {
         return(new Response(false, "Product Type Description Cannot Empty"));
     }
     return(UpdateProductTypeHandler.UpdateProductType(ID, TypeName, Desc));
 }
コード例 #2
0
 public static bool validateUpdate(int ptID, string name, string desc, out string errorMsg)
 {
     errorMsg = "";
     if (name == "" || desc == "")
     {
         errorMsg = "Data must be filled!";
         return(false);
     }
     else
     {
         if (name.Length >= 5)
         {
             UpdateProductTypeHandler.updateProductType(ptID, name, desc);
             return(true);
         }
         else
         {
             errorMsg = "Product type must consists of 5 characters or more";
             return(false);
         }
     }
 }
コード例 #3
0
 public static Boolean ProductTypeValidation(string name, string desc, string oldTypeName, out string errorMessage)
 {
     errorMessage = "";
     if (name == String.Empty || desc == String.Empty)
     {
         errorMessage = "No data can empty";
         return(false);
     }
     else if (name.Length < 5)
     {
         errorMessage = "Name must be more than 5 characters";
         return(false);
     }
     else if (name.Equals(oldTypeName))
     {
         return(true);
     }
     else if (UpdateProductTypeHandler.CheckProductTypeHandler(name) > 0)
     {
         errorMessage = "Already have that data";
         return(false);
     }
     return(true);
 }
コード例 #4
0
 public static List <ProductType> getAllProductType()
 {
     return(UpdateProductTypeHandler.getAllProductType());
 }
コード例 #5
0
 public static void GetUpdateProductTypeController(int id, string name, string description)
 {
     UpdateProductTypeHandler.GetUpdateProductTypeHandler(id, name, description);
 }
コード例 #6
0
 public static ProductType GetProductTypeController(int id)
 {
     return(UpdateProductTypeHandler.GetProductTypeHandler(id));
 }
コード例 #7
0
 public static MsProductType SearchProductType(String ID)
 {
     return(UpdateProductTypeHandler.SearchProductType(ID));
 }