コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
 public static void GetUpdatePaymentTypeController(int id, string name)
 {
     UpdatePaymentTypeHandler.GetUpdatePaymentTypeHandler(id, name);
 }
コード例 #5
0
 public static PaymentType GetPaymentTypeController(int id)
 {
     return(UpdatePaymentTypeHandler.GetPaymentTypeHandler(id));
 }
コード例 #6
0
 public static List <PaymentType> getAllPaymentType()
 {
     return(UpdatePaymentTypeHandler.getAllPaymentType());
 }
コード例 #7
0
 public static MsPaymentType GetPaymentType(String ID)
 {
     return(UpdatePaymentTypeHandler.GetPaymentType(ID));
 }