Exemplo n.º 1
0
        private void cmnuThemDM_Click(object sender, EventArgs e)
        {
            var frm = new DanhMucGiayForm();

            frm.MaximizeBox       = false;
            frm.MinimizeBox       = false;
            frm.TinhTrangForm     = (int)FormStateS.New;
            frm.IdDanhMucgiay     = 0;
            frm.TenDanhMuc        = "Cần tên danh mục";
            frm.TenNhaCungCapChon = lbxNhaCungCap.Text;
            frm.ThuTu             = 99;
            frm.ShowDialog();
            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                LoadDanhMucGiay();
            }
        }
Exemplo n.º 2
0
 private void cmnuSuaDM_Click(object sender, EventArgs e)
 {
     if (lvwDanhMucGiay.SelectedItems.Count > 0)
     {
         DanhMucGiayForm frm = new DanhMucGiayForm();
         frm.IdDanhMucgiay     = int.Parse(lvwDanhMucGiay.SelectedItems[0].Text);
         frm.MaximizeBox       = false;
         frm.MinimizeBox       = false;
         frm.TinhTrangForm     = (int)FormStateS.Edit;
         frm.IdDanhMucgiay     = IdDanhMucGiayChon;
         frm.TenDanhMuc        = lvwDanhMucGiay.SelectedItems[0].SubItems[1].Text;
         frm.TenNhaCungCapChon = lbxNhaCungCap.Text;
         frm.ThuTu             = int.Parse(lvwDanhMucGiay.SelectedItems[0].SubItems[3].Text);
         frm.ShowDialog();
         if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             LoadDanhMucGiay();
         }
     }
 }
        private void AcctingButtons_Click(object sender, EventArgs e)
        {
            Button btn;

            if (sender is Button)
            {
                btn = (Button)sender;
                if (btn == btnAddNewPaperCate)
                {
                    DanhMucGiayForm frm = new DanhMucGiayForm();
                    frm.MaximizeBox   = false;
                    frm.MinimizeBox   = false;
                    frm.TinhTrangForm = (int)Ennums.FormState.New;
                    frm.ShowDialog();
                    frm.Dispose();
                }
                if (btn == btnEditPaperCate)
                {
                    if (lvwDanhMucGiay.SelectedItems.Count > 0)
                    {
                        DanhMucGiayForm frm = new DanhMucGiayForm();
                        frm.IdDanhMucgiay = int.Parse(lvwDanhMucGiay.SelectedItems[0].Text);
                        frm.MaximizeBox   = false;
                        frm.MinimizeBox   = false;
                        frm.TinhTrangForm = (int)Ennums.FormState.Edit;
                        frm.ShowDialog();
                        frm.Dispose();
                    }
                }

                if (btn == btnDeletePaperCate)
                {
                }
            }
            LoadDanhMucGiay();
        }