Пример #1
0
        public void Insert(NhaXuatBan info)
        {
            cnn = helper.GetConnect();
            sqlString = "Insert into NhaXuatBan(id, Ten, DiaChi, DienThoai, Email, GhiChu ) values ('" + info.Id + "',N'" + info.Ten + "',N'" + info.DiaChi + "','" + info.DienThoai + "','" + info.Email + "',N'" + info.GhiChu + "')";
            try
            {

                //Thực thi câu lệnh SQL
                cmd = new SqlCommand(sqlString, cnn);
                cmd.ExecuteNonQuery();

            }
            catch (System.Exception e)
            {
                cnn.Close();
                throw new Exception("Lỗi Kết Nối Cơ sở dữ liệu.");
            }

            cnn.Close();
        }
Пример #2
0
 public void Update(NhaXuatBan info)
 {
     nxbD.Update(info);
 }
Пример #3
0
        public void Update(NhaXuatBan info)
        {
            sqlString = "UPDATE NHAXUATBAN SET Ten=N'" + info.Ten +
                "',DiaChi=N'" + info.DiaChi +
                "',DienThoai='" + info.DienThoai +
                "',Email='" + info.Email +
                "',GhiChu=N'" + info.GhiChu +
                "' WHERE id='" + info.Id + "'";
            cnn = helper.GetConnect();
            try
            {

                //Thực thi câu lệnh SQL
                cmd = new SqlCommand(sqlString, cnn);
                cmd.ExecuteNonQuery();
            }
            catch (System.Exception e)
            {
                cnn.Close();
                throw new Exception("Lỗi Kết Nối Cơ sở dữ liệu.");
            }
            cnn.Close();
        }
Пример #4
0
 public void Insert(NhaXuatBan info)
 {
     nxbD.Insert(info);
 }