コード例 #1
0
        /// <summary>
        /// Implementation of Method.
        /// </summary>
        /// <param name="update">list.</param>
        /// <returns>value.</returns>
        public bool UpdateAddress(ShippingAddressModel update)
        {
            var parameter = new List <SqlParameter>();

            parameter.Add(this.basedal.CreateParameter("@ShippingId", 5, update.ShippingId, DbType.Int16));
            this.basedal.Update("SP_UpdateDetail", CommandType.StoredProcedure, parameter.ToArray(), out bool status);
            return(status);
        }
コード例 #2
0
        /// <summary>
        /// Implementation of Method.
        /// </summary>
        /// <param name="list">list.</param>
        /// <returns>value.</returns>
        public int InsertAddress(ShippingAddressModel list)
        {
            var parameter = new List <SqlParameter>();

            parameter.Add(this.basedal.CreateParameter("@ShippingId", 5, list.ShippingId, DbType.Int16));
            parameter.Add(this.basedal.CreateParameter("@OrderId", 5, list.OrderId, DbType.Int16));
            parameter.Add(this.basedal.CreateParameter("@ShippingAddress", 50, list.ShippingAddress, DbType.String));
            parameter.Add(this.basedal.CreateParameter("@ContactNumber", 12, list.ContactNumber, DbType.String));

            this.basedal.Insert("SP_InsertAddress", CommandType.StoredProcedure, parameter.ToArray(), out int lastId);

            return(lastId);
        }
コード例 #3
0
        /// <summary>
        /// Implementation of Method.
        /// </summary>
        /// <returns>value.</returns>
        public List <ShippingAddressModel> GetAddress()
        {
            var parameter = new List <SqlParameter>();
            List <ShippingAddressModel> list     = new List <ShippingAddressModel>();
            ShippingAddressModel        shipping = null;
            var addressList = this.basedal.GetData("SP_GetDetail", CommandType.StoredProcedure);

            foreach (DataRow data in addressList.Tables[0].Rows)
            {
                shipping                 = new ShippingAddressModel();
                shipping.ShippingId      = Convert.ToInt32(data[0]);
                shipping.OrderId         = Convert.ToInt32(data[1]);
                shipping.ShippingAddress = data[2].ToString();
                shipping.ContactNumber   = data[3].ToString();
                list.Add(shipping);
            }

            return(list);
        }