public CustVisitActivityModel getByID(DateTime visitDate, string customerID, string createdBy)
        {
            Mapper.CreateMap<CRM_CustVisitActivity, CustVisitActivityModel>();
            objCustVisitActivity = new CRM_CustVisitActivityRepository();

            CRM_CustVisitActivity objEntity = objCustVisitActivity.GetSingle(v => v.VisitedDate == visitDate && v.CustomerID == customerID && v.CreatedBy == createdBy);

            CustVisitActivityModel objResult = new CustVisitActivityModel();

            objResult = Mapper.Map(objEntity, objResult);

            return objResult;
        }
        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 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);
            }
        }