public DOTNSSaleCppScr Copy() { var pm = new DOTNSSaleCppScr(); try { FieldInfo[] infos = typeof(DOTNSSaleCppScr).GetFields(); foreach (FieldInfo info in infos) { if (info.FieldType == typeof(DataSet)) { continue; } else { info.SetValue(pm, info.GetValue(this)); } } } catch(Exception ex) { PLException.AddException(ex); } return pm; }
public bool Compare(DOTNSSaleCppScr doTNSProgramGridSCR) { try { FieldInfo[] infos = typeof(DOTNSSaleCppScr).GetFields(); foreach (FieldInfo info in infos) { if (info.Name == "NGUOI_CAP_NHAT" || info.Name == "NGAY_CAP_NHAT") continue; object a = info.GetValue(this); object b = info.GetValue(doTNSProgramGridSCR); if ((a == null && b != null) || a != null && b == null) return false; if (a == null && b == null) continue; if (a.Equals(b) == false) return false; } return true; } catch (Exception ex) { PLException.AddException(ex); } return false; }