public static bool validateInsert(string type, out string errorMsg) { errorMsg = ""; PaymentType pt = InsertPaymentTypeHandler.searchPayment(type); if (type == "") { errorMsg = "Must be filled"; return(false); } else if (pt == null && type.Length >= 3) { InsertPaymentTypeHandler.insertPaymentType(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 DoInsertPaymentType(Int64 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 = InsertPaymentTypeHandler.DoInsertPaymentType(ID, Name); return(response); }
public static Boolean PaymentTypeValidation(string name, out string errorMessage) { errorMessage = ""; if (name == String.Empty) { errorMessage = "No data can be empty"; return(false); } else if (name.Length < 3) { errorMessage = "Name must be more than 3 character"; return(false); } else if (InsertPaymentTypeHandler.CheckPaymentTypeHandler(name) > 0) { errorMessage = "Already have that payment type"; return(false); } return(true); }
public static void InsertNewPaymentTypeController(string name) { InsertPaymentTypeHandler.InsertNewPaymentTypeHandler(name); }
public static int CountData() { int ID = InsertPaymentTypeHandler.CountData(); return(ID); }