Ejemplo n.º 1
0
        /// <summary>
        /// Check if the input number has existed in database,
        /// if existed return the number,
        /// if not return null
        /// </summary>
        /// <param name="number"></param>
        /// <returns></returns>
        public static NumberModel CheckDuplicate(NumberModel number)
        {
            //GetAppSettingsFile();
            var numberDal = new NumberDAL();

            if (numberDal.CheckDuplicate(number) == null)
            {
                return(null);
            }
            return(number);
        }
Ejemplo n.º 2
0
        //keep the sumProportion as string to prevent mislead proportion 12/14 and 24/28

        /// <summary>
        /// Get the specific list from database, based on user's choice
        /// </summary>
        /// <param name="provider"></param>
        public static void GetList(string?provider)
        {
            //GetAppSettingsFile();
            var numberDal = new NumberDAL();
            List <NumberModel> numbersList;

            if (provider == null)
            {
                numbersList = numberDal.GetList(null);
            }
            else
            {
                numbersList = numberDal.GetList(provider);
            }
            CheckFSN(numbersList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add the input number to database if not existed
        /// </summary>
        /// <param name="numberModel"></param>
        public static void AddNumberToDb(NumberModel number)
        {
            var numberDal = new NumberDAL();

            numberDal.AddNumber(number);
        }