public static bool validateUpdate(int ptID, string type, out string errorMsg) { errorMsg = ""; PaymentType pt = UpdatePaymentTypeHandler.searchByName(type); if (type == "") { errorMsg = "Data must be filled!"; return(false); } else if (pt == null && type.Length >= 3) { UpdatePaymentTypeHandler.updatePaymentType(ptID, type); return(true); } else { if (type.Length < 3) { errorMsg = "Payment Type must consist of 3 characters or more!"; return(false); } else { errorMsg = "Payment Type already exists!"; return(false); } } }
public static Response DoUpdatePaymentType(String ID, String Name) { if (Name == "") { return(new Response(false, "Payment Type Name Cannot Be Empty")); } if (Name.Length < 3) { return(new Response(false, "Payment Type Name Consists of 3 Characters or More")); } Response response = UpdatePaymentTypeHandler.DoUpdatePaymentType(ID, Name); return(response); }
public static Boolean PaymentTypeValidation(string name, string oldTypeName, out string errorMessage) { errorMessage = ""; if (name == String.Empty) { errorMessage = "No data can empty"; return(false); } else if (name.Length < 3) { errorMessage = "Name must be more than 3 characters"; return(false); } else if (name.Equals(oldTypeName)) { return(true); } else if (UpdatePaymentTypeHandler.CheckPaymentTypeHandler(name) > 0) { errorMessage = "Already have the payment type"; return(false); } return(true); }
public static void GetUpdatePaymentTypeController(int id, string name) { UpdatePaymentTypeHandler.GetUpdatePaymentTypeHandler(id, name); }
public static PaymentType GetPaymentTypeController(int id) { return(UpdatePaymentTypeHandler.GetPaymentTypeHandler(id)); }
public static List <PaymentType> getAllPaymentType() { return(UpdatePaymentTypeHandler.getAllPaymentType()); }
public static MsPaymentType GetPaymentType(String ID) { return(UpdatePaymentTypeHandler.GetPaymentType(ID)); }