当前位置: 首页>>代码示例>>C#>>正文


C# ClassConnectDB.QueryExecuteNonQuery方法代码示例

本文整理汇总了C#中DAL.ClassConnectDB.QueryExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# ClassConnectDB.QueryExecuteNonQuery方法的具体用法?C# ClassConnectDB.QueryExecuteNonQuery怎么用?C# ClassConnectDB.QueryExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DAL.ClassConnectDB的用法示例。


在下文中一共展示了ClassConnectDB.QueryExecuteNonQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: deleteDetailTeach

 public static bool deleteDetailTeach(string dchID)
 {
     ClassConnectDB conn = new ClassConnectDB();
     string sql = "DELETE FROM DetailTech WHERE DetailTech_ID='" + dchID + "'";
     bool del = conn.QueryExecuteNonQuery(sql);
     conn.Close();
     return del;
 }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:8,代码来源:DetailTeach.cs

示例2: checkRoleLogin

        public static Entity.Student checkRoleLogin(string username, string password)
        {
            try
            {
                Entity.Student stdlog = new Entity.Student();

                string sqlchekRole = " SELECT * FROM Student WHERE (Std_Username = @user) AND (Std_Password = @pass)";
                string Addvalue = "@user,@pass";
                string value = username + "," + password;

                ClassConnectDB conn = new ClassConnectDB();
                SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
                if (readCheckRole.Read())
                {

                    stdlog.Std_Type = readCheckRole["Std_Type"].ToString();
                    stdlog.Std_FName = readCheckRole["Std_FName"].ToString();
                    stdlog.Std_LName = readCheckRole["Std_LName"].ToString();
                    stdlog.Std_Campus_Code = readCheckRole["Std_Campus_Code"].ToString();
                    stdlog.Std_YearEducate = readCheckRole["Std_YearEducate"].ToString();
                    stdlog.Std_Username = readCheckRole["Std_Username"].ToString();
                    stdlog.Std_Password = readCheckRole["Std_Password"].ToString();
                    stdlog.std_picturepath = readCheckRole["Std_picturepath"].ToString();
                }

                string iplog = Common.network.showIp();
                string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
                string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
                string tid = readCheckRole["Std_Campus_Code"].ToString();
                string insertLog = "INSERT INTO LogLogInStd(Log_IP, Log_Date, Log_timeStart, Std_Campus_Code) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
                conn.QueryExecuteNonQuery(insertLog);


                conn.Close();
                return stdlog;


            }
            catch (Exception)
            {

                return null;
            }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:44,代码来源:Student.cs

示例3: checkRoleLogin

        public static Entity.Teacher checkRoleLogin(string username, string password)
        {
            Entity.Teacher tch = new Entity.Teacher();
            try
            {
                string sqlchekRole = "  SELECT * FROM Teacher WHERE   [email protected] AND [email protected]";
                string Addvalue = "@user,@pass";
                string value = username + "," + password;

                ClassConnectDB conn = new ClassConnectDB();
                SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
                if (readCheckRole.Read())
                {
                    tch.Tch_ID = readCheckRole["Tch_ID"].ToString();
                    tch.Tch_Type = readCheckRole["Tch_Type"].ToString();
                    tch.Tch_FName = readCheckRole["Tch_FName"].ToString();
                    tch.Tch_LName = readCheckRole["Tch_LName"].ToString();
                    tch.Tch_username = readCheckRole["Tch_username"].ToString();
                    tch.Tch_password = readCheckRole["Tch_password"].ToString();
                    tch.Tch_picturepath = readCheckRole["Tch_picturepath"].ToString();

                }

                string iplog = Common.network.showIp();
                string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
                string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
                string tid = readCheckRole["Tch_ID"].ToString();
                string insertLog = "INSERT INTO LogLoginTeach(Log_IP, Log_Date, Log_timeStart, Tch_ID) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
                conn.QueryExecuteNonQuery(insertLog);
                conn.Close();

                return tch;



            }
            catch (Exception)
            {

                return null;
            }

        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:43,代码来源:Teacher.cs

示例4: checkRoleLogin

        public static Entity.Employee checkRoleLogin(string username, string password)
        {

            try
            {
                Entity.Employee emp = new Entity.Employee();

                string sqlchekRole = "  SELECT * FROM Employee WHERE [email protected] AND [email protected]";
                string Addvalue = "@user,@pass";
                string value = username + "," + password;

                ClassConnectDB conn = new ClassConnectDB();
                SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
                if (readCheckRole.Read())
                {
                    emp.Emp_ID = readCheckRole["Emp_ID"].ToString();
                    emp.Emp_Type = readCheckRole["Emp_Type"].ToString();
                    emp.Emp_LName = readCheckRole["Emp_LName"].ToString();
                    emp.Emp_FName = readCheckRole["Emp_FName"].ToString();
                    emp.Emp_username=readCheckRole["Emp_username"].ToString();
                    emp.Emp_password = readCheckRole["Emp_password"].ToString();
                }

                string iplog = Common.network.showIp();
                string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
                string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
                string tid = readCheckRole["Emp_ID"].ToString();
                string insertLog = "INSERT INTO LogLoginEmp(Log_IP, Log_Date, Log_timeStart, Emp_id) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
                conn.QueryExecuteNonQuery(insertLog);
             

                conn.Close();
                return emp;


            }
            catch (Exception)
            {

                return null;
            }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:42,代码来源:Employee.cs

示例5: deleteCommentPostInclass

        public static bool deleteCommentPostInclass(string classRoomid)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();



                string deleteCommentsql = "  delete from CommentPostClass where (ComPostClass_ID in (  select ComPostClass_ID  FROM CommentPostClass where ClassRoom_ID='" + classRoomid + "'))";
                conn.QueryExecuteNonQuery(deleteCommentsql);

                string deletePostSql = "delete from PostClassRoom  where ClassRoom_ID = '" + classRoomid + "' ";
                conn.QueryExecuteNonQuery(deletePostSql);

                conn.Close();
                return true;
            }
            catch (Exception) { return false; }


        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:21,代码来源:ClassRoom.cs

示例6: deleteEnroll

 public static bool deleteEnroll(string dchid, string userid)
 {
     ClassConnectDB conn = new ClassConnectDB();
     string sql = " delete  FROM [EnrollIn] where Enroll_ID=(select  max (Enroll_ID) from EnrollIn where DetailTech_ID='" + dchid + "' and Std_Campus_Code='" + userid + "' )";
     bool del = conn.QueryExecuteNonQuery(sql);
     conn.Close();
     return del;
 }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:8,代码来源:DetailTeach.cs

示例7: insertNewSubjectStd

 public static bool insertNewSubjectStd(string year, string yearcurri, string userid)
 {
     string sqlinsert = @"  insert into EducationOfStudents (
                           [EduStdLevel],[EduStdTerm] ,[StructSub_Code],[Create_user],[CreateDate],[EduStdYearEdu],[EduStdYearCurri])
                        SELECT [ShowPlan_Year],[ShowPlan_Semester],[StructSub_Code] ,'" + userid + "' ,GETDATE() ,'" + year + "','" + yearcurri + "'  FROM [WEBCSDB].[dbo].[ShowPlanEducate]  where ShowPlan_YearUpdate='" + yearcurri + "'";
     ClassConnectDB conn = new ClassConnectDB();
     bool insert = conn.QueryExecuteNonQuery(sqlinsert);
     conn.Close();
     return insert;
 }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:10,代码来源:DetailTeach.cs

示例8: deletClassRoom

        public static bool deletClassRoom(string classRoomid)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();

                string deletePostSql = " DELETE FROM  ClassRoom  where ClassRoom_ID = '" + classRoomid + "' ";
                conn.QueryExecuteNonQuery(deletePostSql);

                conn.Close();
                return true;
            }
            catch (Exception) { return false; }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:14,代码来源:ClassRoom.cs

示例9: insertEnroll

 public static bool insertEnroll(string userid, string detailTeach)
 {
     ClassConnectDB conn = new ClassConnectDB();
     string sql = @"INSERT INTO EnrollIn (DetailTech_ID, Std_Campus_Code, Enroll_Status)
                VALUES('" + detailTeach + "','" + userid + "','N')";
     bool inesrt = conn.QueryExecuteNonQuery(sql);
     conn.Close();
     return inesrt;
 }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:9,代码来源:DetailTeach.cs

示例10: updateDetailTeach

        public static bool updateDetailTeach(string tchid, string classid, string dchid, string subcode, string subThai)
        {
            ClassConnectDB conn = new ClassConnectDB();
            string sqlupdateDetailTeach = "UPDATE  DetailTech SET  StructSub_Code='" + subcode + "' where  DetailTech_ID='" + dchid + "' and  Tch_ID='" + tchid + "'";
            bool update = conn.QueryExecuteNonQuery(sqlupdateDetailTeach);

            string sql = "UPDATE    ClassRoom SET ClassRoom_Name='" + subThai + "'  where ClassRoom_ID ='" + classid + "'";
            bool upd = conn.QueryExecuteNonQuery(sql);

            conn.Close();

            return upd;
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:13,代码来源:DetailTeach.cs

示例11: insertDetailTeach

        public static bool insertDetailTeach(string yeare, string level, string term, string group, string subject, string userid, string teacher, string classid)
        {
            /*********************************
          *
          * บันทึกรายละเอียดห้องเรียน
          *
          * *******************************/

            string year = (Convert.ToInt32(yeare) + 543).ToString();

            ClassConnectDB conn = new ClassConnectDB();
            string sql = @"INSERT INTO DetailTech
                      (DetailTech_Level, DetailTech_Class, DetailTeach_Year, DetailTech_Term, Tch_ID, ClassRoom_ID, StructSub_Code, Create_user, CreateDate, DetailTeach_Status)
                        VALUES('" + level + "','" + group + "'," + year + ",'" + term + "','" + teacher + "','" + classid + "','" + subject + "','" + userid + "',getDate(),'A')";

            //string addvalue = "@level,@class,@year,@term,@tchid,@classid,@code,@user,";
            //string value = level + "," + group + "," + year + "," + term  +","+teacher+","+classid+","+subject+ "," + userid;
            // bool insert = conn.InsertValue(sql, addvalue, value);
            bool insert = conn.QueryExecuteNonQuery(sql);
            conn.Close();
            if (insert) { return true; }
            else { return false; }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:23,代码来源:DetailTeach.cs

示例12: apppoveKm

        public static bool apppoveKm(string id)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();
                string sql = "UPDATE KmPost SET KmPost_Status ='Y' WHERE KmPost_ID= '"+id+"'";
                bool del = conn.QueryExecuteNonQuery(sql);
                if (del)
                {
                    return true;
                }
                else return false;

            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:19,代码来源:Knowledge.cs

示例13: insertEnrollStd

        public static void insertEnrollStd(string codeStdRegis, string userid, string year)
        {
            ClassConnectDB conn = new ClassConnectDB();

            /*** SELECT TOP 1000 [DetailTech_ID]
              ,[DetailTech_Level]
              ,[DetailTech_Class]
              ,[DetailTeach_Year]
              ,[DetailTech_Term]
              ,[Tch_ID]
              ,[ClassRoom_ID]
              ,[StructSub_Code]
              ,[Create_user]
              ,[CreateDate]
              ,[DetailTeach_Status]
          FROM [WEBCSDB].[dbo].[DetailTech]
          where [StructSub_Code]='0032001' and [DetailTech_Class]='1' and [DetailTeach_Status]='A'
         *
         * **/
            string selectDchId = "  SELECT  [DetailTech_ID] FROM [DetailTech] where [StructSub_Code]='" + codeStdRegis + "' and [DetailTeach_Status]='A'   and [DetailTech_Class] = (  select [Std_Group] from [Student] where [Std_Campus_Code]='" + userid + "')";
            SqlDataReader drr = conn.SelectSqlDataReader(selectDchId);
            string dchid = "";
            while (drr.Read())
            {
                dchid = drr["DetailTech_ID"].ToString();
            }
            string sql = @"INSERT INTO EnrollIn (DetailTech_ID, Std_Campus_Code, Enroll_Status)
                        VALUES('" + dchid + "','" + userid + "','N')";
            conn.QueryExecuteNonQuery(sql);
            conn.Close();
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:31,代码来源:PlanEducate.cs

示例14: closeComment

 public static bool closeComment(string commentid)
 {
     try
     {
         ClassConnectDB conn = new ClassConnectDB();
         string sql = " delete from KmPost where KmComPost_ID='" + commentid + "'";
         conn.QueryExecuteNonQuery(sql);
         conn.Close();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:15,代码来源:Knowledge.cs

示例15: deleteKm

        public static bool deleteKm(string id)
        {
            try
            {

                ClassConnectDB conn = new ClassConnectDB();
                string sql = " delete   FROM [KmPost] where KmPost_ID='"+id+"'";
                bool insert = conn.QueryExecuteNonQuery(sql);
                conn.Close();
                return insert;
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:16,代码来源:Knowledge.cs


注:本文中的DAL.ClassConnectDB.QueryExecuteNonQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。