Esempio n. 1
0
        /// <summary>
        /// Create a new Address when user is registered
        /// and ships the first time.
        /// Business Rules:
        /// If operation failed result = 0
        /// If operation successfull result = 1
        /// If zip Code wrong result = 2
        /// </summary>
        /// <param name="zipCode"></param>
        /// <param name="cityName"></param>
        /// <param name="streetName"></param>
        /// <param name="streetNo"></param>
        /// <param name="addressType"></param>
        /// <returns></returns>
        public int CreateAddress(string zipCode, string cityName, string streetName, string streetNo, string addressType)
        {
            int result = 0;

            try
            {
                int cityID = CB.Insert(zipCode, cityName);
                result = DB.Insert(cityID, streetName, streetNo, addressType);
                Debug.Print("AddressBL: /Insert/ " + result);
            }
            catch (Exception e)
            {
                e.GetBaseException();
            }
            return(result);
        }
Esempio n. 2
0
        public Boolean Insert(AddressENT entAddress)
        {
            AddressDAL dalAddress = new AddressDAL();

            if (dalAddress.Insert(entAddress))
            {
                return(true);
            }
            else
            {
                Message = dalAddress.Message;
                return(false);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 向数据库中添加一条记录
 /// </summary>
 /// <param name="model">要添加的实体</param>
 /// <returns>插入数据的ID</returns>
 public int Insert(Address model)
 {
     return(_dao.Insert(model));
 }