public ResponseModel GetOrderTabSettingDetails()
        {
            OrderTabSetting orderResponseDetails = new OrderTabSetting();
            HSOrderCaller   storecampaigncaller  = new HSOrderCaller();
            ResponseModel   objResponseModel     = new ResponseModel();
            int             statusCode           = 0;
            string          statusMessage        = "";

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                orderResponseDetails = storecampaigncaller.GetOrderTabSettingDetails(new HSOrderService(_connectionString),
                                                                                     authenticate.TenantId, authenticate.UserMasterID);
                statusCode =
                    orderResponseDetails.Exists.Equals(0) ?
                    (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success;

                statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode);

                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = statusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = orderResponseDetails;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }
Esempio n. 2
0
        /// <summary>
        /// GetOrderTabSettingDetails
        /// </summary>
        /// <param name="tenantId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public OrderTabSetting GetOrderTabSettingDetails(int tenantId, int userId)
        {
            DataSet         ds         = new DataSet();
            OrderTabSetting objdetails = new OrderTabSetting();

            try
            {
                conn.Open();
                MySqlCommand cmd = new MySqlCommand("SP_PHYGetOrderTabSettingDetails", conn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@_TenantID", tenantId);
                cmd.Parameters.AddWithValue("@_UserID", userId);

                MySqlDataAdapter da = new MySqlDataAdapter
                {
                    SelectCommand = cmd
                };
                da.Fill(ds);

                if (ds != null && ds.Tables[0] != null)
                {
                    objdetails = new OrderTabSetting
                    {
                        PaymentVisible     = ds.Tables[0].Rows[0]["Payment"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["Payment"]),
                        ShoppingBagVisible = ds.Tables[0].Rows[0]["ShoppingBag"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["ShoppingBag"]),
                        ShipmentVisible    = ds.Tables[0].Rows[0]["Shipment"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["Shipment"]),
                        StoreDelivery      = ds.Tables[0].Rows[0]["StoreDelivery"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["StoreDelivery"]),
                        Exists             = ds.Tables[0].Rows[0]["Exists"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["Exists"])
                    };
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
            return(objdetails);
        }
Esempio n. 3
0
        /// <summary>
        /// CheckPinCodeForCourierAvailibilty
        /// </summary>
        /// <param name="orderID"></param>
        ///  <param name="tenantID"></param>
        ///  <param name="userID"></param>
        /// <returns></returns>
        public ResponseCourierAvailibilty CheckPinCodeForCourierAvailibilty(HSChkCourierAvailibilty hSChkCourierAvailibilty, int tenantID, int userID, string clientAPIUrl)
        {
            ResponseCourierAvailibilty responseCourierAvailibilty = new ResponseCourierAvailibilty();

            try
            {
                hSChkCourierAvailibilty.Cod    = 0;
                hSChkCourierAvailibilty.Weight = 1;
                string apiReq = JsonConvert.SerializeObject(hSChkCourierAvailibilty);
                apiResponse = CommonService.SendApiRequest(clientAPIUrl + "api/ShoppingBag/ChkCourierAvailibilty", apiReq);
                responseCourierAvailibilty = JsonConvert.DeserializeObject <ResponseCourierAvailibilty>(apiResponse);

                if (responseCourierAvailibilty != null)
                {
                    if (responseCourierAvailibilty.Available.ToLower() == "false")
                    {
                        OrderTabSetting orderTabSetting = new OrderTabSetting();
                        orderTabSetting = GetOrderTabSettingDetails(tenantID, userID);
                        if (orderTabSetting.StoreDelivery)
                        {
                            responseCourierAvailibilty.Available = "true";
                        }
                    }
                }
                else
                {
                    responseCourierAvailibilty = new ResponseCourierAvailibilty
                    {
                        StatusCode = "201",
                        Available  = "false"
                    };
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            return(responseCourierAvailibilty);
        }