Exemplo n.º 1
0
        public JObject UpdateAccountOwnerDetails(string sConnString, OU.AccountProducts Account, int quotationId)
        {
            decimal AccountID;

            Orders.DataAccessLayer.Accounts accountsObj = new DataAccessLayer.Accounts(sConnString);
            responseObj = accountsObj.UpdateAccountProduct(Account, quotationId);
            return(responseObj);
        }
Exemplo n.º 2
0
        public JObject GetAccountOwnersAndPlans(string sConnString, byte productId)
        {
            bool success;

            Orders.DataAccessLayer.Accounts accountsObj = new DataAccessLayer.Accounts(sConnString);
            responseObj = accountsObj.GetAccountOwnersAndPlans(productId, out success);
            return(responseObj);
        }
Exemplo n.º 3
0
        public JObject CreateAccountProducts(string sConnString, byte productId, string accountUrl, string mobileNumber)
        {
            bool    success = false;
            decimal accountId = 0, accountProductID = 0;
            bool    isFirstTime = false;
            JObject userObj;

            Orders.DataAccessLayer.Accounts accountsObj = new DataAccessLayer.Accounts(sConnString);


            //if (!success)
            //{
            //if (_ds.Tables.Count > 0 && _ds.Tables[0].Rows.Count > 0)
            //{
            responseObj = GetAccountDetailApi(accountUrl, mobileNumber);
            isFirstTime = true;

            //}
            //else
            //{
            //    responseObj = new JObject(new JProperty("Success", false),
            //        new JProperty("Message", "No User details Found"));
            //    return responseObj;
            //}
            //}

            if (Convert.ToBoolean(responseObj.SelectToken("Success").ToString()) == true)
            {
                AccountProducts accountProductProperties = new AccountProducts();
                accountProductProperties.ProductAccountName = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("NickName").ToString();
                accountProductProperties.MobileNo           = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("MobileNumber").ToString();
                accountProductProperties.Email            = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("EmailID").ToString();
                accountProductProperties.Address          = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("Address").ToString();
                accountProductProperties.Gstin            = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("GSTIN").ToString();
                accountProductProperties.Company          = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("Company").ToString();
                accountProductProperties.StateId          = Convert.ToInt32(responseObj.SelectToken(Label.USER_DETAILS).SelectToken("StateId").ToString());
                accountProductProperties.Country          = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("Country").ToString();
                accountProductProperties.ProductAccountId = Convert.ToInt32(responseObj.SelectToken(Label.USER_DETAILS).SelectToken("UserId").ToString());
                accountProductProperties.ProductId        = productId;
                accountProductProperties.OwnerShipEmail   = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("OwnerShip").ToString();;
                accountProductProperties.RegisteredDate   = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("RegisteredDate").ToString();
                accountProductProperties.AccessToken      = responseObj.SelectToken(Label.USER_DETAILS).SelectToken("AccessToken").ToString();
                accountProductProperties.BillingDay       = Convert.ToInt32(responseObj.SelectToken(Label.USER_DETAILS).SelectToken("BillingDay"));
                accountProductProperties.BillingMode      = Convert.ToInt32(responseObj.SelectToken(Label.USER_DETAILS).SelectToken("BillingModeId"));
                Orders.DataAccessLayer.Accounts account = new Orders.DataAccessLayer.Accounts(sConnString);
                account.CreateAccountProduct(accountProductProperties, out accountId, out accountProductID);
                responseObj[Label.USER_DETAILS][Label.ACCOUNT_ID]         = Convert.ToInt64(accountId);
                responseObj[Label.USER_DETAILS][Label.ACCOUNT_PRODUCT_ID] = Convert.ToInt64(accountProductID);
            }
            responseObj = accountsObj.GetAccountProductDetails(productId, mobileNumber, out success);
            responseObj.Add(new JProperty(Label.ISFIRSTTIME, isFirstTime));

            return(responseObj);
        }