private InvoiceDetailModel InitEditPanel()
        {
            InvoiceDetailModel detail = new InvoiceDetailModel();

            initializareComboBox();
            foreach (DataGridViewRow row in dataGridViewDetalii.SelectedRows)
            {
                tbAmount.Text          = row.Cells[5].Value.ToString();
                detail.InvoiceDetailId = Convert.ToInt32(row.Cells[0].Value.ToString());
                tbObservations.Text    = row.Cells[6].Value.ToString();
                tbPrice.Text           = row.Cells[4].Value.ToString();
                tbQtty.Text            = row.Cells[3].Value.ToString();
                tbAmount.Text          = ((Convert.ToDecimal(row.Cells[4].Value.ToString())) *
                                          (Convert.ToDecimal(row.Cells[3].Value.ToString()))).ToString();
                DataTable items   = new DataTable();
                BLItems   blItems = new BLItems();
                try
                {
                    items        = blItems.GetItemNameById(Convert.ToInt32(row.Cells[2].Value.ToString()));
                    cbItems.Text = items.Rows[0]["ItemName"].ToString();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Eroare INIT PANEL!! " + ex.Message);
                }
            }
            return(detail);
        }
        public void initializareComboBox()
        {
            BLItems   blItems  = new BLItems();
            DataTable articole = blItems.GetItems();

            cbItems.DataSource    = articole;
            cbItems.DisplayMember = "ItemName";
            cbItems.ValueMember   = "ItemId";
        }
Exemplo 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();
    }
Exemplo 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();
            }
    }
Exemplo n.º 5
0
    /// public static DataSet get_watch(string commandName, string prm, int auctionid, int orgID, int buyerID)
    public DataSet fillWatch(BLItems items)
    {
        string commandName="get_watch";
                string prm ="B";
                int auctionid = items.AuctionID;// BLItems.AuctionID;

                int orgID = items.AuctionOrgID;//.OrgID;// BLOrganization.orgID;
                int buyerID = items.buyerID;// BLCustomer.buyerID;

                DataSet ds = new DataSet();

                ds = items.UpdateWatch(prm, commandName, orgID, buyerID, auctionid);
                return ds;
    }
Exemplo n.º 6
0
    //public static DataSet fillcarts()
    //{
    //    DataSet ds = new DataSet();
    // ds=    messages.cust.ShoppingCart.fillCart();
    // return ds;
    //}
    public void setWatch(BLItems items)
    {
        string commandName = "get_watch";
                string prm = "I";

                int auctionid = items.AuctionID;// BLItems.AuctionID;

                int orgID = items.OrgID;// BLOrganization.orgID;

                int buyerID = items.buyerID;// BLCustomer.buyerID;

                DataSet ds = new DataSet();

               ///  messages.orgs_.Orgitems.UpdateWatch(prm, commandName, orgID, buyerID, auctionid);
                 items.UpdateWatch(prm, commandName, orgID, buyerID, auctionid);
    }
Exemplo n.º 7
0
    public int GetOrgbyAuctionID(BLItems items,   int AuctionID )
    {
        DataSet ds =  new DataSet();

             int shippngCost = 0;
        //  int orgid = 0;
        String title = "";
        int quantity = 0;
        ////  catid = messages.blitem.catID;
        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 = "get_Items";

        String prm = "U";

        int credits = 1;

        //   string commandName;

            ///orgStatus = "";// drplstEmailSts.SelectedValue.ToString();
            ds = r.getItems(commandName, prm,0, 0, 0, 0, location,
         description, quantity, shippngCost, condition, title,
          startDate, endDate, soldDate, "",AuctionID
         );

            if(ds.Tables.Count>0  &&      ds.Tables[0].Rows.Count>0    )
            {
              int orgid=  Convert.ToInt16(  ds.Tables[0].Rows[0][0]) ;

            //  messages.orgs_.ID = orgid;

             // this.OrgID = orgid;

              items.AuctionOrgID = orgid;

            }

            return orgID;
    }