コード例 #1
0
        public string[] SaveUserAddress(UserAddress userAddress, ref string replay)
        {
            string[] res = new string[4];

            string msg_code = string.Empty;
            string msg      = string.Empty;

            try
            {
                objSqlProcManager = new SqlProcedureManager(connectionString);
                string spname = "sp_User_Address_Insert_Update";

                var result = objSqlProcManager.ExecuteNonQuery(spname, ref replay,
                                                               0,
                                                               userAddress.UserId,
                                                               userAddress.AddressTitle,
                                                               userAddress.StreetAddress,
                                                               userAddress.City,
                                                               userAddress.PostCode,
                                                               userAddress.Country,
                                                               userAddress.Latitude,
                                                               userAddress.Longitude,

                                                               "Y"
                                                               );

                if (result > 0)
                {
                    res[0] = "Y";
                    res[1] = "Address saved successfully.";
                }
                else
                {
                    res[0] = "N";
                    res[1] = "Failed to save address.";
                }


                return(res);
            }
            catch (Exception errorException)
            {
                throw errorException;
            }
            return(res);
        }
コード例 #2
0
        public string[] PlaceCustomerOrder(PlaceCustomerOrder objOrder, ref string replay)
        {
            string[] res = new string[4];

            string msg_code = string.Empty;
            string msg      = string.Empty;

            try
            {
                objSqlProcManager = new SqlProcedureManager(connectionString);
                string spname = "sp_Create_Order";

                var result = objSqlProcManager.ExecuteNonQuery(spname, ref replay,
                                                               objOrder.MenuId,
                                                               objOrder.CustomerId,
                                                               objOrder.DeleveryDate,
                                                               objOrder.DeleveryDayName,
                                                               objOrder.Quantity,
                                                               objOrder.AddressId,
                                                               objOrder.DeleveryAddress,
                                                               objOrder.ReceiverName,
                                                               objOrder.UserRemarks
                                                               );

                if (result > 0)
                {
                    res[0] = "Y";
                    res[1] = "Order placed successfully.";
                }
                else
                {
                    res[0] = "N";
                    res[1] = "Failed to placed order.";
                }


                return(res);
            }
            catch (Exception errorException)
            {
                throw errorException;
            }
            return(res);
        }
コード例 #3
0
        public string[] SaveMessage(UserToVendorMessage newMessage, ref string replay)
        {
            string[] res = new string[4];

            string msg_code = string.Empty;
            string msg      = string.Empty;

            try
            {
                objSqlProcManager = new SqlProcedureManager(connectionString);
                string spname = "sp_Save_a_Message";

                var result = objSqlProcManager.ExecuteNonQuery(spname, ref replay,
                                                               newMessage.SenderId,
                                                               newMessage.ReceiverId,
                                                               newMessage.MessageDetails,
                                                               "",
                                                               "Y"
                                                               );

                if (result > 0)
                {
                    res[0] = "Y";
                    res[1] = "Message sent.";
                }
                else
                {
                    res[0] = "N";
                    res[1] = "Failed to send message.";
                }

                //  string decryptedPassword = objEncrypt.DecryptString(encryptedPassword, "");

                return(res);
            }
            catch (Exception errorException)
            {
                throw errorException;
            }
            return(res);
        }
コード例 #4
0
        public string[] CancleOrderByUser(CancleOrderEntity objOrder, ref string replay)
        {
            string[] res = new string[4];

            string msg_code = string.Empty;
            string msg      = string.Empty;

            try
            {
                objSqlProcManager = new SqlProcedureManager(connectionString);
                string spname = "sp_Cancel_Order_ByUser";

                var result = objSqlProcManager.ExecuteNonQuery(spname, ref replay,
                                                               objOrder.OrderId,
                                                               objOrder.CustomerId

                                                               );

                if (result > 0)
                {
                    res[0] = "Y";
                    res[1] = "Order cancled successfully.";
                }
                else
                {
                    res[0] = "N";
                    res[1] = "Failed to cancle order.";
                }


                return(res);
            }
            catch (Exception errorException)
            {
                throw errorException;
            }
            return(res);
        }