Beispiel #1
0
 private void tileAddUser_ItemClick(object sender, DevExpress.XtraEditors.TileItemEventArgs e)
 {
     if (isProductGrid)
     {
         using (frmEditProduct frm = new frmEditProduct(null))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 productBindingSource.DataSource = db.Products.ToList();
             }
         }
     }
     else if (isBrandGrid)
     {
         using (frmEditBrands frm = new frmEditBrands(null))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 brandBindingSource.DataSource = db.Brands.ToList();
             }
         }
     }
     else if (isCategoriesGrid)
     {
         using (frmEditCategory frm = new frmEditCategory(null))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 categoryBindingSource.DataSource = db.categories.ToList();
             }
         }
     }
 }
Beispiel #2
0
        private void bEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmEditProduct frm = new frmEditProduct();

            frm.ShowDialog();
            //if(frm.ShowDialog() == DialogResult.OK)
            //{
            //    //Do something
            //}
        }
Beispiel #3
0
 private void gridProducts_DoubleClick(object sender, EventArgs e)
 {
     if (productBindingSource.Current == null)
     {
         return;
     }
     using (frmEditProduct frm = new frmEditProduct(productBindingSource.Current as Product))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             productBindingSource.DataSource = db.Products.ToList();
         }
     }
 }
Beispiel #4
0
 private void tileEdit_ItemClick(object sender, DevExpress.XtraEditors.TileItemEventArgs e)
 {
     if (isProductGrid)
     {
         if (productBindingSource.Current == null)
         {
             return;
         }
         using (frmEditProduct frm = new frmEditProduct(productBindingSource.Current as Product))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 productBindingSource.DataSource = db.Products.ToList();
             }
         }
     }
     else if (isBrandGrid)
     {
         if (brandBindingSource.Current == null)
         {
             return;
         }
         using (frmEditBrands frm = new frmEditBrands(brandBindingSource.Current as Brand))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 brandBindingSource.DataSource = db.Brands.ToList();
             }
         }
     }
     else if (isCategoriesGrid)
     {
         if (categoryBindingSource.Current == null)
         {
             return;
         }
         using (frmEditCategory frm = new frmEditCategory(categoryBindingSource.Current as category))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 categoryBindingSource.DataSource = db.categories.ToList();
             }
         }
     }
 }