Пример #1
0
        public static bool Insert(TrachVu dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();

                VNSC.TrachVus.InsertOnSubmit(dto);
                VNSC.SubmitChanges();
                return true;
            }
            catch (System.Exception ex)
            {
                return false;
            }
        }
Пример #2
0
 public static bool UpdateTrachVuInfo(TrachVu dto)
 {
     return TrachVu_DAO.UpdateTrachVuInfo(dto);
 }
Пример #3
0
        public static bool UpdateTrachVuInfo(TrachVu dto)
        {
            try
            {
                VNSCDataContext VNSC = SQL_Connection.CreateSQlConnection();
                TrachVu sk = VNSC.TrachVus.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;
            }
        }
Пример #4
0
 partial void DeleteTrachVu(TrachVu instance);
Пример #5
0
 public static bool Insert(TrachVu dto)
 {
     return TrachVu_DAO.Insert(dto);
 }
Пример #6
0
 partial void UpdateTrachVu(TrachVu instance);
Пример #7
0
 partial void InsertTrachVu(TrachVu instance);
Пример #8
0
		private void detach_TrachVus(TrachVu entity)
		{
			this.SendPropertyChanging();
			entity.NhomTrachVu = null;
		}
Пример #9
0
		private void attach_TrachVus(TrachVu entity)
		{
			this.SendPropertyChanging();
			entity.NhomTrachVu = this;
		}
Пример #10
0
        private void pbHoanTat_Click(object sender, EventArgs e)
        {
            if (lbSelect.Text == "THÊM")
            {
                TrachVu dto = new TrachVu();
                dto.Ma = tbMa.Text;
                dto.MaNhomTrachVu = list_NhomTrachVu[cbNhomTrachVu.SelectedIndex];
                //dto.MaNhomTrachVu = NhomTrachVu_BUS.TraCuuNhomTrachVuTheoTen(cbNhomTrachVu.Text).Ma;
                dto.Ten = tbTen.Text;
                dto.MoTa = tbMoTa.Text;

                if (TrachVu_BUS.Insert(dto))
                {
                    pnQuanLy.Visible = true;
                    pnSelect.Visible = true;
                    pnInfo.Visible = false;

                    NewInfo();

                    lbTitle.Text = "TRÁCH VỤ";
                    lbSelect.Text = "";

                    refreshListView();

                    lvThongTin.SelectedItems.Clear();
                }
                else
                {
                    Form_Notice frm = new Form_Notice("Không thể tạo Trách Vụ!", false);
                }
            }

            if (lbSelect.Text == "SỬA")
            {
                TrachVu dto = TrachVu_BUS.TraCuuTrachVuTheoMa(tbMa.Text);
                dto.MaNhomTrachVu = list_NhomTrachVu[cbNhomTrachVu.SelectedIndex];
                //dto.MaNhomTrachVu = NhomTrachVu_BUS.TraCuuNhomTrachVuTheoTen(cbNhomTrachVu.Text).Ma;
                dto.Ten = tbTen.Text;
                dto.MoTa = tbMoTa.Text;

                if (TrachVu_BUS.UpdateTrachVuInfo(dto))
                {
                    pnQuanLy.Visible = true;
                    pnSelect.Visible = true;
                    pnInfo.Visible = false;

                    NewInfo();

                    lbTitle.Text = "TRÁCH VỤ";
                    lbSelect.Text = "";

                    refreshListView();
                }
                else
                {
                    Form_Notice frm = new Form_Notice("Không thể cập nhật Trách Vụ!", false);
                }
            }
        }