Esempio n. 1
0
File: FVay.cs Progetto: nttam1/tgas
        private void FVay_Load(object sender, EventArgs e)
        {
            if (MKho.Get(MKho.KHO_HANG).Count() == 0 || DataInstance.Instance().DBContext().NGUON_VAY.Count() == 0)
            {
                MessageBox.Show("CẦN TẠO KHO VÀ NGUỒN VAY TRƯỚC KHI VAY");
                this.Close();
                return;
            }
            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKHO);

            comboBoxKHO.DataSource    = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);
            comboBoxKHO.DisplayMember = "NAME";
            comboBoxKHO.ValueMember   = "ID";

            comboBoxNGUONVAY.DataSource    = DataInstance.Instance().DBContext().NGUON_VAY;
            comboBoxNGUONVAY.DisplayMember = "NAME";
            comboBoxNGUONVAY.ValueMember   = "ID";
            dataGridView1.DataSource       = bs;
            comboBoxNGUONVAY_SelectedIndexChanged(sender, e);

            foreach (Control c in this.Controls)
            {
                if (c.GetType().ToString() == "System.Windows.Forms.TextBox")
                {
                    c.KeyPress += new KeyPressEventHandler(c_KeyPress);
                }
            }

            dataGridView1.AutoResizeColumns();
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }
Esempio n. 2
0
        private void XuatHang_Load(object sender, EventArgs e)
        {
            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKho);
            var i2nKH  = new Id2Name(textBoxKHACHHANG, comboBoxKHACH_HANG);
            var i2nHH  = new Id2Name(textBoxHANGHOA, comboBoxHANGHOA);



            if (MKho.Get(MKho.KHO_HANG).Count() == 0 || MHangHoa.Get().Count() == 0)
            {
                MessageBox.Show("CẦN TẠO KHO VÀ HÀNG HÓA TRƯỚC KHI XUẤT HÀNG");
                this.Close();
                return;
            }

            comboBoxKho.DataSource    = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);
            comboBoxKho.DisplayMember = "NAME";
            comboBoxKho.ValueMember   = "ID";

            comboBoxKHACH_HANG.DataSource    = dbContext.KHACH_HANG.OrderBy(u => u.NAME);
            comboBoxKHACH_HANG.DisplayMember = "NAME";
            comboBoxKHACH_HANG.ValueMember   = "ID";

            comboBoxHANGHOA.DataSource    = dbContext.HANG_HOA.OrderBy(u => u.NAME);
            comboBoxHANGHOA.DisplayMember = "NAME";
            comboBoxHANGHOA.ValueMember   = "ID";
            dataGridView1.DataSource      = bs;
            comboBoxHANGHOA_SelectedIndexChanged(sender, e);

            dataGridView1.AutoResizeColumns();
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            textBoxMAKHO.Select();
            textBoxMAKHO.SelectAll();
        }
Esempio n. 3
0
        private void NhapHang_Load(object sender, EventArgs e)
        {
            if (MKho.Get(MKho.KHO_HANG).Count() == 0 || MHangHoa.Get().Count() == 0 || MNcc.Get().Count() == 0)
            {
                MessageBox.Show("CẦN TẠO KHO, HÀNG HÓA VÀ NHÀ CUNG CẤP TRƯỚC KHI NHẬP HÀNG");
                this.Close();
                return;
            }

            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKho);
            var i2nKH  = new Id2Name(textBoxNCC, comboBoxNCC);
            var i2nHH  = new Id2Name(textBoxHANGHOA, comboBoxHANGHOA);

            comboBoxKho.DataSource    = T_Manager.Modal.MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);//dbContext.KHOes.Where(u => u.TYPE == 0);
            comboBoxKho.DisplayMember = "NAME";
            comboBoxKho.ValueMember   = "ID";

            comboBoxNCC.DataSource    = T_Manager.Modal.MNcc.Get().OrderBy(u => u.NAME);//dbContext.NHA_CUNG_CAP;
            comboBoxNCC.DisplayMember = "NAME";
            comboBoxNCC.ValueMember   = "ID";

            comboBoxHANGHOA.DataSource    = dbContext.HANG_HOA.OrderBy(u => u.NAME);
            comboBoxHANGHOA.DisplayMember = "NAME";
            comboBoxHANGHOA.ValueMember   = "ID";
            dataGridView1.DataSource      = bs;
            comboBoxHANGHOA_SelectedIndexChanged(sender, e);
            dataGridView1.AutoResizeColumns();
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            textBoxMAKHO.Select();
            textBoxMAKHO.SelectAll();
        }
Esempio n. 4
0
File: FChi.cs Progetto: nttam1/tgas
        private void FChi_Load(object sender, EventArgs e)
        {
            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKHO);

            comboBoxKHO.DataSource    = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);
            comboBoxKHO.DisplayMember = "NAME";
            comboBoxKHO.ValueMember   = "ID";

            comboBoxNHANVIEN.DataSource    = dbContext.NHAN_VIEN.OrderBy(u => u.NAME);
            comboBoxNHANVIEN.DisplayMember = "NAME";
            comboBoxNHANVIEN.ValueMember   = "ID";

            comboBoxNBXE.DataSource    = dbContext.XEs.OrderBy(u => u.BIEN_SO);
            comboBoxNBXE.DisplayMember = "BIEN_SO";
            comboBoxNBXE.ValueMember   = "ID";

            comboBoxNBXANGDAU.DataSource    = dbContext.HANG_HOA.OrderBy(u => u.NAME);
            comboBoxNBXANGDAU.DisplayMember = "NAME";
            comboBoxNBXANGDAU.ValueMember   = "ID";

            comboBoxKHO_SelectedIndexChanged(sender, e);
            comboBoxNHANVIEN_SelectedIndexChanged(sender, e);

            radioButtonXANGDAU_CheckedChanged(sender, e);
        }
Esempio n. 5
0
        private void FThuNo_Load(object sender, EventArgs e)
        {
            if (MKho.Get(MKho.KHO_HANG).Count() == 0)
            {
                MessageBox.Show("CẦN TẠO KHO TRƯỚC");
                this.Close();
                return;
            }
            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKHO);
            var i2nKH  = new Id2Name(textBoxKHACHHANG, comboBoxKHACHHANG);

            comboBoxKHO.DataSource    = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);
            comboBoxKHO.DisplayMember = "NAME";
            comboBoxKHO.ValueMember   = "ID";

            comboBoxKHACHHANG.DataSource    = DataInstance.Instance().DBContext().KHACH_HANG.OrderBy(u => u.NAME);
            comboBoxKHACHHANG.DisplayMember = "NAME";
            comboBoxKHACHHANG.ValueMember   = "ID";

            comboBoxKHO_SelectedIndexChanged(sender, e);

            foreach (Control c in this.Controls)
            {
                if (c.GetType().ToString() == "System.Windows.Forms.TextBox")
                {
                    c.KeyPress += new KeyPressEventHandler(c_KeyPress);
                }
            }
            radioButtonNOHH_CheckedChanged(sender, e);
        }
Esempio n. 6
0
        private void FChoVay_Load(object sender, EventArgs e)
        {
            if (MKho.Get(MKho.KHO_HANG).Count() == 0 || DataInstance.Instance().DBContext().KHACH_HANG.Count() == 0)
            {
                MessageBox.Show("CẦN TẠO KHO VÀ KHÁCH HÀNG TRƯỚC");
                this.Close();
                return;
            }
            var i2nKHO = new Id2Name(textBoxMAKHO, comboBoxKHO);
            var i2nKH  = new Id2Name(textBoxKHACHHANG, comboBoxKHACHHANG);

            comboBoxKHO.DataSource          = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME);
            comboBoxKHO.DisplayMember       = "NAME";
            comboBoxKHO.ValueMember         = "ID";
            comboBoxKHACHHANG.DataSource    = DataInstance.Instance().DBContext().KHACH_HANG.OrderBy(u => u.NAME);
            comboBoxKHACHHANG.DisplayMember = "NAME";
            comboBoxKHACHHANG.ValueMember   = "ID";
            dataGridViewCHOVAY.DataSource   = bs;
            comboBoxKHACHHANG_SelectedIndexChanged(sender, e);
            textBoxMAKHO.Select();
            textBoxMAKHO.SelectAll();
        }