//---------------------------------------------------------------------
        #endregion

        #region --------------ChangeAddress--------------
        //---------------------------------------------------------------------
        //ChangeAddress
        //---------------------------------------------------------------------
        public bool ChangeAddress(OrderRequestAddress ShippingAddress, int userId)
        {
            bool savestats = false;

            try
            {
                string sp = "[dbo].[OrderRequestAddress_ChangeUserAddress]";
                //----------------------------------------------------------------
                CustomDbParameterList customParameters = ShippingAddress.GetMemberParameters(
                    e => e.OrderRequestAddressID,
                    e => e.FName,
                    e => e.LName,
                    e => e.CityID,
                    e => e.Mobile,
                    e => e.Address,
                    e => e.ShippingNote,
                    e => e.ChangeUserAddressAlso);
                //UserID
                customParameters.Add("@UserID", userId);
                //----------------------------------------------------------------
                SqlDataHelper.ExecuteStoredProcedure(sp, customParameters);
                //----------------------------------------------------------------
                savestats = true;
            }
            catch (Exception ex)
            {
                savestats = false;
            }
            return(savestats);
        }
        //---------------------------------------------------------------------
        //ConvertOrderRequestToFinalOrder
        //---------------------------------------------------------------------
        public bool ConvertOrderRequestToFinalOrder(OrderConfirmationFormDto request)
        {
            bool   isValid = false;
            string sp      = "[dbo].[Order_ConvertOrderRequestToFinalOrder]";
            //Prepare Parameters-----------------------------------------------
            CustomDbParameterList customParameters = request.GetMemberParameters(
                r => r.UserID,
                r => r.PaymentMethodID,
                r => r.ShippingMethodID,
                r => r.OrderRequestID,
                r => r.LangId,
                r => r.UserNote,
                r => r.FName,
                r => r.LName,
                r => r.CityID,
                r => r.Mobile,
                r => r.Address,
                //r => r.ShippingNote,
                r => r.ChangeUserAddressAlso);
            //customParameters.Add("@ShippingNote", request.UserNote);
            //IsValid
            SqlParameter IsValidOutputParameter = customParameters.AddOutputParameter_Boolean("@IsValid");

            //---------------------------------------------------------------------
            SqlDataHelper.ExecuteStoredProcedure(sp, customParameters);
            //----------------------------------------------------------------
            //IsValid
            isValid = (bool)IsValidOutputParameter.Value;
            return(isValid);
        }
        //---------------------------------------------------------------------
        #endregion

        #region --------------ChangeOrderStatus--------------
        //---------------------------------------------------------------------
        //ChangeOrderStatus
        //---------------------------------------------------------------------
        public bool ChangeOrderStatus(int orderID, EnumOrderStatus orderStatusID, float totalPaied, string adminNote)
        {
            bool savestats = false;

            try
            {
                //[dbo].[Order_ChangeOrderStatus]
                string sp = "[dbo].[Order_ChangeOrderStatus]";
                CustomDbParameterList customParameters = new CustomDbParameterList();
                //----------------------------------------------------------------
                customParameters.Add("@OrderID", orderID);
                customParameters.Add("@OrderStatusID", orderStatusID);
                customParameters.Add("@TotalPaied", totalPaied);
                customParameters.Add("@AdminNote", adminNote);
                //----------------------------------------------------------------
                SqlDataHelper.ExecuteStoredProcedure(sp, customParameters);
                //----------------------------------------------------------------
                savestats = true;
            }
            catch (Exception ex)
            {
                savestats = false;
            }
            return(savestats);
        }
Exemple #4
0
        //---------------------------------------------------------------------
        #endregion

        #region --------------UpdateProfile--------------
        //---------------------------------------------------------------------
        //UpdateProfile
        //---------------------------------------------------------------------
        public bool UpdateProfile(User user)
        {
            string sp         = "[dbo].[Users_UpdateProfile]";
            var    parameters = user.GetMemberParameters(
                u => u.UserID,
                u => u.FirstName,
                u => u.LastName,
                u => u.UserEmail,
                u => u.UserMobile,
                u => u.CityID,
                u => u.Address);

            int resultCount = SqlDataHelper.ExecuteStoredProcedure(sp, parameters);

            return((resultCount > 0) ? true : false);
        }
Exemple #5
0
        //---------------------------------------------------------------------
        //AddProfile
        //---------------------------------------------------------------------
        public bool AddProfile(User user)
        {
            string sp         = "[dbo].[Users_AddProfile]";
            var    parameters = user.GetMemberParameters(
                u => u.UserID,
                u => u.AspNetUserId,
                u => u.UserName,
                u => u.FirstName,
                u => u.LastName,
                u => u.UserEmail,
                u => u.UserMobile,
                u => u.EmailConfirmed,
                u => u.RoleID);

            int resultCount = SqlDataHelper.ExecuteStoredProcedure(sp, parameters);

            return((resultCount > 0) ? true : false);
        }