Пример #1
0
    protected void loads()
    {
        DataView dv;

        int orgid = Convert.ToInt16(messages.orgID);
        int catid = 0;// Convert.ToInt16(messages.catID);
        orgid = 12;

        if (messages.dvorgProducts != null)

        { dv = messages.dvorgProducts; }

        else
        {
            DataSet ds = new DataSet();

            ///////// ds   =     UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            //////  ds = UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            BLOrganization org = new BLOrganization();

            org.Orgitems.OrgID = orgid;

            org.Orgitems.CatID = catid;

            ds = org.Orgitems.UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            ///  ds = BLItems.o..UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            ///  ds = BLItems.GetItemsList("Q", "get_Items", 0, catid, orgid, "");

            //    BLItems Itemss = new BLItems();

            //BLOrganization.

            ///// Itemss.Items = Itemss.UpdateDonate(parm, commandtext, id, orgid, catid, status);
            //  return Itemss.Items;

            //// grdvSubGmach.AutoGenerateColumns = false;
            ///////  items().rowlimit = 15;

            dv = new DataView(ds.Tables[0]);
        }
        int rowLimit = items().rowlimit; ;

        // dv.RowFilter = "";
        DataTable dataTable = dv.ToTable();

        while (dataTable.Rows.Count > rowLimit)
            dataTable.Rows[dataTable.Rows.Count - 1].Delete();

        ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

        //  return dataTable;

        dataTable.TableName = "table1";

        DataView dvv = new DataView();

        dvv.Table = dataTable;

        dtalstItems.DataSource = dvv;// dataTable;// ds;

        dtalstItems.DataBind();
    }
Пример #2
0
    protected DataSet fillCart(BLOrganization orgs)
    {
        String parm; string commandtext=""; int id;
            int orgid; int catid=0;
            int itemid=0; string status;
            string auctiontype = messages.bidtype == null ? "" : messages.bidtype;
             int auctionid =  orgs.Orgitems.AuctionID;
            //messages.orgID=13;
             int buyerid = orgs.Orgitems.buyerID;
            orgid = orgs.orgID;// BLOrganization.orgID;// messages.orgs_.ID;//.orgID;

            //  int itemid = 0;
            // int orgid=0;
            int shippngCost = 0;
            //  int orgid = 0;
            String title = "";
            int quantity = 0;
            int catID = 0;
            String location = "";
            String orgPaypal = "";
            String description = "";
            String condition = "";
            //String shippngCost = status;
            DateTime startDate = DateTime.Today;
            DateTime endDate = DateTime.Today;
            DateTime soldDate = DateTime.Today;
            String commandName = commandtext;

            String prm ="C";// parm;

            int credits = 3;

            status = "";

            DataSet ds = new DataSet();

            string commandText =    commandtext;
            commandName ="get_Items"  ;// commandtext;
            //   string commandName;

                ///orgStatus = "";// drplstEmailSts.SelectedValue.ToString();
                ds = r.getItems(commandName, prm,buyerid, itemid, orgid, catid, location,
         description, quantity, shippngCost, condition, title,
              startDate, endDate, soldDate, auctiontype, auctionid);

            if( ds.Tables.Count > 0 )
                {

                    orgs.ShoppingCart.shoppingCart  = ds;
            }

            return ds;
    }
Пример #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.billingAddress = new BLAddress();
            this.shippingAddress = new BLAddress();
            this.shoppingCart = new BLShoppingCart();
            this.creditCard = new BLCreditCard();
            this.organization = new BLOrganization();
            this.organizationhld = new BLOrganization();
    }
Пример #4
0
    /// <summary>
    ///		Обновляет информацию об ордере
    /// </summary>
    /// 
    public static DataSet fillcarts(BLOrganization orgs   )
    {
        DataSet ds = new DataSet();
            ds = orgs.Orders.fillCart(orgs);//            messages.orgs_.Orders.fillCart();

            return ds;
    }
Пример #5
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();
            }
    }