Exemplo n.º 1
0
        void ThemMoi()
        {
            DataRow row = DTctrl.NewRow();

            row["MaDoiTac"]     = "";
            row["HoTenDT"]      = "";
            row["GioiTinh"]     = 0;
            row["DiaChi"]       = "";
            row["NgaySinh"]     = "01/01/1900";
            row["CMND"]         = "";
            row["NgayCap"]      = "01/01/1918";
            row["NoiCap"]       = "";
            row["MaTinh"]       = "";
            row["MaHuyen"]      = "";
            row["MaXa"]         = "";
            row["MaLoaiHinh"]   = "";
            row["MaLoaiDoiTac"] = "";
            row["MaDanToc"]     = "";

            DTctrl.Add(row);
            DoiTacController ctrldoitac = new DoiTacController();

            if (ctrldoitac.LayDoiTac(txtMaDoiTac.Text) != null)
            {
                MessageBox.Show("Mã đối tác này đã tồn tại !", "Doi Tac", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (ThamSo.LaSoNguyen(txtMaDoiTac.Text))
            {
                long so = Convert.ToInt64(txtMaDoiTac.Text);
                if (so >= ThamSo.LayMaDoiTac())
                {
                    ThamSo.GanMaDoiTac(so + 1);
                }
            }
        }
Exemplo n.º 2
0
 public frmDoiTac(DoiTacController ctrldt)
     : this()
 {
     this.DTctrl = ctrldt;
     status      = ThamSo.Controll.Normal;
 }