예제 #1
0
        private static bool ValidateGuest(OnlineReturnBL onlineReturn)
        {
            StringBuilder sb = new StringBuilder();
            bool          valiOnlineReturnBL = true;

            if (OnlineReturnBL.ReturnID <= 0)
            {
                validOnlineReturnBL = false;
                sb.Append(Environment.NewLine + "Invalid ReturnOnlineOrder ID");
            }
            if (OnlineReturnBL.OnlineReturnName == string.Empty)
            {
                validOnlineReturnBL = false;
                sb.Append(Environment.NewLine + "ReturnOnlineOrder Name Required");
            }
            if (OnlineReturnBL.OnlineReturnContactNumber.Length < 10)
            {
                validOnlineReturn = false;
                sb.Append(Environment.NewLine + "Required 10 Digit Contact Number");
            }
            if (validOnlineReturn == false)
            {
                throw new GreatOutdoorException(sb.ToString());
            }
            return(validOnlineReturn);
        }
예제 #2
0
        public static OnlineReturnBL SearchOnlineReturnBL(int searchReturnID)
        {
            OnlineReturnBL searchOnlineReturn = null;

            try
            {
                OnlineReturnDAL onlineReturn = new OnlineReturnDAL();
                searchOnlineReturn = OnlineReturnDAL.SearchOnlineReturnDAL(searchReturnID);
            }
            catch (GreatOutdoorException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(searchOnlineReturn);
        }
예제 #3
0
        public static bool AddOnlineReturnBL(OnlineReturnBL newOnlineReturn)
        {
            bool onlineReturnAdded = false;

            try
            {
                if (ValidateOnlineReturn(newOnlineReturn))
                {
                    OnlineReturnDAL onlineReturnDAL = new OnlineReturnDAL();
                    onlineReturnAdded = onlineReturnDAL.AddOnlineReturnDAL(newOnlineReturn);
                }
            }
            catch (GreatOutdoorException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(onlineReturnAdded);
        }
예제 #4
0
        public static bool UpdateOnlineReturnBL(OnlineReturnBL updateonlineReturn)
        {
            bool onlineReturnUpdated = false;

            try
            {
                if (ValidateOnlineReturn(updateOnlineReturn))
                {
                    OnlineReturnDAL onlineReturn = new OnlineReturnDAL();
                    onlineReturnUpdated = OnlineReturnDAL.UpdateOnlineReturnDAL(updateonlineReturn);
                }
            }
            catch (GreatOutdoorException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(onlineReturnUpdated);
        }