コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
 public static void InsertNewPaymentTypeController(string name)
 {
     InsertPaymentTypeHandler.InsertNewPaymentTypeHandler(name);
 }
コード例 #5
0
        public static int CountData()
        {
            int ID = InsertPaymentTypeHandler.CountData();

            return(ID);
        }