private void BtnSave_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtName.Text))
            {
                frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
                frm.ShowDialog();
            }
            else
            {
                if (flag == true)
                {
                    frmMessageBoxSave frm = new frmMessageBoxSave();
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        String name = txtName.Text;
                        AlmacenDisecWS.category c = new AlmacenDisecWS.category();
                        c.category_name = name;
                        serviceDA.insertCategory(c);
                        dgvSearch.AutoGenerateColumns = false;
                        dgvSearch.DataSource          = serviceDA.queryAllCategory();
                        reiniciar();
                        btnModify.Enabled = true;
                        operation         = true;
                    }
                }
                else
                {
                    if (String.IsNullOrEmpty(txtId.Text))
                    {
                        frmMessageBoxFillNull frm2 = new frmMessageBoxFillNull();
                        frm2.ShowDialog();
                    }
                    else
                    {
                        frmMessageBoxSave frm = new frmMessageBoxSave();
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            int    id   = Int32.Parse(txtId.Text);
                            String name = txtName.Text;
                            AlmacenDisecWS.category c = new AlmacenDisecWS.category();
                            c.category_name = name;
                            c.category_id   = id;
                            serviceDA.updateCategory(c);

                            dgvSearch.AutoGenerateColumns = false;

                            dgvSearch.DataSource = serviceDA.queryAllCategory();
                            reiniciar();
                            operation         = true;
                            btnModify.Enabled = true;
                        }
                    }
                }
            }
        }
Exemple #2
0
        public frmFamily()
        {
            InitializeComponent();
            btnModify.Enabled = false;
            btnSave.Enabled   = false;
            btnDelete.Enabled = false;

            serviceDA = new AlmacenDisecWS.DBControllerWSClient();
            cboCategory.DataSource    = serviceDA.queryAllCategory();
            cboCategory.DisplayMember = "category_name";
            cboCategory.ValueMember   = "category_id";
            cboCategory.Enabled       = false;

            serviceDA               = new AlmacenDisecWS.DBControllerWSClient();
            cmbSearch.DataSource    = serviceDA.queryAllCategory();
            cmbSearch.DisplayMember = "category_name";
            cmbSearch.ValueMember   = "category_id";
            cmbSearch.Enabled       = true;

            txtId.Enabled           = false;
            txtName.Enabled         = false;
            txtName.CharacterCasing = CharacterCasing.Upper;

            listas.Add("MATERIAL");
            listas.Add("HERRAMIENTA");

            cboType.DataSource        = listas;
            cboType.Enabled           = false;
            cboCategory.SelectedIndex = -1;
            cboType.SelectedIndex     = -1;
            cmbSearch.SelectedIndex   = -1;
        }
Exemple #3
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;
        }
Exemple #4
0
        public frmMaterial()
        {
            InitializeComponent();
            //txtCode.Enabled = false;
            // Bitmap img = new Bitmap(Application.StartupPath+@"\img\fondo.jpg");
            // this.BackgroundImage = img;
            // this.BackgroundImageLayout = ImageLayout.Stretch;
            serviceDA = new AlmacenDisecWS.DBControllerWSClient();
            listas.Add("SOLES");
            listas.Add("DOLARES");

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



            cboUnit.DataSource    = serviceDA.queryAllMeasurement_Unit();
            cboUnit.DisplayMember = "abbrevation_measure_unit";
            cboUnit.ValueMember   = "id_measure_unit";


            cboMoney.DataSource = listas;

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

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

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

            cboBrand.SelectedIndex    = -1;
            cboCategory.SelectedIndex = -1;
            cboFamily.SelectedIndex   = -1;
            cboUnit.SelectedIndex     = -1;
            cboStatus.SelectedIndex   = -1;
            cboSupplier.SelectedIndex = -1;
            cboMoney.SelectedIndex    = -1;
            txtCode.Enabled           = false;
            btnDelete.Enabled         = false;
            txtName.CharacterCasing   = CharacterCasing.Upper;
        }