public void SaveOldRow(TblMethodOfPaymentViewModel oldRow) { if (oldRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(oldRow, new ValidationContext(oldRow, null, null), valiationCollection, true); if (isvalid) { var save = oldRow.Iserial == 0; if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var saveRow = new TblMethodOfPayment(); saveRow.InjectFrom(oldRow); Glclient.UpdateOrInsertTblMethodOfPaymentsAsync(saveRow, save, MainRowList.IndexOf(oldRow), LoggedUserInfo.DatabasEname); } } }