public void Delete(CustVisitActivityModel entity) { objCustVisitActivity = new CRM_CustVisitActivityRepository(); if (objCustVisitActivity.GetAll(v => v.VisitedDate == entity.VisitedDate && v.CustomerID == entity.CustomerID && v.CreatedBy == entity.CreatedBy).Count() > 0) { CRM_CustVisitActivity deleteRecord = objCustVisitActivity.GetSingle(v => v.VisitedDate == entity.VisitedDate && v.CustomerID == entity.CustomerID && v.CreatedBy == entity.CreatedBy); objCustVisitActivity.Delete(deleteRecord); } }
public IList<CustVisitActivityModel> getAll() { objCustVisitActivity = new CRM_CustVisitActivityRepository(); Mapper.CreateMap<CRM_CustVisitActivity, CustVisitActivityModel>(); IList<CRM_CustVisitActivity> objEntity = objCustVisitActivity.GetAll().ToList(); IList<CustVisitActivityModel> objResult = new List<CustVisitActivityModel>(); objResult = Mapper.Map(objEntity, objResult); return objResult; }
public void Update(CustVisitActivityModel entity) { objCustVisitActivity = new CRM_CustVisitActivityRepository(); Mapper.CreateMap<CustVisitActivityModel, CRM_CustVisitActivity>(); if (objCustVisitActivity.GetAll(v => v.VisitedDate == entity.VisitedDate && v.CustomerID == entity.CustomerID && v.CreatedBy == entity.CreatedBy).Count() > 0) { CRM_CustVisitActivity updateRecord = objCustVisitActivity.GetSingle(v => v.VisitedDate == entity.VisitedDate && v.CustomerID == entity.CustomerID && v.CreatedBy == entity.CreatedBy); updateRecord = Mapper.Map(entity, updateRecord); objCustVisitActivity.Update(updateRecord); } }