public static bool Insert(HoSo_HuanLuyen dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();

                VNSC.HoSo_HuanLuyens.InsertOnSubmit(dto);
                VNSC.SubmitChanges();
                return true;
            }
            catch (System.Exception ex)
            {
                return false;
            }
        }
Exemple #2
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 #3
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 DeleteHoSo_HuanLuyen(HoSo_HuanLuyen instance);
 partial void UpdateHoSo_HuanLuyen(HoSo_HuanLuyen instance);
 partial void InsertHoSo_HuanLuyen(HoSo_HuanLuyen instance);
		private void detach_HoSo_HuanLuyens(HoSo_HuanLuyen entity)
		{
			this.SendPropertyChanging();
			entity.HuanLuyen = null;
		}
		private void attach_HoSo_HuanLuyens(HoSo_HuanLuyen entity)
		{
			this.SendPropertyChanging();
			entity.HoSo = this;
		}
 public static bool Insert(HoSo_HuanLuyen dto)
 {
     return HoSo_HuanLuyen_DAO.Insert(dto);
 }
        public static bool UpdateHoSo_HuanLuyenInfo(HoSo_HuanLuyen dto)
        {
            //try
            //{
            //    VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
            //    HoSo_HuanLuyen sk = VNSC.HoSo_HuanLuyens.Single(P => P.Ma == dto.Ma);
            //    sk.MaNhomTrachVu = dto.MaNhomTrachVu;
            //    //sk.Ten = dto.Ten;
            //    //sk.MoTa = dto.MoTa;

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

            return false; //Khong co update
        }