コード例 #1
0
 public void Update(NotesTblInfo note)
 {
     if (note.NoteID > 0)
     {
         string sql = "UPDATE [dbo].[notesTbl]"
                      + " SET [noteName] = N'" + note.NoteName + "'"
                      + ",[clinicName] = N'" + note.ClinicName + "'"
                      + ",[clinicAddress] = N'" + note.ClinicAddress + "'"
                      + ",[doctorName] = N'" + note.DoctorName + "'"
                      + ",[doctorPhone] = '" + note.DoctorPhone + "'"
                      + ",[patientName] = N'" + note.PatientName + "'"
                      + ",[patientAge] = " + note.PatientAge
                      + ",[patientGender] = " + note.PatientGender
                      + ",[patientCode] = N'" + note.PatientCode + "'"
                      + ",[patientPhone] = '" + note.PatientPhone + "'"
                      + ",[patientAddress] = N'" + note.PatientAddress + "'"
                      + ",[reason] = N'" + note.Reason + "'"
                      + ",[suggest] = N'" + note.Suggest + "'"
                      + ",[imagePath1] = N'" + note.ImagePath1 + "'"
                      + ",[imagePath2] = N'" + note.ImagePath2 + "'"
                      + ",[templateID] = " + note.TemplateID
                      + ",[dayCreate] = '" + Convert.ToDateTime(note.DayCreate) + "'"
                      + " WHERE noteID = " + note.NoteID;
         SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
     }
 }
コード例 #2
0
        public DataTable GetNotes()
        {
            string sql = "SELECT [noteID]"
                         + ",[noteName]"
                         + ",[clinicName]"
                         + ",[clinicAddress]"
                         + ",[doctorName]"
                         + ",[doctorPhone]"
                         + ",[patientName]"
                         + ",[patientAge]"
                         + ",[patientGender]"
                         + ",[patientCode]"
                         + ",[patientPhone]"
                         + ",[patientAddress]"
                         + ",[reason]"
                         + ",[suggest]"
                         + ",[imagePath1]"
                         + ",[imagePath2]"
                         + ",[templateID]"
                         + ",[dayCreate]"
                         + " FROM [dbo].[notesTbl]"
                         + " WHERE 1=1";

            sql += " ORDER BY noteID ASC";
            return(SqlExtend.ExecuteDataTable(Data.ConnectionString, CommandType.Text, sql));
        }
コード例 #3
0
 // Delete
 public void Delete(TemplateTblInfo template)
 {
     if (template.TemplateID > 0)
     {
         string sql = "DELETE FROM [dbo].[templateTbl]"
                      + " WHERE templateID = " + template.TemplateID;
         SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
     }
 }
コード例 #4
0
 // Delete
 public void Delete(NotesTblInfo note)
 {
     if (note.NoteID > 0)
     {
         string sql = "DELETE FROM [dbo].[notesTbl]"
                      + " WHERE noteID = " + note.NoteID;
         SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
     }
 }
コード例 #5
0
        public List <TEntity> ToList <TEntity>(ProcBuilder procBuilder, TEntity entity) where TEntity : class, new()
        {
            // 生成SQL 输入、输出参数化
            var sqlParam = procBuilder.InitParam(entity);
            var param    = sqlParam.Param?.ToArray();
            var value    = SqlExtend.ToList <TEntity>(DataBase.GetReader(CommandType.StoredProcedure, sqlParam.Name, param));

            procBuilder.SetParamToEntity(entity);
            return(value);
        }
コード例 #6
0
        public DataTable GetSearchedNotes(NotesTblInfo note)
        {
            string sql = "SELECT [noteID]"
                         + ",[noteName]"
                         + ",[clinicName]"
                         + ",[clinicAddress]"
                         + ",[doctorName]"
                         + ",[doctorPhone]"
                         + ",[patientName]"
                         + ",[patientAge]"
                         + ",[patientGender]"
                         + ",[patientCode]"
                         + ",[patientPhone]"
                         + ",[patientAddress]"
                         + ",[reason]"
                         + ",[suggest]"
                         + ",[imagePath1]"
                         + ",[imagePath2]"
                         + ",[templateID]"
                         + ",[dayCreate]"
                         + " FROM [dbo].[notesTbl]"
                         + " WHERE 1=1";

            if (note.NoteID > 0)
            {
                sql += " AND noteID like %" + note.NoteID + "%";
            }
            if (note.NoteName.Length > 0)
            {
                sql += " AND noteName like %'" + note.NoteName + "'%";
            }
            if (note.ClinicName.Length > 0)
            {
                sql += " AND clinicName like %'" + note.ClinicName + "'%";
            }
            if (note.DoctorName.Length > 0)
            {
                sql += " AND doctorName like %'" + note.DoctorName + "'%";
            }
            if (note.PatientName.Length > 0)
            {
                sql += " AND patientName like %'" + note.PatientName + "'%";
            }
            if (note.PatientCode.Length > 0)
            {
                sql += " AND patientCode like %'" + note.PatientCode + "'%";
            }
            if (note.DayCreate.Length > 0)
            {
                sql += " AND dayCreate like %" + Convert.ToDateTime(note.DayCreate) + "%";
            }
            sql += " ORDER BY noteID ASC";
            return(SqlExtend.ExecuteDataTable(Data.ConnectionString, CommandType.Text, sql));
        }
コード例 #7
0
 public void Update(TemplateTblInfo template)
 {
     if (template.TemplateID > 0)
     {
         string sql = "UPDATE [dbo].[templateTbl]"
                      + " SET[templateName] = N'" + template.TemplateName + "'"
                      + ",[resultDetail] = N'" + template.ResultDetail + "'"
                      + ",[diagnosis] = N'" + template.Diagnosis + "'"
                      + ",[analysis] = N'" + template.Analysis + "'"
                      + " WHERE templateID = " + template.TemplateID;
         SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
     }
 }
コード例 #8
0
        public void Add(TemplateTblInfo template)
        {
            string sql = "INSERT INTO [dbo].[templateTbl]"
                         + "([templateName]"
                         + ",[resultDetail]"
                         + ",[diagnosis]"
                         + ",[analysis])"
                         + " VALUES "
                         + "(N'" + template.TemplateName + "'"
                         + ",N'" + template.ResultDetail + "'"
                         + ",N'" + template.Diagnosis + "'"
                         + ",N'" + template.Analysis + "'" + ")";

            SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
        }
コード例 #9
0
        public DataTable GetTemplates(TemplateTblInfo template)
        {
            string sql = "SELECT [templateID]"
                         + ",[templateName]"
                         + ",[resultDetail]"
                         + ",[diagnosis]"
                         + ",[analysis]"
                         + " FROM [dbo].[templateTbl]"
                         + " WHERE 1=1";

            if (template.TemplateID > 0)
            {
                sql += " AND templateID = " + template.TemplateID;
            }
            sql += " ORDER BY templateID ASC";
            return(SqlExtend.ExecuteDataTable(Data.ConnectionString, CommandType.Text, sql));
        }
コード例 #10
0
        public void Add(NotesTblInfo note)
        {
            string sql = "INSERT INTO [dbo].[notesTbl]"
                         + "([noteName]"
                         + ",[clinicName]"
                         + ",[clinicAddress]"
                         + ",[doctorName]"
                         + ",[doctorPhone]"
                         + ",[patientName]"
                         + ",[patientAge]"
                         + ",[patientGender]"
                         + ",[patientCode]"
                         + ",[patientPhone]"
                         + ",[patientAddress]"
                         + ",[reason]"
                         + ",[suggest]"
                         + ",[imagePath1]"
                         + ",[imagePath2]"
                         + ",[templateID]"
                         + ",[dayCreate])"
                         + " VALUES "
                         + "(N'" + note.NoteName + "'"
                         + ",N'" + note.ClinicName + "'"
                         + ",N'" + note.ClinicAddress + "'"
                         + ",N'" + note.DoctorName + "'"
                         + ",'" + note.DoctorPhone + "'"
                         + ",N'" + note.PatientName + "'"
                         + "," + note.PatientAge
                         + "," + note.PatientGender
                         + ",N'" + note.PatientCode + "'"
                         + ",'" + note.PatientPhone + "'"
                         + ",N'" + note.PatientAddress + "'"
                         + ",N'" + note.Reason + "'"
                         + ",N'" + note.Suggest + "'"
                         + ",N'" + note.ImagePath1 + "'"
                         + ",N'" + note.ImagePath2 + "'"
                         + "," + note.TemplateID
                         + ",'" + Convert.ToDateTime(note.DayCreate) + "')";

            SqlExtend.ExecuteNonQuery(Data.ConnectionString, CommandType.Text, sql);
        }
コード例 #11
0
        public List <TEntity> ToList <TEntity>(ISqlParam sqlParam) where TEntity : class, new()
        {
            var param = sqlParam.Param?.ToArray();

            return(SqlExtend.ToList <TEntity>(DataBase.GetReader(CommandType.Text, sqlParam.Sql.ToString(), param)));
        }
コード例 #12
0
        /// <summary>
        ///     返回返回泛型集合
        /// </summary>
        /// <param name="sqlParam">SQL语句与参数</param>
        public async Task <List <TEntity> > ToListAsync <TEntity>(ISqlParam sqlParam) where TEntity : class, new()
        {
            var param = sqlParam.Param?.ToArray();

            return(SqlExtend.ToList <TEntity>(await DataBase.GetReaderAsync(CommandType.Text, sqlParam.Sql.ToString(), param)));
        }
コード例 #13
0
 //search notes
 public DataTable SearchNotes(string sql)
 {
     return(SqlExtend.ExecuteDataTable(Data.ConnectionString, CommandType.Text, sql));
 }
コード例 #14
0
 public DataTable GetDataTable(string Sql)
 {
     return(SqlExtend.ExecuteDataTable(Data.ConnectionString, CommandType.Text, Sql));
 }