public bool UpDate(PhongBanObjL Obj)
        {

            cmd.CommandText = " update PhongBan set TenPB = N'" + Obj.TenPB+ "' , DiaChi = N'" + Obj.DiaChi + "' , SDT = N'" + Obj.SDT + "' where MaPB = '" + Obj.MaPB + "'";
            cmd.CommandType = CommandType.Text;
            cmd.Connection = con.Connection;


            try
            {

                con.OpenConn();
                cmd.ExecuteNonQuery();

                return true;
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }

            return false;
        }
Example #2
0
 void ganDuLieu(PhongBanObjL Obj)
 {
     Obj.MaPB   = txt_mapb.Text.Trim();;
     Obj.TenPB  = txt_tenpb.Text.Trim();
     Obj.DiaChi = txt_diachi.Text.Trim();
     Obj.SDT    = txt_sdt.Text.Trim();
 }
        public bool AddData(PhongBanObjL Obj)
        {

            cmd.CommandText = " insert into PhongBan (MaPB,TenPB,DiaChi,SDT) values('" + Obj.MaPB + "',N'" + Obj.TenPB + "',N'" + Obj.DiaChi + "' ,N'" + Obj.SDT + "')";
            cmd.CommandType = CommandType.Text;
            cmd.Connection =con.Connection;

            try
            {
                con.OpenConn();
                cmd.ExecuteNonQuery();

                return true;
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }

            return false;
        }
Example #4
0
 public bool upData(PhongBanObjL pbObj)
 {
     return(pbMod.UpDate(pbObj));
 }
Example #5
0
 public bool addData(PhongBanObjL pbObj)
 {
     return(pbMod.AddData(pbObj));
 }