Esempio n. 1
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);
        }
Esempio n. 2
0
        public ResponseMessage PlaceCustomerOrder(PlaceCustomerOrder objOrder)
        {
            string reply = string.Empty;

            ResponseMessage rM = new ResponseMessage();

            try
            {
                var result = apiRepository.PlaceCustomerOrder(objOrder, ref reply);
                if (result[0] == "Y")
                {
                    rM.MessageCode   = "Y";
                    rM.Message       = result[1];
                    rM.SystemMessage = reply;
                    rM.Content       = result[1];
                }
                else
                {
                    rM.MessageCode   = "N";
                    rM.Message       = result[1];
                    rM.SystemMessage = reply;
                    rM.Content       = result[1];
                }
            }
            catch (Exception ex)
            {
                rM.MessageCode   = "N";
                rM.Message       = "Server Error";
                rM.SystemMessage = ex.Message;
                rM.Content       = "Server Error";
                return(rM);
            }


            return(rM);
        }