Пример #1
0
        public static bool deleteHomeWorkByTeacher(string num, string tchid)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();
                string sql = "DELETE FROM Homework Where (Homework_Num=@num) AND  (Tch_Create=@tchid)";
                string addvalue = "@num,@tchid";
                string value = num + "," + tchid;
                bool delete = conn.DeleteValue(sql, addvalue, value);
                if (delete) { return true; }
                else { return false; }

            }
            catch (Exception)
            {
                return false;
            }
        }
Пример #2
0
        public static bool deleteStudentInclass(string id, string dchID)
        {

            try
            {
                ClassConnectDB conn = new ClassConnectDB();

                string sqlcheckEnrollInCheckname = @"SELECT  CheckName.CheckName_ID  FROM  CheckName INNER JOIN
                      EnrollIn ON CheckName.Enroll_ID = EnrollIn.Enroll_ID WHERE(EnrollIn.DetailTech_ID = '" + dchID + "') AND (EnrollIn.Std_Campus_Code = '" + id + "')";

                SqlDataReader drrcheckNameinroll = conn.SelectSqlDataReader(sqlcheckEnrollInCheckname);
                if (drrcheckNameinroll.HasRows)
                {

                    string deleteCheckName = @"DELETE FROM CheckName WHERE CheckName_ID  in ( SELECT  CheckName.CheckName_ID  FROM  CheckName INNER JOIN
                      EnrollIn ON CheckName.Enroll_ID = EnrollIn.Enroll_ID WHERE(EnrollIn.DetailTech_ID = @deid) AND (EnrollIn.Std_Campus_Code = @id))";
                    string addvalueDelete = "@deid,@id";
                    string valuedelete = dchID + "," + id;
                    conn.DeleteValue(deleteCheckName, addvalueDelete, valuedelete);

                    string sqlinsert = "DELETE FROM EnrollIn WHERE Std_Campus_Code=@id AND  DetailTech_ID=@dchID";
                    string addvalue = "@id,@dchID";
                    string value = id + "," + dchID;
                    conn.InsertValue(sqlinsert, addvalue, value);

                }
                conn.Close();
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
Пример #3
0
        public static bool deleteFileMedia(string id)
        {
            string sql = "DELETE FROM InstructionMedia Where  InstMedia_ID=@id";
            string Addvalue = "@id";
            string value = id;
            ClassConnectDB conn = new ClassConnectDB();
            return conn.DeleteValue(sql, Addvalue, value);

        }
Пример #4
0
        public static bool delectClassRoom(string ClassRoomID)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();
                string delete = "DELETE FROM ClassRoom WHERE ClassRoom_ID=@classid";
                string Addvalue = "@classid";
                string value = ClassRoomID;

                bool checkdel = conn.DeleteValue(delete, Addvalue, value);
                if (checkdel)
                {
                    return true;
                }
                return false;

            }
            catch (Exception)
            {
                return false;
            }

        }
Пример #5
0
        public static bool deleteDeatilTeach(string detailID)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();
                string delClassroom = "";

                string check = "select count( ClassRoom_ID ) as countRoom  FROM DetailTech Where ( ShowPlan_ID in ( select ShowPlan_ID From DetailTech Where DetailTech_ID = (" + detailID + "))  and Tch_ID = ( select Tch_ID From DetailTech Where DetailTech_ID in (" + detailID + ")))";
                SqlDataReader dr = conn.SelectSqlDataReader(check); ;
                int count = 0;
                while (dr.Read())
                {
                    count = Convert.ToInt32(dr["countRoom"].ToString());
                }


                string selectClassRoom_ID = "select  distinct ClassRoom_ID as id  FROM DetailTech Where ShowPlan_ID in ( select ShowPlan_ID From DetailTech Where DetailTech_ID in (" + detailID + "))";
                SqlDataReader ddr = conn.SelectSqlDataReader(selectClassRoom_ID);
                while (ddr.Read())
                {
                    delClassroom = ddr["id"].ToString();
                }


                string sql = "DELETE FROM DetailTech Where  DetailTech_ID=@id";
                string Addvalue = "@id";
                string value = detailID;
                bool del = conn.DeleteValue(sql, Addvalue, value);

                if (count == 1)
                {
                    delectClassRoom(delClassroom);
                }



                conn.Close();
                return true;
            }

            catch (Exception)
            {
                return false;
            }
        }
Пример #6
0
        public static bool deleteInManageCurriculumPage(string year)
        {

            try
            {
                string sql = "DELETE FROM Curriculum Where  Curri_Year = @year";
                string Addvalue = "@year";
                string value = year;

                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sql, Addvalue, value);
                return true;
            }
            catch (Exception)
            {
                return false;

            }
            
        }
Пример #7
0
        public static bool confirmSaveInAddCurriculum()
        {
            try
            {
                string checkID = " SELECT Curri_Id FROM Curriculum WHERE Curri_Year='' OR Curri_Course='' OR Curri_Group='' ";

                ClassConnectDB conn = new ClassConnectDB();
                SqlDataReader readID = conn.SelectSqlDataReader(checkID);

                while (readID.Read()) {
                    string id = readID["Curri_Id"].ToString();
                    string delete = "DELETE FROM Curriculum WHERE Curri_Id=@id";
                    string Addvalue = "@id";
                    string value = id;
                     conn.DeleteValue(delete,Addvalue,value);
                }

                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }
Пример #8
0
        public static bool deletePlanEducate(string planid)
        {

            try
            {
                string sql = "DELETE FROM ShowPlanEducate Where  ShowPlan_Id = @id";
                string Addvalue = "@id";
                string value = planid;

                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sql, Addvalue, value);
                return true;
            }
            catch (Exception)
            {
                return false;

            }
            

        }
Пример #9
0
        public static bool deleteSubjectFollowSubject(string code,string codePass)
        {
            try
            {
                string sql = "DELETE FROM FollowSubject Where  StructSub_Code = @code AND StructSub_CodePass=@codepass";
                string Addvalue = "@code,@codepass";
                string value = code+","+codePass;

                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sql, Addvalue, value);
                return true;
            }
            catch (Exception)
            {
                return false;

            }
        }
Пример #10
0
        public static bool deleteSubject(string code)
        {
            try
            {
                string sql = "DELETE FROM StructSubject Where  StructSub_Code = @code";
                string Addvalue = "@code";
                string value = code;

                string sqlDeleteFollowsubject = "DELETE FROM FollowSubject where StructSub_Code = @code";
                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sql,Addvalue,value);

                conn.DeleteValue(sqlDeleteFollowsubject,Addvalue,value);

                return true;
            }
            catch (Exception)
            {
                return false;
               
            }
        }
Пример #11
0
        public static bool deleteUserDelete(string id)
        {
            try
            {
                string sqldelete = "DELETE FROM Teacher Where Tch_ID=@id ";
                string Addvalue = "@id";
                string value = id;

                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sqldelete, Addvalue, value);
                conn.Close();
                return true;
            }
            catch (Exception)
            {
                return false;
            }

        }
Пример #12
0
        public static bool deleteUserStudent(string id)
        {
            try
            {
                string sqldelete = "DELETE FROM Student Where Std_Campus_Code=@id ";
                string Addvalue = "@id";
                string value = id;

                ClassConnectDB conn = new ClassConnectDB();
                conn.DeleteValue(sqldelete, Addvalue, value);
                conn.Close();
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }