public bool UpdateMitchellClaim(MitchellClaimType mitchellClaimType)
 {
     try
     {
         _mitchellClaimContext.Entry(mitchellClaimType).State = EntityState.Modified;
         _mitchellClaimContext.SaveChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
Beispiel #2
0
        public MitchellClaim Create(MitchellClaimType mitchellClaimType)
        {
            if (mitchellClaimType == null) return null;

            return new MitchellClaim()
            {
                AssignedAdjusterID = mitchellClaimType.AssignedAdjusterID,
                ClaimantFirstName = mitchellClaimType.ClaimantFirstName,
                ClaimantLastName = mitchellClaimType.ClaimantLastName,
                ClaimNumber = mitchellClaimType.ClaimNumber,
                LossDate = mitchellClaimType.LossDate,
                LossInfo = Create(mitchellClaimType.LossInfo),
                Status = mitchellClaimType.Status.ToString(),
                Vehicles = mitchellClaimType.Vehicles.Select(m => Create(m)).ToArray()
            };
        }
 public int AddMitchellClaim(MitchellClaimType mitchellClaimType)
 {
     MitchellClaimType mitchellClaimAdded = _mitchellClaimContext.MitchellClaimTypes.Add(mitchellClaimType);
     _mitchellClaimContext.SaveChanges();
     return mitchellClaimAdded.Id;
 }
Beispiel #4
0
        public MitchellClaimType Parse(MitchellClaim model)
        {
            try
            {
                if (model == null) return null;

                var entity = new MitchellClaimType()
                {
                    AssignedAdjusterID = model.AssignedAdjusterID,
                    ClaimantFirstName = model.ClaimantFirstName,
                    ClaimantLastName = model.ClaimantLastName,
                    ClaimNumber = model.ClaimNumber,
                    LossDate = model.LossDate,
                    LossInfo = Parse(model.LossInfo),
                    Vehicles = Parse(model.Vehicles),
                    Status = (StatusCode)Enum.Parse(typeof(StatusCode), model.Status)
                };
                return entity;
            }
            catch
            {
                return null;
            }
        }