public int UpdateNPP(NhaPhanPhoi NPP) { List<SqlParameter> paramList = new List<SqlParameter>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@MaNPP", SqlDbType.Int); param.Value = NPP.MaNPP; paramList.Add(param); param = new SqlParameter("@TenNPP", SqlDbType.NVarChar); param.Value = NPP.TenNPP.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@DiaChi", SqlDbType.NVarChar); param.Value = NPP.DiaChi.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@DienThoai", SqlDbType.NVarChar); param.Value = NPP.DienThoai.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@Fax", SqlDbType.NVarChar); param.Value = NPP.Fax.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@Email", SqlDbType.NVarChar); param.Value = NPP.Email.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@MaSoThue", SqlDbType.NVarChar); param.Value = NPP.MaSoThue.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@GhiChu", SqlDbType.NVarChar); param.Value = NPP.GhiChu.Replace("'", "''"); paramList.Add(param); int i = dbHelper.ExecuteNonQuery("NPP_Update", paramList); return i; }
public Boolean UpdateNPP(NhaPhanPhoi NPP) { SystemLog systemLog = new SystemLog(QuanLy.IDUser, DateTime.Now.ToString(), "Sửa nhà phân phối"); busUser.SetSystemLog(systemLog); if (NppQ.UpdateNPP(NPP) > 0) { return true; } else return false; }
public ArrayList SelectAllNpp(string _TenNpp) { SqlDataReader rd = dbHelper.ExecuteQuery("GetNPPBYTenNPP N'%" + _TenNpp.Replace("'", "''") + "%'"); ArrayList arrNpp = new ArrayList(); while (rd.Read()) { NhaPhanPhoi NPP = new NhaPhanPhoi(rd.GetInt32(0), rd.GetString(1), rd.GetString(2), rd.GetString(3), rd.GetString(4), rd.GetString(5), rd.GetString(6),rd.GetString(7)); arrNpp.Add(NPP); } rd.Close(); return arrNpp; }