Example #1
0
        private void tsbxoa_Click(object sender, EventArgs e)
        {
            if (cbbmanv.Text == "")
            {
                MessageBox.Show("Chưa chọn thông tin");
                return;
            }
            thannhan tn = new thannhan();

            tn.tentn    = txttentn.Text;
            tn.ngaysinh = datengaysinh.Value;
            tn.diachi   = cbbtinhdc.Text + "," + cbbhuyendc.Text + "," + cbbxadc.Text;
            tn.manv     = cbbmanv.Text;

            tn.quanhe = cbbquanhe.Text;
            if (MessageBox.Show(string.Format("Xóa thân nhân"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.DeleteProfile(tn) > 0)
                {
                    MessageBox.Show("Đã xóa");
                    Thannhan_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("thông tin chưa được xóa");
                }
            }
        }
Example #2
0
        private void butsua_Click(object sender, EventArgs e)
        {
            if (cbxma.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin!");
                return;
            }
            thannhan t = new thannhan();

            t.mahs         = cbxma.Text;
            t.hotenbo      = txttenbo.Text;
            t.diachi       = txtdcbo.Text;
            t.ngaysinh     = datensbo.Value;
            t.nghenghiep   = txtnnbo.Text;
            t.hotenme      = txttenme.Text;
            t.diachime     = txtdcme.Text;
            t.ngaysinhme   = datensme.Value;
            t.nghenghiepme = txtnnme.Text;

            if (MessageBox.Show(string.Format("Bạn có muốn sửa liên lạc của  học sinh này không?"),
                                "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.UpdateProfile(t) > 0)
                {
                    MessageBox.Show("sửa thông tin  thành công!");
                    solienlac_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("bị Lỗi");
                }
            }
        }
Example #3
0
 internal static int DeleteProfile(thannhan t)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", t.mahs),
     };
     return(DataProvider.ExecuteNonQuery("xoathannhan", para));
 }
Example #4
0
 public static int DeleteProfile(thannhan tn)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@manv", tn.manv),
     };
     return(DataProvider.ExcuteNonQuerry("xoatn", para));
 }
Example #5
0
 public static int InsertProfile(thannhan tn)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@tentn", tn.tentn),
         new SqlParameter("@ngaysinh", tn.ngaysinh),
         new SqlParameter("@diachi", tn.diachi),
         new SqlParameter("@manv", tn.manv),
         new SqlParameter("@quanhe", tn.quanhe),
     };
     return(DataProvider.ExcuteNonQuerry("themtn", para));
 }
Example #6
0
 public static int UpdateProfile(thannhan t)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", t.mahs),
         new SqlParameter("@tenbo", t.hotenbo),
         new SqlParameter("@dcbo", t.diachi),
         new SqlParameter("@nsbo", t.ngaysinh),
         new SqlParameter("@nnbo", t.nghenghiep),
         new SqlParameter("@tenme", t.hotenme),
         new SqlParameter("@dcme", t.diachime),
         new SqlParameter("@nsme", t.ngaysinhme),
         new SqlParameter("@nnme", t.nghenghiepme)
     };
     return(DataProvider.ExecuteNonQuery("suathannhan", para));
 }
Example #7
0
 public static int DeleteProfile(thannhan t)
 {
     return(Dao.DeleteProfile(t));
 }
Example #8
0
 public static int UpdateProfile(thannhan t)
 {
     return(Dao.UpdateProfile(t));
 }
Example #9
0
 public static int InsertProfile(thannhan t)
 {
     return(Dao.InsertProfile(t));
 }