public void InsertByHoSoUngVien(DAL.LichHenPhongVan lichhenphongvan)
 {
     if (lichhenphongvan != null)
     {
         dataContext.LichHenPhongVans.InsertOnSubmit(lichhenphongvan);
         Save();
     }
 }
 // xoa lịch hẹn phỏng vấn theo mã lịch hẹn
 public void Delete(int id)
 {
     DAL.LichHenPhongVan temp = dataContext.LichHenPhongVans.SingleOrDefault(t => t.ID == id);
     if (temp != null)
     {
         dataContext.LichHenPhongVans.DeleteOnSubmit(temp);
         Save();
     }
 }
예제 #3
0
    public void btn_ChuyenLichHenPV_Click(object sender, DirectEventArgs e)
    {
        try
        {
            LichPhongVanController lichphongvan = new LichPhongVanController();
            DAL.LichHenPhongVan    lpv          = new DAL.LichHenPhongVan();
            HoSoUngVienController  hosoungvien  = new HoSoUngVienController();
            DAL.HoSoUngVien        hsuv         = new DAL.HoSoUngVien();
            foreach (var item in RowSelectionModel3.SelectedRows)
            {
                lpv.FR_KEY      = decimal.Parse("0" + item.RecordID);
                lpv.CreatedBy   = CurrentUser.ID;
                lpv.CreatedDate = DateTime.Now;
                if (!df_NgayPhongVan.SelectedDate.ToString().Contains("0001"))
                {
                    lpv.LichHen = Convert.ToDateTime(df_NgayPhongVan.SelectedDate);
                }
                lpv.ThoiGian      = tf_GioPhongVan.Text;
                lpv.ThuTuPhongVan = int.Parse("0" + txt_ThuTuPhongVan.Text);
                lpv.VongPhongVan  = int.Parse("0" + txt_VongPhongVan.Text);
                lpv.GhiChu        = txt_ghichu.Text;
                lichphongvan.InsertByHoSoUngVien(lpv);
                hsuv.MaUngVien        = decimal.Parse("0" + item.RecordID);
                hsuv.BlackListOrStore = "";
                hosoungvien.ChuyenDanhSach(hsuv, false);
            }

            wdChuyenLichHenPV.Hide();
            GridPanel1.Reload();
            RowSelectionModel3.ClearSelections();
            btnDelete.Disabled = true;
            btnEdit.Disabled   = true;
            btnNext.Disabled   = true;
            btnPrint.Disabled  = true;
            Dialog.ShowNotification("Chuyển thành công!");
        }
        catch (Exception ex)
        {
            Dialog.ShowError("Thông báo", "Có lỗi xảy ra: " + ex.Message);
        }
    }
 public void RoiLichPV(DAL.LichHenPhongVan lichhenphongvan)
 {
     DAL.LichHenPhongVan temp = dataContext.LichHenPhongVans.SingleOrDefault(t => t.ID == lichhenphongvan.ID);
     if (temp != null)
     {
         temp.CreatedBy   = lichhenphongvan.CreatedBy;
         temp.CreatedDate = lichhenphongvan.CreatedDate;
         //temp.DaLienHe = lichhenphongvan.DaLienHe;
         //temp.DaThamGia = lichhenphongvan.DaThamGia;
         //temp.Diem = lichhenphongvan.Diem;
         temp.GhiChu  = lichhenphongvan.GhiChu;
         temp.ID      = lichhenphongvan.ID;
         temp.LichHen = lichhenphongvan.LichHen;
         temp.FR_KEY  = lichhenphongvan.FR_KEY;
         //temp.NguoiCham = lichhenphongvan.NguoiCham;
         //temp.NhanXet = lichhenphongvan.NhanXet;
         //temp.Pass = lichhenphongvan.Pass;
         temp.ThoiGian      = lichhenphongvan.ThoiGian;
         temp.ThuTuPhongVan = lichhenphongvan.ThuTuPhongVan;
         //temp.VongPhongVan = lichhenphongvan.VongPhongVan;
         //temp.XacNhanThamGia = lichhenphongvan.XacNhanThamGia;
         Save();
     }
 }