Beispiel #1
0
        public frmTool()
        {
            InitializeComponent();
            serviceDA = new AlmacenDisecWS.DBControllerWSClient();

            listWayToPay.Add("CRÉDITO");
            listWayToPay.Add("CONTADO");

            cboWayofPay.DataSource    = listWayToPay;
            cboWayofPay.SelectedIndex = -1;

            cboBrand.DataSource    = serviceDA.queryAllBrand();
            cboBrand.DisplayMember = "brand_name";
            cboBrand.ValueMember   = "brand_id";


            cboCategory.DataSource    = serviceDA.queryAllCategory();
            cboCategory.DisplayMember = "category_name";
            cboCategory.ValueMember   = "category_id";

            //AlmacenDisecWS.category c = (AlmacenDisecWS.category)cboCategory.SelectedItem;
            //cboFamily.DisplayMember = "name_family";
            //cboFamily.ValueMember = "id_family";
            //cboFamily.DataSource = serviceDA.queryAllFamily(c.category_id);
            //cboFamily.SelectedValue = -1;

            cboSupplier.DataSource    = serviceDA.queryAllSupplier();
            cboSupplier.DisplayMember = "supplier_name";
            cboSupplier.ValueMember   = "id_supplier";

            cboStorehouse.DataSource    = serviceDA.queryAllStorehouse();
            cboStorehouse.DisplayMember = "storehouse_name";
            cboStorehouse.ValueMember   = "id_storehouse";


            cboMoney.DataSource = userTypes;

            txtCode.Enabled   = false;
            txtId.Enabled     = false;
            btnDelete.Enabled = false;
            btnDataG.Enabled  = true;
            btnCancel.Enabled = true;

            cboBrand.SelectedValue      = -1;
            cboCategory.SelectedValue   = -1;
            cboSupplier.SelectedValue   = -1;
            cboFamily.SelectedValue     = -1;
            cboStorehouse.SelectedValue = -1;
            cboMoney.SelectedIndex      = -1;

            txtName.CharacterCasing = CharacterCasing.Upper;
        }
Beispiel #2
0
 public frmInventory()
 {
     InitializeComponent();
     serviceDA = new AlmacenDisecWS.DBControllerWSClient();
     listas.Add("Materiales");
     listas.Add("Herramientas");
     cboInventory.DataSource    = listas;
     cboInventory.SelectedIndex = -1;
     cboStore.DataSource        = serviceDA.queryAllStorehouse();
     cboStore.DisplayMember     = "storehouse_name";
     cboStore.SelectedIndex     = -1;
     cboStore.ValueMember       = "id_storehouse";
     dgvMaterial.Visible        = false;
     dgvTool.Visible            = false;
     lblM.Visible    = false;
     lblTool.Visible = false;
 }
        private void BtnSearch_Click_1(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtSearch.Text))
            {
                /*
                 * dgvSearch.AutoGenerateColumns = false;
                 * dgvSearch.DataSource = serviceDA.queryAllStorehouse();
                 */

                list.Clear();
                int cont = 0;
                AlmacenDisecWS.storehouse[] a = new AlmacenDisecWS.storehouse[100];

                a    = serviceDA.queryAllStorehouse();
                cont = a.Count();
                for (int i = 0; i < cont; i++)
                {
                    Storehouse s = new Storehouse();
                    s.id_storehouse     = a[i].id_storehouse;
                    s.phone_number      = a[i].phone_number;
                    s.storehouse_name   = a[i].storehouse_name;
                    s.city.id_city      = a[i].city.id_city;
                    s.city.name_city    = a[i].city.name_city;
                    s.address           = a[i].address;
                    s.storehouse_status = a[i].storehouse_status;
                    list.Add(s);
                }

                dgvSearch.AutoGenerateColumns = false;
                dgvSearch.DataSource          = list;
            }
            else
            {
                String name = txtSearch.Text;

                //Insertar el codigo de busqueda por nombre
            }
            btnModify.Enabled = true;
        }