public DeseasesViewModel MapDoctorDesease(DeseaseModel dModel)
 {
     return(new DeseasesViewModel()
     {
         Id = dModel.Id,
         DeseaseName = dModel.DeseaseName,
         TanentId = dModel.TenantID
     });
 }
 private List <Parameter> GetSaveDeseaseParams(DeseaseModel deseaseModel)
 {
     return(new Parameter[]
     {
         new Parameter("@Id", deseaseModel.Id),
         new Parameter("@DeseaseName", deseaseModel.DeseaseName),
         new Parameter("@TenantID", deseaseModel.TenantID),
         new Parameter("@CreatedBy", deseaseModel.CreatedBy),
         new Parameter("@CreatedByEntity", deseaseModel.CreatedByEntity),
         new Parameter("@UpdatedBy", deseaseModel.ModifiedBy),
         new Parameter("@UpdatedByEntity", deseaseModel.ModifiedByEntity)
     }.ToList <Parameter>());
 }
        public DeseaseModel SaveDesease(DeseaseModel dModel)
        {
            List <Parameter> saveHParam = GetSaveDeseaseParams(dModel);
            Parameter        p_IsError  = new Parameter("@IsError", DBNull.Value, ParameterDirection.Output, DbType.Int16, 1);
            Parameter        p_ErrorMsg = new Parameter("@ErrorMsg", DBNull.Value, ParameterDirection.Output, DbType.String, 100);

            saveHParam.Add(p_IsError);
            saveHParam.Add(p_ErrorMsg);
            var r        = dataBaseService.ExecuteScalar(StoredProcedures.InsertUpdateDesease, DBCommandType.Procedure, saveHParam.ToArray <Parameter>());
            int retValue = Convert.ToInt32(r);

            if (retValue < (int)StoreProcStatusEnum.Success)
            {
                dModel.Success      = false;
                dModel.ErrorMessage = p_ErrorMsg.ToString();
            }
            else
            {
                dModel.Success = true;
                dModel.Id      = retValue;
            }
            return(dModel);
        }