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)); }
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); } } }
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); }
public static List <ProductType> getAllProductType() { return(UpdateProductTypeHandler.getAllProductType()); }
public static void GetUpdateProductTypeController(int id, string name, string description) { UpdateProductTypeHandler.GetUpdateProductTypeHandler(id, name, description); }
public static ProductType GetProductTypeController(int id) { return(UpdateProductTypeHandler.GetProductTypeHandler(id)); }
public static MsProductType SearchProductType(String ID) { return(UpdateProductTypeHandler.SearchProductType(ID)); }