Exemple #1
0
        public static bool Insert(HuanLuyen dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();

                VNSC.HuanLuyens.InsertOnSubmit(dto);
                VNSC.SubmitChanges();
                return true;
            }
            catch (System.Exception ex)
            {
                return false;
            }
        }
Exemple #2
0
 public static bool UpdateHuanLuyenInfo(HuanLuyen dto)
 {
     return HuanLuyen_DAO.UpdateHuanLuyenInfo(dto);
 }
Exemple #3
0
 public static bool Insert(HuanLuyen dto)
 {
     return HuanLuyen_DAO.Insert(dto);
 }
Exemple #4
0
        private bool InsertHuanLuyen(List<UC_HuanLuyen> list_UC_Temp)
        {
            for (int i = 0; i < list_UC_Temp.Count; i++)
            {
                dto_HuanLuyen = new HuanLuyen();

                dto_HuanLuyen.Nganh = list_UC_Temp[i].Nganh;
                dto_HuanLuyen.Khoa = list_UC_Temp[i].Khoa;
                dto_HuanLuyen.TenKhoa = list_UC_Temp[i].TenKhoa;
                dto_HuanLuyen.KhoaTruong = list_UC_Temp[i].KhoaTruong;
                dto_HuanLuyen.Nam = list_UC_Temp[i].Nam;
                dto_HuanLuyen.MHL = list_UC_Temp[i].MHL;
                dto_HuanLuyen.TinhTrang = list_UC_Temp[i].TinhTrang;

                if (HuanLuyen_BUS.Insert(dto_HuanLuyen))
                {
                    dto_HoSo_HuanLuyen = new HoSo_HuanLuyen();

                    dto_HoSo_HuanLuyen.MaHoSo = tbMa_LLCN.Text.Substring(0, 4);
                    List<HuanLuyen> list_Temp = HuanLuyen_BUS.LayDSHuanLuyen();
                    dto_HoSo_HuanLuyen.MaHuanLuyen = list_Temp[list_Temp.Count - 1].Ma;

                    if (!HoSo_HuanLuyen_BUS.Insert(dto_HoSo_HuanLuyen))
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }

            return true;
        }
Exemple #5
0
        private bool UpdateHuanLuyen()
        {
            if (!InsertHuanLuyen(list_UC_HuanLuyen_Insert))
            {
                return false;
            }

            for (int i = 0; i < list_UC_HuanLuyen_Delete.Count; i++)
            {
                if (!HoSo_HuanLuyen_BUS.Delete(tbMa_LLCN.Text.Substring(0, 4), list_UC_HuanLuyen_Delete[i]))
                {
                    return false;
                }

                if (!HuanLuyen_BUS.Delete(list_UC_HuanLuyen_Delete[i]))
                {
                    return false;
                }
            }

            for (int i = 0; i < list_UC_HuanLuyen_Update.Count; i++)
            {
                dto_HuanLuyen = new HuanLuyen();

                dto_HuanLuyen.Ma = list_UC_HuanLuyen_Update[i].Ma;
                dto_HuanLuyen.Nganh = list_UC_HuanLuyen_Update[i].Nganh;
                dto_HuanLuyen.Khoa = list_UC_HuanLuyen_Update[i].Khoa;
                dto_HuanLuyen.TenKhoa = list_UC_HuanLuyen_Update[i].TenKhoa;
                dto_HuanLuyen.KhoaTruong = list_UC_HuanLuyen_Update[i].KhoaTruong;
                dto_HuanLuyen.Nam = list_UC_HuanLuyen_Update[i].Nam;
                dto_HuanLuyen.MHL = list_UC_HuanLuyen_Update[i].MHL;
                dto_HuanLuyen.TinhTrang = list_UC_HuanLuyen_Update[i].TinhTrang;

                if (!HuanLuyen_BUS.UpdateHuanLuyenInfo(dto_HuanLuyen))
                {
                    return false;
                }
            }

            return true;
        }
Exemple #6
0
        private void UC_HoSoCaNhan_Load(object sender, EventArgs e)
        {
            list_IDV = new List<int>();
            list_NhomTrachVu = new List<string>();
            list_TrachVu = new List<string>();

            cbIDV_LLCN.Items.Add(" ");
            LayDSIDV_ComboBox(cbIDV_LLCN);

            if (!LayDSNhomTrachVu_ComboBox(cbNhomTrachVu_LLCN))
            {
                this.Visible = false;
                Form_Notice frm = new Form_Notice("Chưa khởi tạo Nhóm trách vụ!", false);
                return;
            }
            else
            {
                this.Visible = true;
            }

            if (!LayDSTrachVu_ComboBox(cbTrachVu_LLCN))
            {
                this.Visible = false;
                Form_Notice frm = new Form_Notice("Chưa khởi tạo Trách vụ!", false);
                return;
            }
            else
            {
                this.Visible = true;
            }

            LoadPic();
            this.Size = new System.Drawing.Size(800, 600);

            pnQuanLy.Size = new System.Drawing.Size(770, 485);
            pnQuanLy.Location = SubFunction.SetWidthCenter(this.Size, pnQuanLy.Size, 100);

            lbTitle.Left = lbSelect.Left;
            lbSelect.Text = "";

            pnLyLich.Size = new System.Drawing.Size(550, 545);
            pnLyLich.Location = SubFunction.SetWidthCenter(this.Size, pnLyLich.Size, 50);

            gbLyLichCaNhan.Size = new System.Drawing.Size(550, 545);
            gbLyLichCaNhan.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbLyLichCaNhan.Size, 0);

            gbLyLichHuongDao.Size = new System.Drawing.Size(550, 545);
            gbLyLichHuongDao.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbLyLichHuongDao.Size, 0);

            gbNgheNghiep_KiNang.Size = new System.Drawing.Size(550, 545);
            gbNgheNghiep_KiNang.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbNgheNghiep_KiNang.Size, 0);

            gbHuanLuyen.Size = new System.Drawing.Size(550, 545);
            gbHuanLuyen.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbHuanLuyen.Size, 0);

            pn_gbHuanLuyen.Size = new System.Drawing.Size(540, 430);
            pn_gbHuanLuyen.Location = SubFunction.SetWidthCenter(gbHuanLuyen.Size, pn_gbHuanLuyen.Size, 50);

            tbPage.Location = new Point(pnPage.Left + 2, pnPage.Top - 1);
            tbPage.LostFocus += new EventHandler(tbPage_LostFocus);

            size_PicRec.Width = 90;
            size_PicRec.Height = 120;
            pnAvatar.Left = pnLyLich.Right + 5;
            pnAvatar.Top = pnLyLich.Top + 10;

            pbAvatar.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.pbAvatar_MouseWheel);

            iZoom = 1;

            list_dto = new List<HoSo>();

            list_UC_HuanLuyen = new List<UC_HuanLuyen>();
            list_UC_HuanLuyen_Insert = new List<UC_HuanLuyen>();
            list_UC_HuanLuyen_Delete = new List<int>();
            list_UC_HuanLuyen_Update = new List<UC_HuanLuyen>();

            dto_HoSo = new HoSo();
            dto_HuanLuyen = new HuanLuyen();
            dto_LuuTru = new LuuTru();
            dto_HoSo_HuanLuyen = new HoSo_HuanLuyen();
            dto_HoSo_LuuTru = new HoSo_LuuTru();

            list_FolderAvatar = new List<string>();
            list_FolderAvatar.Add("DB");
            list_FolderAvatar.Add("Avatar");

            iRows = 20;

            refreshListView();

            Form_Main.CurrentControlName = "UC_HoSoCaNhan";
        }
 partial void DeleteHuanLuyen(HuanLuyen instance);
 partial void UpdateHuanLuyen(HuanLuyen instance);
 partial void InsertHuanLuyen(HuanLuyen instance);
Exemple #10
0
        public static bool UpdateHuanLuyenInfo(HuanLuyen dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
                HuanLuyen sk = VNSC.HuanLuyens.Single(P => P.Ma == dto.Ma);

                sk.Nganh = dto.Nganh;
                sk.Khoa = dto.Khoa;
                sk.TenKhoa = dto.TenKhoa;
                sk.KhoaTruong = dto.KhoaTruong;
                sk.Nam = dto.Nam;
                sk.MHL = dto.MHL;
                sk.TinhTrang = dto.TinhTrang;

                VNSC.SubmitChanges();
                return true;
            }
            catch (System.Exception ex)
            {
                return false;
            }
        }