示例#1
0
 private void btnDataGrid_Click(object sender, EventArgs e)
 {
     foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
     foodTypeBindingSource.DataSource = Food_TypeBUS.GetAll();
     combSizeFilter.DataSource        = Food_SizeBUS.GetAll();
     combTypeFilter.DataSource        = Food_TypeBUS.GetAll();
     foodDishBindingSource.DataSource = Food_DishBUS.GetAll();
 }
示例#2
0
文件: Order.cs 项目: thanhtai113/test
 private void btnDataGridRef_Click(object sender, EventArgs e)
 {
     foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
     foodTypeBindingSource.DataSource = Food_TypeBUS.GetAll();
     combSizeFilter.DataSource        = Food_SizeBUS.GetAll();
     combTypeFilter.DataSource        = Food_TypeBUS.GetAll();
     foodDishBindingSource.DataSource = Food_DishBUS.dish_NotLocked();
     txtSearchName.Clear();
 }
示例#3
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     panCRUD.Enabled                  = false;
     panFilter.Enabled                = false;
     panSave.Enabled                  = true;
     panType_Size.Enabled             = false;
     dataGridDish.Enabled             = false;
     foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
     foodTypeBindingSource.DataSource = Food_TypeBUS.GetAll();
 }
示例#4
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     comboSize.DataSource = Food_SizeBUS.GetAll();
     comboType.DataSource = Food_TypeBUS.GetAll();
     foodDishBindingSource.Add(new Food_Dish());
     foodDishBindingSource.MoveLast();
     dataGridDish.Enabled = false;
     panCRUD.Enabled      = false;
     panFilter.Enabled    = false;
     panSave.Enabled      = true;
     panType_Size.Enabled = false;
 }
示例#5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtSizeName.Text))
     {
         MessageBox.Show("Name field is empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtSizeName.Focus();
     }
     else
     {
         Food_Size obj = foodSizeBindingSource.Current as Food_Size;
         if (obj.Id == 0)
         {
             if (Food_SizeBUS.checkName(txtSizeName.Text))
             {
                 MessageBox.Show("This name is already exist", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txtSizeName.Focus();
             }
             else
             {
                 Food_SizeBUS.insert(obj);
                 foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
                 foodSizeBindingSource.MoveLast();
                 MessageBox.Show("Add successfully!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 panCRUD.Enabled = true;
                 panSave.Enabled = false;
             }
         }
         else
         {
             Food_SizeBUS.edit(obj);
             MessageBox.Show("Update successfully!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
             panCRUD.Enabled = true;
             panSave.Enabled = false;
         }
     }
 }
示例#6
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     panSave.Enabled = false;
     panCRUD.Enabled = true;
     foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
 }
示例#7
0
 private void btnRef_Click(object sender, EventArgs e)
 {
     foodSizeBindingSource.DataSource = Food_SizeBUS.GetAll();
 }