Esempio n. 1
0
        private void Newbrand_Load(object sender, EventArgs e)
        {
            Master.Database.SupplierData Sup = new Master.Database.SupplierData();
            Sup.FnConn();
            DataTable dtBrand = Sup.DistinctColumn("spSupplier");

            //DataTable dtBrand = Sup.FillData();
            Sup.FnTrans();
            foreach (DataRow dr in dtBrand.Rows)
            {
                cmbVendor.Properties.Items.Add(dr["name"] + "");
            }

            if (Brand_ID != null)
            {
                btnSave.Caption = "Update";
                Inventory.Database.NewBrandData Brand = new Inventory.Database.NewBrandData();

                DataTable dtBrnd = new DataTable();
                Brand.FnConn();
                dtBrnd = Brand.GetRow(Brand_ID);
                Brand.FnTrans();

                if (dtBrnd.Rows.Count > 0)
                {
                    txtBrand.Text  = dtBrnd.Rows[0]["brandName"] + "";
                    cmbVendor.Text = dtBrnd.Rows[0]["vendor"] + "";
                }
            }
            else
            {
                btnDelete.Enabled = false;
            }
        }
Esempio n. 2
0
 private void Productname_Load(object sender, EventArgs e)
 {
     Test.Inventory.Database.NewBrandData Brand = new Inventory.Database.NewBrandData();
     try
     {
         Brand.FnConn();
         DataTable dt = Brand.FillData();
         gridControl1.DataSource = dt;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Esempio n. 3
0
 private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (Brand_ID != null)
     {
         DialogResult rs = MessageBox.Show(" Procced ?", "Alert", MessageBoxButtons.YesNo);
         if (rs == DialogResult.Yes)
         {
             Inventory.Database.NewBrandData Brand = new Inventory.Database.NewBrandData();
             Brand.FnConn();
             Brand.DeleteData(Brand_ID);
             Brand.FnTrans();
             Clear();
         }
     }
 }
Esempio n. 4
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Newbrand a = new Newbrand(null);

            a.ShowDialog();
            Test.Inventory.Database.NewBrandData Brand = new Inventory.Database.NewBrandData();
            try
            {
                Brand.FnConn();
                DataTable dt = Brand.FillData();
                gridControl1.DataSource = dt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 5
0
        private void repositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e)
        {
            DataRow  row      = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            string   Brand_ID = row["slno"].ToString();
            Newbrand NewBrand = new Newbrand(Brand_ID);

            NewBrand.ShowDialog();
            Inventory.Database.NewBrandData Brand = new Inventory.Database.NewBrandData();
            try
            {
                Brand.FnConn();
                DataTable dt = Brand.FillData();
                gridControl1.DataSource = dt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 6
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txtBrand.Text != "" && cmbVendor.Text != "")
            {
                Inventory.Database.NewBrandData NewBrand = new Inventory.Database.NewBrandData();
                NewBrand.Brand  = txtBrand.Text;
                NewBrand.Vendor = cmbVendor.Text;

                if (btnSave.Caption == "Save")
                {
                    NewBrand.FnConn();
                    NewBrand.fnTransactionData("I");
                    NewBrand.FnTrans();

                    if (NewBrand.Result == "Success")
                    {
                        MessageBox.Show("Brand Created", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Brand Creation failed", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    Clear();
                }
                else
                {
                    NewBrand.Slno = Brand_ID;
                    NewBrand.FnConn();
                    NewBrand.fnTransactionData("U");
                    NewBrand.FnTrans();

                    if (NewBrand.Result == "Success")
                    {
                        MessageBox.Show("Brand Created", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Brand Creation failed", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }