public JMAWebServiceCommonBase(Controller page, string userName, string password, string qbUrl, string eCommerceSystem, JMASettings jmaSettings)
        {
            Page = page;
            UserName = userName;
            Password = password;
            QBUrl = qbUrl;
            ECommerceSystem = eCommerceSystem;

            if (page.Session["FriendlyEmail"] != null)
            {
                FriendlyEmail = page.Session["FriendlyEmail"].ToString();
            }
            else
            {
                FriendlyEmail = userName;
            }

            //SettingProvider = SettingFactory.Get(ConnectionString, FriendlyEmail);
            LogProvider = LogFactory.Get(ConnectionString, FriendlyEmail);

            if (jmaSettings != null)
            {
                Settings = jmaSettings;
            }
            else
            {
                Settings = SettingProvider.GetSettings(FriendlyEmail);
            }
        }
 public JMABigCommerceProvider(Controller page, string userName, string password, string qbUrl, string eCommerceSystem, JMASettings qboSettings)
     : base(page, userName, password, qbUrl, eCommerceSystem, qboSettings)
 {
     bigCommerceApi = new BigCommerceRestApi(password, userName, qbUrl);
 }
 public string SaveSettings(JMASettings model)
 {
     return SettingProvider.Update_BulkSetting(model, FriendlyEmail);
 }
        private bool RightOrderStatus(JMASettings jma, order st)
        {
            //get rid of canceled orders
            string status = st.status.Trim().ToLower();
            if (!jma.DeleteQBDuplicates && status == "canceled" || status == "declined" || status == "refunded")
            {
                return false;
            }
            if (!String.IsNullOrEmpty(jma.OrderStatus))
            {
                foreach (string s in jma.OrderStatus.Split(','))
                {
                    if (st.status.Trim().ToLower() == s.Trim().ToLower())
                    {
                        return true;
                    }
                }

                return false;
            }

            return true;
        }