public void SaveProfileWslxId(ProfileModel model) { LBC_PROFILE _profile = new LBC_PROFILE(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { _profile = MapLBC_PROFILEFromModel(model); _profile.CREATED_BY = _profile.WSLX_ID; _profile.CREATED_DATE = DateTime.Now; context.LBC_PROFILE.Add(_profile); context.SaveChanges(); } }
private ProfileModel MapModelFromLBC_Profile(LBC_PROFILE entity) { ProfileModel model = new ProfileModel(); if (entity != null) { model.ADMIN_NOTES = entity.ADMIN_NOTES; model.BIOGRAPHY = entity.BIOGRAPHY; model.CREATED_BY = entity.CREATED_BY; model.CREATED_DATE = entity.CREATED_DATE; model.DEPARTMENT = entity.DEPARTMENT; model.DIETARY_RESTRICTION = entity.DIETARY_RESTRICTION; model.DLR_ADDRESS = entity.DLR_ADDRESS; model.DLR_CITY = entity.DLR_CITY; model.DLR_NAME = entity.DLR_NAME; model.DLR_PHONE = entity.DLR_PHONE; model.DLR_REGION = entity.DLR_REGION; model.DLR_STATE = entity.DLR_STATE; model.DLR_ZIP = entity.DLR_ZIP; model.EMAIL_ID = entity.EMAIL_ID; model.EMP_STATUS_CODE = entity.EMP_STATUS_CODE; model.FIRST_NAME = entity.FIRST_NAME; model.LAST_NAME = entity.LAST_NAME; model.LBC_CERT = entity.LBC_CERT; model.PA_CODE = entity.PA_CODE; model.PHONE = entity.PHONE; model.PHOTO_PATH = entity.PHOTO_PATH; model.PROFILE_NOTE = entity.PROFILE_NOTE; model.PROFILE_TYPE = entity.PROFILE_TYPE; model.SHIRT_SIZE = entity.SHIRT_SIZE; model.STARS_ID = entity.STARS_ID; model.TITLE = entity.TITLE; model.UPDATE_DATE = entity.UPDATE_DATE; model.UPDATED_BY = entity.UPDATED_BY; model.WSLX_ID = entity.WSLX_ID; model.ZONE = entity.ZONE; model.SALESCODE = entity.SALESCODE; model.DEPT_INFO = entity.DEPT_INFO; ////ToDo: Add entity ref to dealer type s/c in entity once model is updated. model.DEALER_TYPE = entity.SELECT_CONTACT_DLR; model.haveProfileWslxId = string.IsNullOrEmpty(entity.WSLX_ID) ? false : true; } return(model); }
private LBC_PROFILE MapLBC_PROFILEFromModel(ProfileModel entity) { LBC_PROFILE model = new LBC_PROFILE(); if (entity != null) { model.ADMIN_NOTES = entity.ADMIN_NOTES; model.BIOGRAPHY = entity.BIOGRAPHY; model.CREATED_BY = entity.CREATED_BY; model.CREATED_DATE = entity.CREATED_DATE; model.DEPARTMENT = entity.DEPARTMENT; model.DIETARY_RESTRICTION = entity.DIETARY_RESTRICTION; model.DLR_ADDRESS = entity.DLR_ADDRESS; model.DLR_CITY = entity.DLR_CITY; model.DLR_NAME = entity.DLR_NAME; model.DLR_PHONE = entity.DLR_PHONE; model.DLR_REGION = entity.DLR_REGION; model.DLR_STATE = entity.DLR_STATE; model.DLR_ZIP = entity.DLR_ZIP; model.EMAIL_ID = entity.EMAIL_ID; model.EMP_STATUS_CODE = entity.EMP_STATUS_CODE; model.FIRST_NAME = entity.FIRST_NAME; model.LAST_NAME = entity.LAST_NAME; model.LBC_CERT = entity.LBC_CERT; model.PA_CODE = entity.PA_CODE; model.PHONE = entity.PHONE; model.PHOTO_PATH = entity.PHOTO_PATH; model.PROFILE_NOTE = entity.PROFILE_NOTE; model.PROFILE_TYPE = entity.PROFILE_TYPE; model.SHIRT_SIZE = entity.SHIRT_SIZE; model.STARS_ID = entity.STARS_ID; model.TITLE = entity.TITLE; model.UPDATE_DATE = entity.UPDATE_DATE; model.UPDATED_BY = entity.UPDATED_BY; model.WSLX_ID = entity.WSLX_ID; } return(model); }