Ejemplo n.º 1
0
        //public static DieuPhoi TraCuuDieuPhoiTheoTen(string sTen)
        //{
        //    try
        //    {
        //        VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
        //        DieuPhoi sk = VNSC.DieuPhois.Single(P => P.Ten == sTen);
        //        return sk;
        //    }
        //    catch (System.Exception ex)
        //    {
        //        return null;
        //    }
        //}
        public static bool Insert(DieuPhoi dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();

                VNSC.DieuPhois.InsertOnSubmit(dto);
                VNSC.SubmitChanges();
                return true;
            }
            catch (System.Exception ex)
            {
                return false;
            }
        }
Ejemplo n.º 2
0
        private void pbTransfer_Click(object sender, EventArgs e)
        {
            if (lvThongTin_HSTD.Focused)
            {
                for (int i = 0; i < lvThongTin_HSTD.SelectedItems.Count; i++)
                {
                    if (!KiemTraHoThamDuBiTrungHoSoDieuPhoi(lvThongTin_HSTD.SelectedItems[i].SubItems[0].Text))
                    {
                        DieuPhoi dto_DP = new DieuPhoi();
                        dto_DP.MaDonViHanhChanh = list_DonViHanhChanh[cbDonViHanhChanh.SelectedIndex];
                        dto_DP.MaTrachVuSuKien = list_TrachVuSuKien[cbTrachVuSuKien.SelectedIndex];
                        dto_DP.MaSuKien_HoSo = lvThongTin_HSTD.SelectedItems[i].SubItems[0].Text;

                        if (DieuPhoi_BUS.Insert(dto_DP))
                        {
                            SuKien_DieuPhoi dto_Temp = new SuKien_DieuPhoi();
                            dto_Temp.MaSuKien = iMaSuKien;
                            dto_Temp.MaDieuPhoi = dto_DP.Ma;

                            if (SuKien_DieuPhoi_BUS.Insert(dto_Temp))
                            {
                                cbTrachVuSuKien_SelectedIndexChanged(sender, e);
                            }
                            else
                            {
                                Form_Notice frm = new Form_Notice("Không thể tạo Hồ sơ điều phối!", false);
                            }
                        }
                        else
                        {
                            Form_Notice frm = new Form_Notice("Không thể tạo Hồ sơ điều phối!", false);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public static bool UpdateDieuPhoiInfo(DieuPhoi dto)
        {
            //try
            //{
            //    VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
            //    DieuPhoi sk = VNSC.DieuPhois.Single(P => P.Ma == dto.Ma);

            //    sk.Ten = dto.Ten;
            //    sk.MaDonViHanhChanh = dto.MaDonViHanhChanh;
            //    sk.MoTa = dto.MoTa;

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

            return true; //Khong co update
        }
Ejemplo n.º 4
0
 public static bool UpdateDieuPhoiInfo(DieuPhoi dto)
 {
     return DieuPhoi_DAO.UpdateDieuPhoiInfo(dto);
 }
Ejemplo n.º 5
0
        public static List<DieuPhoi> TraCuuDSDieuPhoiTheoMaSuKien_HoSo(int iMaSuKien, string sMaSuKien_HoSo)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
                List<DieuPhoi> list = new List<DieuPhoi>();

                var q = from p in VNSC.SuKien_DieuPhois
                        where p.MaSuKien == iMaSuKien
                        select p;

                DieuPhoi dto_Temp = new DieuPhoi();
                foreach (SuKien_DieuPhoi k in q)
                {
                    dto_Temp = VNSC.DieuPhois.Single(P => P.Ma == k.MaDieuPhoi);
                    if (dto_Temp.MaSuKien_HoSo == sMaSuKien_HoSo)
                    {
                        list.Add(dto_Temp);
                    }
                }

                return list;
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
Ejemplo n.º 6
0
		private void detach_DieuPhois(DieuPhoi entity)
		{
			this.SendPropertyChanging();
			entity.TrachVuSuKien = null;
		}
Ejemplo n.º 7
0
 //public static DieuPhoi TraCuuDieuPhoiTheoTen(string sTen)
 //{
 //    return DieuPhoi_DAO.TraCuuDieuPhoiTheoTen(sTen);
 //}
 public static bool Insert(DieuPhoi dto)
 {
     return DieuPhoi_DAO.Insert(dto);
 }
Ejemplo n.º 8
0
		private void detach_DieuPhois(DieuPhoi entity)
		{
			this.SendPropertyChanging();
			entity.SuKien_HoSo = null;
		}
Ejemplo n.º 9
0
 partial void DeleteDieuPhoi(DieuPhoi instance);
Ejemplo n.º 10
0
 partial void UpdateDieuPhoi(DieuPhoi instance);
Ejemplo n.º 11
0
 partial void InsertDieuPhoi(DieuPhoi instance);
Ejemplo n.º 12
0
		private void detach_DieuPhois(DieuPhoi entity)
		{
			this.SendPropertyChanging();
			entity.DonViHanhChanh = null;
		}