Esempio n. 1
0
        private void update_Click(object sender, EventArgs e)
        {
            Add_cat   w  = new Add_cat();
            DataTable dd = cm.get_full_cate(this.category_dgv.CurrentRow.Cells[1].Value.ToString());

            w.check               = "edite";
            w.cate_name.Text      = dd.Rows[0].ItemArray[1].ToString();
            w.cate_name.ReadOnly  = true;
            w.description.Text    = dd.Rows[0].ItemArray[2].ToString();
            w.sell_price.Text     = dd.Rows[0].ItemArray[3].ToString();
            w.discount.Text       = dd.Rows[0].ItemArray[4].ToString();
            w.less_price.Text     = dd.Rows[0].ItemArray[5].ToString();
            w.classification.Text = dd.Rows[0].ItemArray[6].ToString();
            w.barcode.Text        = dd.Rows[0].ItemArray[7].ToString();
            w.cate_code.Text      = dd.Rows[0].ItemArray[8].ToString();
            w.another_code.Text   = dd.Rows[0].ItemArray[9].ToString();
            w.less_quantity.Text  = dd.Rows[0].ItemArray[10].ToString();
            w.unit.Text           = dd.Rows[0].ItemArray[15].ToString();
            if (dd.Rows[0].ItemArray[12].ToString().Contains("1"))
            {
                w.checkBox3.Checked = true;
            }
            if (dd.Rows[0].ItemArray[13].ToString().Contains("1"))
            {
                w.checkBox1.Checked = true;
            }
            if (dd.Rows[0].ItemArray[14].ToString().Contains("1"))
            {
                w.checkBox2.Checked = true;
            }
            w.cate_unite.DataSource = cm.get_cate_unit(this.category_dgv.CurrentRow.Cells[1].Value.ToString());

            w.cate_warehouses.DataSource = cm.get_ware_quant(this.category_dgv.CurrentRow.Cells[1].Value.ToString());
            if (w.cate_warehouses.Rows.Count < 0)
            {
                w.cate_warehouses.Columns.RemoveAt(1);
                w.cate_warehouses.Columns.RemoveAt(2);
            }

            /* byte[] image = (byte[])cm.get_cate_image(this.category_dgv.CurrentRow.Cells[1].Value.ToString()).Rows[0][0];
             * MemoryStream ms = new MemoryStream(image);
             * w.cat_image.Image = Image.FromStream(ms);*/
            w.save.Text        = "تعديل";
            w.save_new.Visible = false;
            w.ShowDialog();
        }
Esempio n. 2
0
        private void save_new_Click(object sender, EventArgs e)
        {
            Add_cat ad = new Add_cat();

            button6_Click(sender, e);

            /* Close();
             * ad.ShowDialog();*/
            cate_code.Text         = "";
            cate_name.Text         = "";
            classification.Text    = "";
            less_price.Text        = "";
            less_quantity.Text     = "";
            sell_price.Text        = "";
            discount.Text          = "";
            barcode.Text           = "";
            another_code.Text      = "";
            mainunit_no.Text       = "";
            main_unit_smaller.Text = "";
            unit.Text                = "";
            unitno.Text              = "";
            unit_name.Text           = "";
            main_unit_smaller.Text   = "";
            mainunit_no.Text         = "";
            description.Text         = "";
            sell_price_for_each.Text = "";
            if (cat_image.Image != null)
            {
                cat_image.Image.Dispose();
                cat_image.Image = null;
            }

            for (int i = 0; i < cate_warehouses.Rows.Count; i++)
            {
                cate_warehouses.Rows[i].Cells[1].Value = "";
                cate_warehouses.Rows[i].Cells[0].Value = "";
            }
            cate_unite.Rows.Clear();
            cate_unite.Refresh();
        }
Esempio n. 3
0
        private void add_cat_btn_Click(object sender, EventArgs e)
        {
            Add_cat adc = new Add_cat();

            adc.ShowDialog();
        }