Exemplo n.º 1
0
 public string SaveText(HlcDto text)
 {
     if (text.Id == 0)
     {
         var sql = $"insert into hlc_DoctorNote (UserId,DateEntered,DoctorId,Notes) values ('{text.UserId}',getDate(),{text.DoctorId}, '{text.FieldText?.Replace("'", "''")}')";
         try
         {
             ExecuteSql(sql);
             return("OK");
         }
         catch (Exception ex)
         {
             LogException(ex, text);
             return("ERROR");
         }
     }
     else
     {
         var sql = $"update hlc_DoctorNote set Notes = '{text.FieldText?.Replace("'", "''")}' where Id={text.Id}";
         try
         {
             ExecuteSql(sql);
             return("OK");
         }
         catch (Exception ex)
         {
             LogException(ex, text);
             return("ERROR");
         }
     }
 }
Exemplo n.º 2
0
        public bool Remove(HlcDto dto)
        {
            try
            {
                var sql = $"delete from hlc_CaseFile where Id={dto.Id};";
                ExecuteSql(sql);

                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex, new { deleteOp = $"Error deleting CaseFile: {dto.Id}" });
                return(false);
            }
        }
Exemplo n.º 3
0
        public string SaveText(HlcDto text)
        {
            var sql = $"update hlc_CaseFile set {text.FieldName} = '{text.FieldText?.Replace("'", "''")}' where Id={text.Id}";

            try
            {
                ExecuteSql(sql);
                return("OK");
            }
            catch (Exception ex)
            {
                LogException(ex, text);
                return("ERROR");
            }
        }
Exemplo n.º 4
0
        public bool Remove(HlcDto dto)
        {
            try
            {
                var sql = $"delete from hlc_PVGMemberHospital where PVGMemberId={dto.Id};" +
                          $"delete from hlc_PVGMember where Id={dto.Id};";
                ExecuteSql(sql);

                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex, new { deleteOp = $"Error deleting PvgMember: {dto.Id}" });
                return(false);
            }
        }
Exemplo n.º 5
0
        public string Update(HlcDto text)
        {
            var sql = $"update hlc_Department set DepartmentName = '{text.FieldText?.Replace("'", "''")}' where Id={text.Id}";

            try
            {
                ExecuteSql(sql);
                GetSelectList(true);
                return("OK");
            }
            catch (Exception ex)
            {
                LogException(ex, text);
                return("ERROR");
            }
        }
Exemplo n.º 6
0
 public bool Remove(HlcDto dto)
 {
     try
     {
         //var sql = $"delete from hlc_Presentation WHERE DepartmentID = {dto.Id};" +
         //          $"delete from hlc_Department where Id={dto.Id};";
         var sql = $"delete from hlc_Department where Id={dto.Id};";
         ExecuteSql(sql);
         GetSelectList(true);
         return(true);
     }
     catch (Exception ex)
     {
         LogException(ex, new { deleteOp = $"Error deleting Department: {dto.Id}" });
         return(false);
     }
 }
Exemplo n.º 7
0
 public bool Remove(HlcDto dto)
 {
     try
     {
         //var sql = $"delete from hlc_DoctorSpecialty ds WHERE ds.SpecialtyID = {dto.Id};" +
         //          $"delete from hlc_Specialty where Id={dto.Id};";
         var sql = $"delete from hlc_Specialty where Id={dto.Id};";
         ExecuteSql(sql);
         GetSelectList(true);
         return(true);
     }
     catch (Exception ex)
     {
         LogException(ex, new { deleteOp = $"Error deleting Specialty: {dto.Id}" });
         return(false);
     }
 }
Exemplo n.º 8
0
        public bool Add(HlcDto dto)
        {
            if (string.IsNullOrEmpty(dto.FieldText))
            {
                return(false);
            }

            try
            {
                var sql = "insert into hlc_Department (DepartmentName, DateEntered, EnteredBy) values " +
                          $"('{dto.FieldText.Replace("'","''")}', getDate(), '{dto.UserId}');";

                ExecuteSql(sql);
                GetSelectList(true);
                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex, new { deleteOp = $"Error adding Specialty: {dto.Id}" });
                return(false);
            }
        }
Exemplo n.º 9
0
        public bool Add(HlcDto dto)
        {
            if (string.IsNullOrEmpty(dto.FieldText))
            {
                return(false);
            }

            try
            {
                var sql = "insert into hlc_Specialty (SpecialtyName, SpecialtyCode) values " +
                          $"('{dto.FieldText.Replace("'", "''")}', '');";

                ExecuteSql(sql);
                GetSelectList(true);
                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex, new { deleteOp = $"Error adding Specialty: {dto.Id}" });
                return(false);
            }
        }
Exemplo n.º 10
0
        public string GetText(HlcDto text)
        {
            var sql = $"select {text.FieldName} as FieldText from hlc_CaseFile where Id={text.Id}";

            return(GetMemberFromSql <HlcDto>(sql).FieldText);
        }