CreateSupplementalDiagnosis() public method

public CreateSupplementalDiagnosis ( lkup_splmtl_diag entity ) : int
entity HealthInformationProgram.Data.Tables.lkup_splmtl_diag
return int
Ejemplo n.º 1
0
        public int CreateSupplementalDiagnosis(SupplementalDiagnosisModel model)
        {
            var repo = new SupplementalDiagnosisRepository();
            var dataModel = new HealthInformationProgram.Data.Tables.lkup_splmtl_diag();
            //dataModel.splmtl_diag_id = null;// Convert.ToDecimal(model.SupplementalDiagnosisId);
            dataModel.diag_id = Convert.ToDecimal(model.DiagnosisId);
            dataModel.splmtl_diag_stat = model.Status;
            dataModel.splmtl_diag_descn = model.SupplementalDiagnosisDescription;
            dataModel.user_intrfc_sort_ord = Convert.ToDecimal(model.SortOrder);
            dataModel.splmtl_diag_strt_eff_dt = Convert.ToDateTime(model.SupplementalDiagnosisEffectiveStartDate);
            dataModel.splmtl_diag_end_eff_dt = Convert.ToDateTime(model.SupplementalDiagnosisEffectiveEndDate);
            dataModel.rec_creat_dt = DateTime.Now;
            dataModel.rec_creat_user_id_cd = model.CreatedBy;
            dataModel.rec_updt_dt = DateTime.Now;
            dataModel.rec_updt_user_id_cd = model.UpdatedBy;

            try
            {

                var returnCode = repo.CreateSupplementalDiagnosis(dataModel);
                return returnCode;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }