Esempio n. 1
0
        public DataTable CreateTbNH(EC_NhomHang _nh)
        {
            string sqlquery = "SELECT * FROM tb_Nhomhang where manhom like N'%{0}%' and tennhom like N'%{1}%'";

            sqlquery = string.Format(sqlquery, _nh.MaNhomHang, _nh.TenNhomHang);
            return(Connect.CreateTable(sqlquery));
        }
Esempio n. 2
0
 public void AddNhomHang(EC_NhomHang _nhomhang)
 {
     if (!sqlnhomhang.CheckNhomHang(_nhomhang.MaNhomHang))
     {
         sqlnhomhang.AddNhomHang(_nhomhang);
     }
     else
     {
         MessageBox.Show("Mã này đã tồn tại,xin chọn Mã khác", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Esempio n. 3
0
        public void AddNhomHang(EC_NhomHang _newnhomhang)
        {
            try
            {
                Connect.SqlConnect.Open();
                string sqlquery = @"INSERT INTO tb_Nhomhang
					  (manhom, tennhom)
							 VALUES (N'{0}',N'{1}')"                            ;
                sqlquery = string.Format(sqlquery, _newnhomhang.MaNhomHang, _newnhomhang.TenNhomHang);
                SqlCommand cmd = new SqlCommand(sqlquery, Connect.SqlConnect);
                cmd.ExecuteNonQuery();
                Connect.SqlConnect.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
        public void UpdateNhomHang(EC_NhomHang _nhomhang)
        {
            try
            {
                Connect.SqlConnect.Open();
                string sqlquery = @"UPDATE    tb_Nhomhang
				SET tennhom =N'{0}' where manhom =N'{1}'"                ;
                string.Format(sqlquery, _nhomhang.TenNhomHang, _nhomhang.MaNhomHang);
                SqlCommand cmd = new SqlCommand(sqlquery, Connect.SqlConnect);
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Connect.SqlConnect.Close();
            }
        }
Esempio n. 5
0
 public void XoaDuLieu(EC_NhomHang et)
 {
     cn.ThucThiSQL("DELETE FROM NhomHang where MaNhom =" + et.MaNhom);
 }
Esempio n. 6
0
 public void SuaDuLieu(EC_NhomHang et)
 {
     cn.ThucThiSQL("UPDATE NhomHang SET TenNhom=N'" + et.TenNhom + "',MaNhom ='" + et.MaNhom + "' where MaNhom=" + et.MaNhom);
 }
Esempio n. 7
0
 public void ThemDuLieu(EC_NhomHang et)
 {
     cn.ThucThiSQL("INSERT INTO NhomHang (MaNhom,TenNhom) VALUES (N'" + et.MaNhom + "',N'" + et.TenNhom + "')");
 }
Esempio n. 8
0
 // delete data
 public void XoaDuLieu(EC_NhomHang et)
 {
     SQL.XoaDuLieu(et);
 }
Esempio n. 9
0
 //-------- update data
 public void SuaDuLieu(EC_NhomHang et)
 {
     SQL.SuaDuLieu(et);
 }
Esempio n. 10
0
 // in ssert dữ liệu ---------------
 public void ThemDuLieu(EC_NhomHang et)
 {
     SQL.ThemDuLieu(et);
 }
Esempio n. 11
0
 public void DeleteNhomHang(EC_NhomHang _nhomhang)
 {
     sqlnhomhang.DeleteNhomHang(_nhomhang);
 }
Esempio n. 12
0
 public void UpdateNhomHang(EC_NhomHang _nhomhang)
 {
     sqlnhomhang.UpdateNhomHang(_nhomhang);
 }
Esempio n. 13
0
 public DataTable CreateTbNH(EC_NhomHang _nh)
 {
     return(sqlnhomhang.CreateTbNH(_nh));
 }
Esempio n. 14
0
 public void DeleteNhomHang(EC_NhomHang _nhomhang)
 {
     Connect.ExcuteNonQuery("DELETE FROM [tb_Nhomhang] WHERE  manhom=N'" + _nhomhang.MaNhomHang + "'");
 }