Ejemplo n.º 1
0
        public List <AccInfo> SearchInfo(string date, string from, string to, string amount, string enterTB)
        {
            try
            {
                if (date != "")
                {
                    Convert.ToDateTime(date);
                }
            }
            catch
            {
                throw new Exception("The Date Isn't Available");
            }
            try
            {
                if (amount != "")
                {
                    Convert.ToDouble(amount);
                }
            }
            catch
            {
                throw new Exception("The Amount Isn't Available");
            }
            AccInfoC infoC = new AccInfoC();

            return(infoC.FilterAccInfo(date, "All", from, to, amount, enterTB));
        }
Ejemplo n.º 2
0
 public List <AccInfo> SearchListOfAccInfo(string date, string kind, string from, string to, string amount, string enterB)//return the list of information filtered by the following fields
 {
     try
     {
         bool dFlag = false;
         bool aFlag = false;
         if (date == "")
         {
             date  = DateTime.Now.ToString();
             dFlag = true;
         }
         if (Convert.ToDateTime(date) > DateTime.Now)
         {
             throw new Exception("Not Available Date");
         }
         if (from == "")
         {
             throw new Exception("The From Field Is Empty");
         }
         if (to == "")
         {
             throw new Exception("The To Field Is Empty");
         }
         if (amount == "")
         {
             aFlag  = true;
             amount = "3";
         }
         if (double.Parse(amount) < 0)
         {
             throw new Exception("Unavailable Amount");
         }
         if (dFlag)
         {
             date = "";
         }
         if (aFlag)
         {
             amount = "";
         }
         AccInfoC inter = new AccInfoC();
         return(inter.FilterAccInfo(date, kind, from, to, amount, enterB));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }