Exemplo n.º 1
0
        private void buttonFind_Click(object sender, EventArgs e)
        {
            AddEditInventory addEditInv = new AddEditInventory();

            addEditInv = this;

            CustomerItem c = new CustomerItem(ref addEditInv);



            int place = cmbItemCustomer.SelectedIndex;

            cmd.Parameters["@custID"].Value = customerIDList[place];
            String data = customerIDList[place];


            /* MessageBox.Show(place.ToString());
             * MessageBox.Show(customerIDList[place]);
             * MessageBox.Show(cmd.Parameters["@custID"].Value.ToString());*/
            c.ourData = customerIDList[place];

            //query = queries.getItemID;
            //cmd.CommandText = query;
            // MessageBox.Show(query);

            // passMqSqlArgue(query, data, dataGridView1, "s2016_user1.item");



            c.Show();
        }
Exemplo n.º 2
0
        private void btnEditInventory_Click(object sender, EventArgs e)
        {
            addEditInventory = new AddEditInventory();

            /*int id;
             * int.TryParse(dgvInventory.Rows[dgvInventory.SelectedRows[0].Index].Cells[0].Value.ToString(), out id);
             * addEditInventory = new AddEditInventory();*/
            openWindow("AddEditInventory", ref addEditInventory, "Edit");
            //addEditInventory.setID(id);
        }
Exemplo n.º 3
0
        private void openWindow(string formName, ref AddEditInventory form, string type)
        {
            if (((Form)Application.OpenForms[formName]) == null)
            {
                form.MdiParent = (Form)Application.OpenForms["WarehouseSystem"];
                if (type == "Add")
                {
                    form.setType("Add");
                }
                else if (type == "Edit")
                {
                    form.setType("Edit");
                }
                else if (type == "Delete")
                {
                    form.setType("Delete");
                }
                form.Show();
            }
            else
            {
                form = (AddEditInventory)Application.OpenForms[formName];
                AddEditInventory a = new AddEditInventory();
                if (type == "Add")
                {
                    form.setType("Add");
                }
                else if (type == "Edit")
                {
                    form.setType("Edit");
                    a.getDeleteData("Edit");
                }
                else if (type == "Delete")
                {
                    form.setType("Delete");

                    a.getDeleteData("Delete");
                    a.checkType();
                }
                form.Focus();
            }
        }
Exemplo n.º 4
0
 public CustomerItem(ref AddEditInventory form1handel)
 {
     InitializeComponent();
     firstformRef = form1handel;
 }
Exemplo n.º 5
0
 private void btnAddInventory_Click(object sender, EventArgs e)
 {
     addEditInventory = new AddEditInventory();
     openWindow("AddEditInventory", ref addEditInventory, "Add");
 }