public HttpResponseMessage addCreditCard([FromBody] CreditCards addCreditCard)
 {
     try
     {
         return(Request.CreateResponse(HttpStatusCode.OK, BLCreditCard.addCreditCard(addCreditCard)));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }
 public bool deleteLibrary(int idCreditCard)
 {
     return(BLCreditCard.deleteCreditCard(idCreditCard));
 }
Esempio n. 3
0
    private void ClearFields()
    {
        this.created = DateTime.MinValue;
            this.uid = string.Empty;
            this.saveInfo = false;

            this.creditCard = null;
            this.billingAddress = null;
            this.shippingAddress = null;
            this.shoppingCart = null;
            this.category = null;

            this.billingAddress = new BLAddress();
            this.shippingAddress = new BLAddress();
            this.shoppingCart = new BLShoppingCart();
            this.creditCard = new BLCreditCard();
            this.items = new BLItems();
            this.orders = new BLOrders();
            this.category = new BLCategory();
            this.item = new BLItem();
    }
Esempio n. 4
0
    public void Retrieve()
    {
        DataSet dsitems;

        ////////////////////  dsitems=  GetOrgList( , "S", "get_Orgs", this.ID, "");

         dsKnow =   r.get_orgKnow("get_orgKnow", "S", this.ID, "");

            if( this.uid.Length > 0 )
                dsitems = DALCCustomer.GetItemBySessionID(this.uid);
         			else
                dsitems = DALCCustomer.GetItem(this.id);

            if( dsitems.Tables.Count > 0 && dsitems.Tables[0].Rows.Count > 0)
            {
                this.id = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["ID"] );
                this.uid = Convert.ToString( dsitems.Tables["Customer"].Rows[0]["SessionID"] );
                this.created = Convert.ToDateTime( dsitems.Tables["Customer"].Rows[0]["Created"] );
                this.saveInfo = Convert.ToBoolean( dsitems.Tables["Customer"].Rows[0]["SaveInfo"] );

                int creditCardID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["CreditCardInfoID"] );
                int billingInfoID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["BillingAddressID"] );
                int shippingInfoID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["ShippingAddressID"] );

                if( creditCardID > 0)
                {
                    creditCard = new BLCreditCard();
                    creditCard.ID = creditCardID;
                    creditCard.Retrieve();
                }

                if( billingInfoID > 0 )
                {
                    billingAddress = new BLAddress();
                    billingAddress.ID = billingInfoID;
                    billingAddress.Retrieve();
                }

                if( shippingInfoID > 0 )
                {
                    shippingAddress = new BLAddress();
                    shippingAddress.ID = shippingInfoID;
                    shippingAddress.Retrieve();
                }

                if (shoppingCart == null)
                {
                    shoppingCart = new BLShoppingCart();
                }

                shoppingCart.CustomerID = this.id;
                shoppingCart.Retrieve();

                if(items == null)
                {
                     items = new BLItems();
                }
                 items.OrgID = this.id;
                items.Retrieve();

            }
            else
            {
                this.id = 0;
                ClearFields();
            }
    }
Esempio n. 5
0
    private void ClearFields()
    {
        this.created = DateTime.MinValue;
            this.uid = string.Empty;
            this.saveInfo = false;

            this.creditCard = null;
            this.billingAddress = null;
            this.shippingAddress = null;
            this.shoppingCart = null;

            this.billingAddress = new BLAddress();
            this.shippingAddress = new BLAddress();
            this.shoppingCart = new BLShoppingCart();
            this.creditCard = new BLCreditCard();
            this.organization = new BLOrganization();
            this.organizationhld = new BLOrganization();
    }
Esempio n. 6
0
    public void Retrieve()
    {
        DataSet dsitems;

            if( this.uid.Length > 0 )
                dsitems = DALCCustomer.GetItemBySessionID(this.uid);
         			else
                dsitems = DALCCustomer.GetItem(this.id);

            if( dsitems.Tables.Count > 0 && dsitems.Tables[0].Rows.Count > 0)
            {
                this.id = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["ID"] );
                this.uid = Convert.ToString( dsitems.Tables["Customer"].Rows[0]["SessionID"] );
                this.created = Convert.ToDateTime( dsitems.Tables["Customer"].Rows[0]["Created"] );
                this.saveInfo = Convert.ToBoolean( dsitems.Tables["Customer"].Rows[0]["SaveInfo"] );

                int creditCardID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["CreditCardInfoID"] );
                int billingInfoID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["BillingAddressID"] );
                int shippingInfoID = Convert.ToInt32( dsitems.Tables["Customer"].Rows[0]["ShippingAddressID"] );

                if (organization == null)
                {
                    organization = new BLOrganization();
                }

                if( creditCardID > 0)
                {
                    creditCard = new BLCreditCard();
                    creditCard.ID = creditCardID;
                    creditCard.Retrieve();
                }

                if( billingInfoID > 0 )
                {
                    billingAddress = new BLAddress();
                    billingAddress.ID = billingInfoID;
                    billingAddress.Retrieve();
                }

                if( shippingInfoID > 0 )
                {
                    shippingAddress = new BLAddress();
                    shippingAddress.ID = shippingInfoID;
                    shippingAddress.Retrieve();
                }

                if(shoppingCart == null)
                {
                    shoppingCart = new BLShoppingCart();
                }

                shoppingCart.CustomerID = this.id;
                shoppingCart.Retrieve();

                if(organization == null)
                {
                    organization = new  BLOrganization();
                }

                ///////////organization.ID  = messages.orgID;
                organization.Retrieve();/// = new BLShoppingCart();

               /// messages.cust = this ;

               /// messages.org = organization;

            }
            else
            {
                this.id = 0;
                ClearFields();
            }
    }