Beispiel #1
0
        public frmRentFurniture(DataSet Dataset_employee, DataSet DT, List <String> items)
        {
            Dataset_customer      = DT;
            this.Dataset_employee = Dataset_employee;
            cart = items;
            InitializeComponent();
            TxtRentDate.Text    = DateTime.Now.ToShortDateString();
            TxtEmployee_id.Text = Dataset_employee.Tables[0].Rows[0][0].ToString();
            TxtCustomer_id.Text = Dataset_customer.Tables[0].Rows[0][0].ToString();
            int price = 0;

            foreach (String id in cart)
            {
                price             = price + int.Parse(new DB_Access().furniture(id).Tables[0].Rows[0][5].ToString());
                Dataset_furniture = new DB_Access().furniture(id);
                grid_selected_item.Rows.Add(Dataset_furniture.Tables[0].Rows[0][0].ToString(), Dataset_furniture.Tables[0].Rows[0][1].ToString(), Dataset_furniture.Tables[0].Rows[0][2].ToString(), Dataset_furniture.Tables[0].Rows[0][3].ToString(), Dataset_furniture.Tables[0].Rows[0][4].ToString(), Dataset_furniture.Tables[0].Rows[0][5].ToString());
            }
            TxtTotal_price.Text = price.ToString();
        }
Beispiel #2
0
        private void sortby(object senDataSetEmployeer, EventArgs e)
        {
            Cobox_selectItem.Items.Clear();
            DataSet DataSet = null;

            if (Cobox_sortby.Text == "By Item Number")
            {
                DataSet   = new DB_Access().furnitureTypes("item_num");
                field     = "item_num";
                procedure = "FurnitureByItem";
            }
            else if (Cobox_sortby.Text == "By Category")
            {
                DataSet   = new DB_Access().furnitureTypes("category");
                field     = "category";
                procedure = "FurnitureByCategory";
            }
            else if (Cobox_sortby.Text == "By Style")
            {
                DataSet   = new DB_Access().furnitureTypes("Style");
                field     = "Style";
                procedure = "FurnitureByStyle";
            }
            else if (Cobox_sortby.Text == "By Furniture ID")
            {
                DataSet   = new DB_Access().furnitureTypes("F_id");
                field     = "F_id";
                procedure = "FurnitureByFid";
            }
            if (DataSet != null)
            {
                foreach (DataRow row in DataSet.Tables[0].Rows)
                {
                    Cobox_selectItem.Items.Add(row[0].ToString());
                }
            }
        }
Beispiel #3
0
 private void selectItems(object senDataSetEmployeer, EventArgs e)
 {
     DataSet = new DB_Access().Searchfurniture(field, Cobox_selectItem.Text, procedure);
     grid_ShowItem.DataSource = DataSet.Tables[0].DefaultView;
 }