private HoSo_DTO ConvertHoSo2HoSo_DTO(HoSo dto)
        {
            HoSo_DTO dto_Temp = new HoSo_DTO();

            dto_Temp.Ma = int.Parse(dto.Ma.Substring(0, 4));
            dto_Temp.NgayCapNhat = dto.NgayCapNhat;

            dto_Temp.MaIDV = (int)dto.MaIDV;
            dto_Temp.MaNhomTrachVu = dto.MaNhomTrachVu;
            dto_Temp.MaTrachVu = dto.MaTrachVu;
            dto_Temp.HoTen = dto.HoTen;
            dto_Temp.NgaySinh = (DateTime)dto.NgaySinh;
            dto_Temp.GioiTinh = dto.GioiTinh;
            dto_Temp.QueQuan = dto.QueQuan;
            dto_Temp.TrinhDoHocVan = dto.TrinhDoHocVan;
            dto_Temp.TonGiao = dto.TonGiao;
            dto_Temp.DiaChi = dto.DiaChi;
            dto_Temp.DienThoaiLienLac = dto.DienThoaiLienLac;
            dto_Temp.Email = dto.Email;

            dto_Temp.Nganh = dto.Nganh;
            dto_Temp.DonVi = dto.DonVi;
            dto_Temp.LienDoan = dto.LienDoan;
            dto_Temp.Dao = dto.Dao;
            dto_Temp.Chau = dto.Chau;
            dto_Temp.NgayTuyenHua = (DateTime)dto.NgayTuyenHua;
            dto_Temp.TruongNhanLoiHua = dto.TruongNhanLoiHua;
            dto_Temp.TrachVuTaiDonVi = dto.TrachVuTaiDonVi;
            dto_Temp.TrachVuNgoaiDonVi = dto.TrachVuNgoaiDonVi;
            dto_Temp.TenRung = dto.TenRung;
            dto_Temp.GhiChu = dto.GhiChu;

            dto_Temp.NgheNghiep = dto.NgheNghiep;
            dto_Temp.NutDay = (int)dto.NutDay;
            dto_Temp.PhuongHuong = (int)dto.PhuongHuong;
            dto_Temp.CuuThuong = (int)dto.CuuThuong;
            dto_Temp.TruyenTin = (int)dto.TruyenTin;
            dto_Temp.TroChoi = (int)dto.TroChoi;
            dto_Temp.LuaTrai = (int)dto.LuaTrai;
            dto_Temp.SoTruong = dto.SoTruong;

            return dto_Temp;
        }
Exemple #2
0
        public static string UpdateHoSoInfo(HoSo_DTO dto)
        {
            try
            {
                XmlDocument XmlDoc = XMLConnection.SelectXmlDocHoSo();
                XmlNodeList list_Temp = XmlDoc.GetElementsByTagName("HoSo");

                for (int i = 0; i < list_Temp.Count; i++)
                {
                    if (int.Parse(list_Temp[i].Attributes["Ma"].InnerText) == dto.Ma)
                    {
                        list_Temp[i]["NgayCapNhat"].InnerText = dto.NgayCapNhat;
                        list_Temp[i]["Avatar"].InnerText = dto.Avatar;

                        list_Temp[i]["MaNhomTrachVu"].InnerText = dto.MaNhomTrachVu;
                        list_Temp[i]["MaTrachVu"].InnerText = dto.MaTrachVu;
                        list_Temp[i]["HoTen"].InnerText = dto.HoTen;
                        list_Temp[i]["NgaySinh"].InnerText = dto.NgaySinh.ToString();
                        list_Temp[i]["GioiTinh"].InnerText = dto.GioiTinh;
                        list_Temp[i]["QueQuan"].InnerText = dto.QueQuan;
                        list_Temp[i]["TrinhDoHocVan"].InnerText = dto.TrinhDoHocVan;
                        list_Temp[i]["TonGiao"].InnerText = dto.TonGiao;
                        list_Temp[i]["DiaChi"].InnerText = dto.DiaChi;
                        list_Temp[i]["DienThoaiLienLac"].InnerText = dto.DienThoaiLienLac;
                        list_Temp[i]["Email"].InnerText = dto.Email;

                        list_Temp[i]["Nganh"].InnerText = dto.Nganh;
                        list_Temp[i]["DonVi"].InnerText = dto.DonVi;
                        list_Temp[i]["LienDoan"].InnerText = dto.LienDoan;
                        list_Temp[i]["Dao"].InnerText = dto.Dao;
                        list_Temp[i]["Chau"].InnerText = dto.Chau;
                        list_Temp[i]["NgayTuyenHua"].InnerText = dto.NgayTuyenHua.ToString();
                        list_Temp[i]["TruongNhanLoiHua"].InnerText = dto.TruongNhanLoiHua;
                        list_Temp[i]["TrachVuTaiDonVi"].InnerText = dto.TrachVuTaiDonVi;
                        list_Temp[i]["TrachVuNgoaiDonVi"].InnerText = dto.TrachVuNgoaiDonVi;
                        list_Temp[i]["TenRung"].InnerText = dto.TenRung;
                        list_Temp[i]["GhiChu"].InnerText = dto.GhiChu;

                        list_Temp[i]["NgheNghiep"].InnerText = dto.NgheNghiep;
                        list_Temp[i]["NutDay"].InnerText = dto.NutDay.ToString();
                        list_Temp[i]["PhuongHuong"].InnerText = dto.PhuongHuong.ToString();
                        list_Temp[i]["CuuThuong"].InnerText = dto.CuuThuong.ToString();
                        list_Temp[i]["TruyenTin"].InnerText = dto.TruyenTin.ToString();
                        list_Temp[i]["TroChoi"].InnerText = dto.TroChoi.ToString();
                        list_Temp[i]["LuaTrai"].InnerText = dto.LuaTrai.ToString();
                        list_Temp[i]["SoTruong"].InnerText = dto.SoTruong;
                    }
                }

                //XmlDoc.Save("HoSo.xml");

                return XmlDoc.OuterXml;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
Exemple #3
0
        public static string Insert(HoSo_DTO dto)
        {
            try
            {
                XmlDocument XmlDoc = XMLConnection.SelectXmlDocHoSo();
                List<XmlElement> list_dto = new List<XmlElement>();

                XmlElement HoSo = XmlDoc.CreateElement("HoSo");
                HoSo.SetAttribute("Ma", dto.Ma.ToString());

                #region Add content
                list_dto.Add(XmlDoc.CreateElement("MaID"));
                list_dto[list_dto.Count - 1].InnerText = dto.MaIDV.ToString();

                list_dto.Add(XmlDoc.CreateElement("MaNhomTrachVu"));
                list_dto[list_dto.Count - 1].InnerText = dto.MaNhomTrachVu;

                list_dto.Add(XmlDoc.CreateElement("MaTrachVu"));
                list_dto[list_dto.Count - 1].InnerText = dto.MaTrachVu;

                list_dto.Add(XmlDoc.CreateElement("Avatar"));
                list_dto[list_dto.Count - 1].InnerText = dto.Avatar;

                list_dto.Add(XmlDoc.CreateElement("NgayCapNhat"));
                list_dto[list_dto.Count - 1].InnerText = dto.NgayCapNhat;

                list_dto.Add(XmlDoc.CreateElement("HoTen"));
                list_dto[list_dto.Count - 1].InnerText = dto.HoTen;

                list_dto.Add(XmlDoc.CreateElement("NgaySinh"));
                list_dto[list_dto.Count - 1].InnerText = dto.NgaySinh.ToString();

                list_dto.Add(XmlDoc.CreateElement("GioiTinh"));
                list_dto[list_dto.Count - 1].InnerText = dto.GioiTinh;

                list_dto.Add(XmlDoc.CreateElement("QueQuan"));
                list_dto[list_dto.Count - 1].InnerText = dto.QueQuan;

                list_dto.Add(XmlDoc.CreateElement("TrinhDoHocVan"));
                list_dto[list_dto.Count - 1].InnerText = dto.TrinhDoHocVan;

                list_dto.Add(XmlDoc.CreateElement("TonGiao"));
                list_dto[list_dto.Count - 1].InnerText = dto.TonGiao;

                list_dto.Add(XmlDoc.CreateElement("DiaChi"));
                list_dto[list_dto.Count - 1].InnerText = dto.DiaChi;

                list_dto.Add(XmlDoc.CreateElement("DienThoaiLienLac"));
                list_dto[list_dto.Count - 1].InnerText = dto.DienThoaiLienLac;

                list_dto.Add(XmlDoc.CreateElement("Email"));
                list_dto[list_dto.Count - 1].InnerText = dto.Email;

                list_dto.Add(XmlDoc.CreateElement("Nganh"));
                list_dto[list_dto.Count - 1].InnerText = dto.Nganh;

                list_dto.Add(XmlDoc.CreateElement("DonVi"));
                list_dto[list_dto.Count - 1].InnerText = dto.DonVi;

                list_dto.Add(XmlDoc.CreateElement("LienDoan"));
                list_dto[list_dto.Count - 1].InnerText = dto.LienDoan;

                list_dto.Add(XmlDoc.CreateElement("Dao"));
                list_dto[list_dto.Count - 1].InnerText = dto.Dao;

                list_dto.Add(XmlDoc.CreateElement("Chau"));
                list_dto[list_dto.Count - 1].InnerText = dto.Chau;

                list_dto.Add(XmlDoc.CreateElement("NgayTuyenHua"));
                list_dto[list_dto.Count - 1].InnerText = dto.NgayTuyenHua.ToString();

                list_dto.Add(XmlDoc.CreateElement("TruongNhanLoiHua"));
                list_dto[list_dto.Count - 1].InnerText = dto.TruongNhanLoiHua;

                list_dto.Add(XmlDoc.CreateElement("TrachVuTaiDonVi"));
                list_dto[list_dto.Count - 1].InnerText = dto.TrachVuTaiDonVi;

                list_dto.Add(XmlDoc.CreateElement("TrachVuNgoaiDonVi"));
                list_dto[list_dto.Count - 1].InnerText = dto.TrachVuNgoaiDonVi;

                list_dto.Add(XmlDoc.CreateElement("TenRung"));
                list_dto[list_dto.Count - 1].InnerText = dto.TenRung;

                list_dto.Add(XmlDoc.CreateElement("GhiChu"));
                list_dto[list_dto.Count - 1].InnerText = dto.GhiChu;

                list_dto.Add(XmlDoc.CreateElement("NgheNghiep"));
                list_dto[list_dto.Count - 1].InnerText = dto.NgheNghiep;

                list_dto.Add(XmlDoc.CreateElement("NutDay"));
                list_dto[list_dto.Count - 1].InnerText = dto.NutDay.ToString();

                list_dto.Add(XmlDoc.CreateElement("PhuongHuong"));
                list_dto[list_dto.Count - 1].InnerText = dto.PhuongHuong.ToString();

                list_dto.Add(XmlDoc.CreateElement("CuuThuong"));
                list_dto[list_dto.Count - 1].InnerText = dto.CuuThuong.ToString();

                list_dto.Add(XmlDoc.CreateElement("TruyenTin"));
                list_dto[list_dto.Count - 1].InnerText = dto.TruyenTin.ToString();

                list_dto.Add(XmlDoc.CreateElement("TroChoi"));
                list_dto[list_dto.Count - 1].InnerText = dto.TroChoi.ToString();

                list_dto.Add(XmlDoc.CreateElement("LuaTrai"));
                list_dto[list_dto.Count - 1].InnerText = dto.LuaTrai.ToString();

                list_dto.Add(XmlDoc.CreateElement("SoTruong"));
                list_dto[list_dto.Count - 1].InnerText = dto.SoTruong;
                #endregion

                for (int i = 0; i < list_dto.Count; i++)
                {
                    HoSo.AppendChild(list_dto[i]);
                }

                XmlDoc.GetElementsByTagName("HS")[0].AppendChild(HoSo);
                //XmlDoc.Save("HoSo.xml");

                return XmlDoc.OuterXml;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
Exemple #4
0
        public static HoSo_DTO TraCuuHoSoTheoMa(int iMa)
        {
            try
            {
                XmlNodeList list_Temp = XMLConnection.CreateXmlDocHoSo("HoSo");
                HoSo_DTO dto = new HoSo_DTO();

                for (int i = 0; i < list_Temp.Count; i++)
                {
                    if (int.Parse(list_Temp[i].Attributes["Ma"].InnerText) == iMa)
                    {
                        HoSo_DTO dto_Temp = new HoSo_DTO();

                        dto_Temp.Ma = int.Parse(list_Temp[i].Attributes["Ma"].InnerText);
                        dto_Temp.NgayCapNhat = list_Temp[i]["NgayCapNhat"].InnerText;

                        dto_Temp.Avatar = list_Temp[i]["Avatar"].InnerText;

                        if ("" == list_Temp[i]["MaID"].InnerText)
                        {
                            //
                        }
                        else
                        {
                            dto_Temp.MaIDV = int.Parse(list_Temp[i]["MaID"].InnerText);
                        }
                        dto_Temp.MaNhomTrachVu = list_Temp[i]["MaNhomTrachVu"].InnerText;
                        dto_Temp.MaTrachVu = list_Temp[i]["MaTrachVu"].InnerText;

                        dto_Temp.HoTen = list_Temp[i]["HoTen"].InnerText;
                        dto_Temp.NgaySinh = DateTime.Parse(list_Temp[i]["NgaySinh"].InnerText);
                        dto_Temp.GioiTinh = list_Temp[i]["GioiTinh"].InnerText;
                        dto_Temp.QueQuan = list_Temp[i]["QueQuan"].InnerText;
                        dto_Temp.TrinhDoHocVan = list_Temp[i]["TrinhDoHocVan"].InnerText;
                        dto_Temp.TonGiao = list_Temp[i]["TonGiao"].InnerText;
                        dto_Temp.DiaChi = list_Temp[i]["DiaChi"].InnerText;
                        dto_Temp.DienThoaiLienLac = list_Temp[i]["DienThoaiLienLac"].InnerText;
                        dto_Temp.Email = list_Temp[i]["Email"].InnerText;

                        dto_Temp.Nganh = list_Temp[i]["Nganh"].InnerText;
                        dto_Temp.DonVi = list_Temp[i]["DonVi"].InnerText;
                        dto_Temp.LienDoan = list_Temp[i]["LienDoan"].InnerText;
                        dto_Temp.Dao = list_Temp[i]["Dao"].InnerText;
                        dto_Temp.Chau = list_Temp[i]["Chau"].InnerText;
                        dto_Temp.NgayTuyenHua = DateTime.Parse(list_Temp[i]["NgayTuyenHua"].InnerText);
                        dto_Temp.TruongNhanLoiHua = list_Temp[i]["TruongNhanLoiHua"].InnerText;
                        dto_Temp.TrachVuTaiDonVi = list_Temp[i]["TrachVuTaiDonVi"].InnerText;
                        dto_Temp.TrachVuNgoaiDonVi = list_Temp[i]["TrachVuNgoaiDonVi"].InnerText;
                        dto_Temp.TenRung = list_Temp[i]["TenRung"].InnerText;
                        dto_Temp.GhiChu = list_Temp[i]["GhiChu"].InnerText;

                        dto_Temp.NgheNghiep = list_Temp[i]["NgheNghiep"].InnerText;
                        dto_Temp.NutDay = int.Parse(list_Temp[i]["NutDay"].InnerText);
                        dto_Temp.PhuongHuong = int.Parse(list_Temp[i]["PhuongHuong"].InnerText);
                        dto_Temp.CuuThuong = int.Parse(list_Temp[i]["CuuThuong"].InnerText);
                        dto_Temp.TruyenTin = int.Parse(list_Temp[i]["TruyenTin"].InnerText);
                        dto_Temp.TroChoi = int.Parse(list_Temp[i]["TroChoi"].InnerText);
                        dto_Temp.LuaTrai = int.Parse(list_Temp[i]["LuaTrai"].InnerText);
                        dto_Temp.SoTruong = list_Temp[i]["SoTruong"].InnerText;

                        dto = dto_Temp;
                        break;
                    }
                }

                return dto;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
Exemple #5
0
        public static List<HoSo_DTO> LayDSHoSo(string sContent)
        {
            try
            {
                XmlDocument xmlTemp = new XmlDocument();
                xmlTemp.LoadXml(sContent);

                XmlNodeList list_Temp = xmlTemp.GetElementsByTagName("HoSo");
                List<HoSo_DTO> list_dto = new List<HoSo_DTO>();

                for (int i = 0; i < list_Temp.Count; i++)
                {
                    HoSo_DTO dto_Temp = new HoSo_DTO();

                    dto_Temp.Ma = int.Parse(list_Temp[i].Attributes["Ma"].InnerText);
                    dto_Temp.NgayCapNhat = list_Temp[i]["NgayCapNhat"].InnerText;

                    dto_Temp.Avatar = list_Temp[i]["Avatar"].InnerText;

                    if ("" == list_Temp[i]["MaIDV"].InnerText)
                    {
                        //
                    }
                    else
                    {
                        dto_Temp.MaIDV = int.Parse(list_Temp[i]["MaIDV"].InnerText);
                    }

                    dto_Temp.MaNhomTrachVu = list_Temp[i]["MaNhomTrachVu"].InnerText;
                    dto_Temp.MaTrachVu = list_Temp[i]["MaTrachVu"].InnerText;

                    dto_Temp.HoTen = list_Temp[i]["HoTen"].InnerText;
                    dto_Temp.NgaySinh = DateTime.Parse(list_Temp[i]["NgaySinh"].InnerText);
                    dto_Temp.GioiTinh = list_Temp[i]["GioiTinh"].InnerText;
                    dto_Temp.QueQuan = list_Temp[i]["QueQuan"].InnerText;
                    dto_Temp.TrinhDoHocVan = list_Temp[i]["TrinhDoHocVan"].InnerText;
                    dto_Temp.TonGiao = list_Temp[i]["TonGiao"].InnerText;
                    dto_Temp.DiaChi = list_Temp[i]["DiaChi"].InnerText;
                    dto_Temp.DienThoaiLienLac = list_Temp[i]["DienThoaiLienLac"].InnerText;
                    dto_Temp.Email = list_Temp[i]["Email"].InnerText;

                    dto_Temp.Nganh = list_Temp[i]["Nganh"].InnerText;
                    dto_Temp.DonVi = list_Temp[i]["DonVi"].InnerText;
                    dto_Temp.LienDoan = list_Temp[i]["LienDoan"].InnerText;
                    dto_Temp.Dao = list_Temp[i]["Dao"].InnerText;
                    dto_Temp.Chau = list_Temp[i]["Chau"].InnerText;
                    dto_Temp.NgayTuyenHua = DateTime.Parse(list_Temp[i]["NgayTuyenHua"].InnerText);
                    dto_Temp.TruongNhanLoiHua = list_Temp[i]["TruongNhanLoiHua"].InnerText;
                    dto_Temp.TrachVuTaiDonVi = list_Temp[i]["TrachVuTaiDonVi"].InnerText;
                    dto_Temp.TrachVuNgoaiDonVi = list_Temp[i]["TrachVuNgoaiDonVi"].InnerText;
                    dto_Temp.TenRung = list_Temp[i]["TenRung"].InnerText;
                    dto_Temp.GhiChu = list_Temp[i]["GhiChu"].InnerText;

                    dto_Temp.NgheNghiep = list_Temp[i]["NgheNghiep"].InnerText;
                    dto_Temp.NutDay = int.Parse(list_Temp[i]["NutDay"].InnerText);
                    dto_Temp.PhuongHuong = int.Parse(list_Temp[i]["PhuongHuong"].InnerText);
                    dto_Temp.CuuThuong = int.Parse(list_Temp[i]["CuuThuong"].InnerText);
                    dto_Temp.TruyenTin = int.Parse(list_Temp[i]["TruyenTin"].InnerText);
                    dto_Temp.TroChoi = int.Parse(list_Temp[i]["TroChoi"].InnerText);
                    dto_Temp.LuaTrai = int.Parse(list_Temp[i]["LuaTrai"].InnerText);
                    dto_Temp.SoTruong = list_Temp[i]["SoTruong"].InnerText;

                    list_dto.Add(dto_Temp);
                }

                return list_dto;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
Exemple #6
0
 public static string UpdateHoSoInfo(HoSo_DTO dto)
 {
     return HoSo_DAO.UpdateHoSoInfo(dto);
 }
Exemple #7
0
 public static string Insert2String(HoSo_DTO dto, string sIDV)
 {
     return HoSo_DAO.Insert2String(dto, sIDV);
 }
Exemple #8
0
 public static string Insert(HoSo_DTO dto)
 {
     return HoSo_DAO.Insert(dto);
 }
Exemple #9
0
        private HoSo_DTO NewHoSo()
        {
            HoSo_DTO dto = new HoSo_DTO();

            dto.Ma = 1;
            dto.NgayCapNhat = "";

            //dto.Avatar = Convert_Function.ConvertByteArrayToString(Convert_Function.ConvertImageToByteArray(pbAvatar.Image));

            dto.MaIDV = int.Parse(list_IDV[ddlIDV.SelectedIndex]);
            dto.MaNhomTrachVu = list_NhomTrachVu[ddlNhomTrachVu.SelectedIndex];
            dto.MaTrachVu = list_TrachVu[ddlTrachVu.SelectedIndex];

            dto.HoTen = tbHoTen.Text;
            //dto.NgaySinh = DateTime.Parse(lbNgaySinh.Text);

            if (rbNam.Checked)
            {
                dto.GioiTinh = rbNam.Text;
            }

            if (rbNu.Checked)
            {
                dto.GioiTinh = rbNu.Text;
            }

            dto.QueQuan = tbQueQuan.Text;
            dto.TrinhDoHocVan = tbTrinhDoHocVan.Text;
            dto.TonGiao = tbTonGiao.Text;
            dto.DiaChi = tbDiaChi.Text;
            dto.DienThoaiLienLac = tbDienThoaiLienLac.Text;
            dto.Email = tbEmail.Text;

            if (rbAu.Checked)
            {
                dto.Nganh = rbAu.Text;
            }

            if (rbThieu.Checked)
            {
                dto.Nganh = rbThieu.Text;
            }

            if (rbKha.Checked)
            {
                dto.Nganh = rbKha.Text;
            }

            if (rbTrang.Checked)
            {
                dto.Nganh = rbTrang.Text;
            }

            if (rbKhac.Checked)
            {
                dto.Nganh = rbKhac.Text;
            }

            dto.DonVi = tbDonVi.Text;
            dto.LienDoan = tbLienDoan.Text;
            dto.Dao = tbDao.Text;
            dto.Chau = tbChau.Text;
            //dto.NgayTuyenHua = dtpNgayTuyenHua.Value;
            dto.TruongNhanLoiHua = tbTruongNhanLoiHua.Text;
            dto.TrachVuTaiDonVi = tbTrachVuTaiDonVi.Text;
            dto.TrachVuNgoaiDonVi = tbTrachVuNgoaiDonVi.Text;
            dto.TenRung = tbTenRung.Text;
            dto.GhiChu = tbGhiChu.Text;

            dto.NgheNghiep = tbNgheNghiep.Text;
            if (chbNutDay.Checked) //1
            {
                dto.NutDay = 1;
            }
            else
            {
                dto.NutDay = 0;
            }

            if (chbPhuongHuong.Checked) //2
            {
                dto.PhuongHuong = 1;
            }
            else
            {
                dto.PhuongHuong = 0;
            }

            if (chbCuuThuong.Checked) //3
            {
                dto.CuuThuong = 1;
            }
            else
            {
                dto.CuuThuong = 0;
            }

            if (chbTruyenTin.Checked) //4
            {
                dto.TruyenTin = 1;
            }
            else
            {
                dto.TruyenTin = 0;
            }

            if (chbTroChoi.Checked) //5
            {
                dto.TroChoi = 1;
            }
            else
            {
                dto.TroChoi = 0;
            }

            if (chbLuaTrai.Checked) //6
            {
                dto.LuaTrai = 1;
            }
            else
            {
                dto.LuaTrai = 0;
            }

            dto.SoTruong = tbSoTruong.Text;

            return dto;
        }
Exemple #10
0
        private bool EncryptData(HoSo_DTO dto, string sPath)
        {
            try
            {
                XmlDocument XmlDoc = XMLConnection_BUS.SelectXmlDocConfig();
                string sContent = XmlDoc.FirstChild.OuterXml.Split(new char[] { '>' })[0] + ">";

                sContent += "<HS>"; //bat dau ghi thong tin Ho so
                sContent += HoSo_BUS.Insert2String(dto);
                sContent += "</HS>";

                sContent += "<HL>"; //bat dau ghi thong tin Huan luyen
                //Khong co HL trong web
                sContent += "</HL>";

                sContent += "<HS_HL>"; //bat dau ghi thong tin Huan luyen
                //Khong co HS_HL trong web
                sContent += "</HS_HL>";

                sContent += "</HR-STG>";

                if (!Crypto.EncryptData(sContent, sPath))
                {
                    return false;
                }
            }
            catch
            {
                return false;
            }

            return true;
        }
Exemple #11
0
        private void NewHoSo()
        {
            dto_HoSo = new HoSo_DTO();

            dto_HoSo.Ma = iMaHoSo;
            dto_HoSo.NgayCapNhat = sNgayCapNhat;

            dto_HoSo.Avatar = Convert_Function.ConvertByteArrayToString(Convert_Function.ConvertImageToByteArray(pbAvatar.Image));

            dto_HoSo.MaNhomTrachVu = list_NhomTrachVu[cbNhomTrachVu_LLCN.SelectedIndex];
            dto_HoSo.MaTrachVu = list_TrachVu[cbTrachVu_LLCN.SelectedIndex];

            dto_HoSo.HoTen = tbHoTen_LLCN.Text;
            dto_HoSo.NgaySinh = dtpNgaySinh_LLCN.Value;

            if (rbNam.Checked)
            {
                dto_HoSo.GioiTinh = rbNam.Text;
            }

            if (rbNu.Checked)
            {
                dto_HoSo.GioiTinh = rbNu.Text;
            }

            dto_HoSo.QueQuan = tbQueQuan_LLCN.Text;
            dto_HoSo.TrinhDoHocVan = tbTrinhDoHocVan_LLCN.Text;
            dto_HoSo.TonGiao = tbTonGiao_LLCN.Text;
            dto_HoSo.DiaChi = tbDiaChi_LLCN.Text;
            dto_HoSo.DienThoaiLienLac = tbDienThoaiLienLac_LLCN.Text;
            dto_HoSo.Email = tbEmail_LLCN.Text;

            if (rbAu.Checked)
            {
                dto_HoSo.Nganh = rbAu.Text;
            }

            if (rbThieu.Checked)
            {
                dto_HoSo.Nganh = rbThieu.Text;
            }

            if (rbKha.Checked)
            {
                dto_HoSo.Nganh = rbKha.Text;
            }

            if (rbTrang.Checked)
            {
                dto_HoSo.Nganh = rbTrang.Text;
            }

            if (rbKhac.Checked)
            {
                dto_HoSo.Nganh = rbKhac.Text;
            }

            dto_HoSo.DonVi = tbDonVi_LLHD.Text;
            dto_HoSo.LienDoan = tbLienDoan_LLHD.Text;
            dto_HoSo.Dao = tbDao_LLHD.Text;
            dto_HoSo.Chau = tbChau_LLHD.Text;
            dto_HoSo.NgayTuyenHua = dtpNgayTuyenHua_LLHD.Value;
            dto_HoSo.TruongNhanLoiHua = tbTruongNhanLoiHua_LLHD.Text;
            dto_HoSo.TrachVuTaiDonVi = tbTrachVuTaiDonVi_LLHD.Text;
            dto_HoSo.TrachVuNgoaiDonVi = tbTrachVuNgoaiDonVi_LLHD.Text;
            dto_HoSo.TenRung = tbTenRung_LLHD.Text;
            dto_HoSo.GhiChu = tbGhiChu_LLHD.Text;

            dto_HoSo.NgheNghiep = tbNgheNghiep_NNKN.Text;
            if (chbNutDay_NNKN.Checked) //1
            {
                dto_HoSo.NutDay = 1;
            }
            else
            {
                dto_HoSo.NutDay = 0;
            }

            if (chbPhuongHuong_NNKN.Checked) //2
            {
                dto_HoSo.PhuongHuong = 1;
            }
            else
            {
                dto_HoSo.PhuongHuong = 0;
            }

            if (chbCuuThuong_NNKN.Checked) //3
            {
                dto_HoSo.CuuThuong = 1;
            }
            else
            {
                dto_HoSo.CuuThuong = 0;
            }

            if (chbTruyenTin_NNKN.Checked) //4
            {
                dto_HoSo.TruyenTin = 1;
            }
            else
            {
                dto_HoSo.TruyenTin = 0;
            }

            if (chbTroChoi_NNKN.Checked) //5
            {
                dto_HoSo.TroChoi = 1;
            }
            else
            {
                dto_HoSo.TroChoi = 0;
            }

            if (chbLuaTrai_NNKN.Checked) //6
            {
                dto_HoSo.LuaTrai = 1;
            }
            else
            {
                dto_HoSo.LuaTrai = 0;
            }

            dto_HoSo.SoTruong = tbSoTruong_NNKN.Text;
        }
Exemple #12
0
        private bool InsertHoSo(HoSo_DTO dto)
        {
            string sContent = HoSo_BUS.Insert(dto);

            return EncryptContent(sContent);
        }
Exemple #13
0
        private bool UpdateHoSo(HoSo_DTO dto)
        {
            string sContent = HoSo_BUS.UpdateHoSoInfo(dto);
            if (!EncryptContent(sContent))
            {
                return false;
            }

            return true;
        }
Exemple #14
0
        private void setHoSoTheoMaHoSo(int iMa)
        {
            if (File.Exists("HoSo.hrd"))
            {
                dto_HoSo = HoSo_BUS.TraCuuHoSoTheoMa(iMa);

                cbNhomTrachVu_LLCN.Text = NhomTrachVu_BUS.TraCuuNhomTrachVuTheoMa(dto_HoSo.MaNhomTrachVu).Ten;
                cbTrachVu_LLCN.Text = TrachVu_BUS.TraCuuTrachVuTheoMa(dto_HoSo.MaTrachVu).Ten;

                //sAvatarPath = Path.Combine(File_Function.getFinalFolder(list_FolderAvatar), setAvatarPath(iMa.ToString(), dto_HoSo.NgayCapNhat));
                //if (File.Exists(sAvatarPath))
                //{
                //    pbAvatar.Image = Image.FromFile(sAvatarPath);
                //    bNewAvatar = true;
                //}

                if (dto_HoSo.Avatar != "")
                {
                    pbAvatar.Image = Convert_Function.ConvertByteArrayToImage(Convert_Function.ConvertStringToByteArray(dto_HoSo.Avatar));
                }

                tbHoTen_LLCN.Text = dto_HoSo.HoTen;
                dtpNgaySinh_LLCN.Value = (DateTime)dto_HoSo.NgaySinh;

                if (dto_HoSo.GioiTinh == "Nam")
                {
                    rbNam.Checked = true;
                }

                if (dto_HoSo.GioiTinh == "Nữ")
                {
                    rbNu.Checked = true;
                }

                tbQueQuan_LLCN.Text = dto_HoSo.QueQuan;
                tbTrinhDoHocVan_LLCN.Text = dto_HoSo.TrinhDoHocVan;
                tbTonGiao_LLCN.Text = dto_HoSo.TonGiao;
                tbDiaChi_LLCN.Text = dto_HoSo.DiaChi;
                tbDienThoaiLienLac_LLCN.Text = dto_HoSo.DienThoaiLienLac;
                tbEmail_LLCN.Text = dto_HoSo.Email;

                if (dto_HoSo.Nganh == "Ấu")
                {
                    rbAu.Checked = true;
                }

                if (dto_HoSo.Nganh == "Thiếu")
                {
                    rbThieu.Checked = true;
                }

                if (dto_HoSo.Nganh == "Kha")
                {
                    rbKha.Checked = true;
                }

                if (dto_HoSo.Nganh == "Tráng")
                {
                    rbTrang.Checked = true;
                }

                if (dto_HoSo.Nganh == "Khác")
                {
                    rbKhac.Checked = true;
                }

                tbDonVi_LLHD.Text = dto_HoSo.DonVi;
                tbLienDoan_LLHD.Text = dto_HoSo.LienDoan;
                tbDao_LLHD.Text = dto_HoSo.Dao;
                tbChau_LLHD.Text = dto_HoSo.Chau;
                dtpNgayTuyenHua_LLHD.Value = (DateTime)dto_HoSo.NgayTuyenHua;
                tbTruongNhanLoiHua_LLHD.Text = dto_HoSo.TruongNhanLoiHua;
                tbTrachVuTaiDonVi_LLHD.Text = dto_HoSo.TrachVuTaiDonVi;
                tbTrachVuNgoaiDonVi_LLHD.Text = dto_HoSo.TrachVuNgoaiDonVi;
                tbTenRung_LLHD.Text = dto_HoSo.TenRung;
                tbGhiChu_LLHD.Text = dto_HoSo.GhiChu;

                tbNgheNghiep_NNKN.Text = dto_HoSo.NgheNghiep;

                if (dto_HoSo.NutDay == 1) //1
                {
                    chbNutDay_NNKN.Checked = true;
                }

                if (dto_HoSo.PhuongHuong == 1) //2
                {
                    chbPhuongHuong_NNKN.Checked = true;
                }

                if (dto_HoSo.CuuThuong == 1) //3
                {
                    chbCuuThuong_NNKN.Checked = true;
                }

                if (dto_HoSo.TruyenTin == 1) //4
                {
                    chbTruyenTin_NNKN.Checked = true;
                }

                if (dto_HoSo.TroChoi == 1) //5
                {
                    chbTroChoi_NNKN.Checked = true;
                }

                if (dto_HoSo.LuaTrai == 1) //6
                {
                    chbLuaTrai_NNKN.Checked = true;
                }

                tbSoTruong_NNKN.Text = dto_HoSo.SoTruong;

                List<HoSo_HuanLuyen_DTO> list_HoSo_HuanLuyen = HoSo_HuanLuyen_BUS.TraCuuDSHuanLuyenTheoMaHoSo(iMa);
                foreach (HoSo_HuanLuyen_DTO dto_Temp in list_HoSo_HuanLuyen)
                {
                    HuanLuyen_DTO dto_HuanLuyen_Temp = HuanLuyen_BUS.TraCuuHuanLuyenTheoMa(dto_Temp.MaHuanLuyen);
                    UC_HuanLuyen uc_HuanLuyen = new UC_HuanLuyen(dto_HuanLuyen_Temp.Ma, dto_HuanLuyen_Temp.Nganh, dto_HuanLuyen_Temp.Khoa, dto_HuanLuyen_Temp.TenKhoa, dto_HuanLuyen_Temp.KhoaTruong, (DateTime)dto_HuanLuyen_Temp.Nam, dto_HuanLuyen_Temp.MHL, dto_HuanLuyen_Temp.TinhTrang, true);

                    int iNewLocation = list_UC_HuanLuyen.Count * 180 + pn_gbHuanLuyen.AutoScrollPosition.Y;
                    uc_HuanLuyen.Location = new Point(8, iNewLocation);

                    list_UC_HuanLuyen.Add(uc_HuanLuyen);
                    pn_gbHuanLuyen.Controls.Add(list_UC_HuanLuyen[list_UC_HuanLuyen.Count - 1]);
                    list_UC_HuanLuyen[list_UC_HuanLuyen.Count - 1].VisibleChanged += new EventHandler(AfterDeleteHL);

                    list_UC_HuanLuyen_Update.Add(uc_HuanLuyen);
                }
            }
        }