public long AddItem(VerifiedRecord model, string userName, string solId, ref string message) { try { model.IsDeleted = false; model.Month = DateTime.Now.Month.ToString(); model.DateCreated = DateTime.Now; model.InitiatingBranchSolID = model.InitiatingBranchSolID; model.RMStaffID = userName; Connection.VerifiedRecords.Add(model); Connection.SaveChanges(); return(model.ID); } catch (Exception ex) { throw ex; } }
public long UpdateItem(VerifiedRecord model, string userName, string solId, ref string message) { try { var x = Connection.VerifiedRecords.Find(model.ID); if (x.ID > 0) { x.Amount = model.Amount; x.BeneficiaryAccountNumber = model.BeneficiaryAccountNumber; x.BUCode = model.BUCode; x.DateCreated = model.DateCreated; x.DeskCode = model.DeskCode; x.FlowStatus = model.FlowStatus; x.InitiatingBranchName = model.InitiatingBranchName; x.InitiatingBranchSolID = model.InitiatingBranchSolID; x.IsBatchApproved = model.IsBatchApproved; x.IsBatchValidated = model.IsBatchValidated; x.IsDeleted = model.IsDeleted; x.Month = model.Month; x.PayementDate = model.PayementDate; x.PayerAccountNumber = model.PayerAccountNumber; x.PayerName = model.PayerName; x.PayerType = model.PayerType; x.PaymentReferenceNumber = model.PaymentReferenceNumber; x.ProductCategory = model.ProductCategory; x.RMStaffID = model.RMStaffID; //x.SolId = model.SolId; x.TeamCode = model.TeamCode; Connection.SaveChanges(); } } catch (Exception e) { Logger.Error($"UpdateItem::" + model.BatchNumber + "|||" + model.InitiatingBranchSolID + "|||" + model.BUCode, e); } return(model.ID); }