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


C# ClassConnectDB.UpdateValue方法代码示例

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


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

示例1: updateChangeNewsPasswordPage

        public static bool updateChangeNewsPasswordPage(string userID, string newPassword)
        {
            try
            {
                string sqlupdate = " UPDATE Employee SET [email protected] WHERE [email protected]";
                string Addvalue = "@pass,@id";
                string value = newPassword+","+userID;

                ClassConnectDB conn = new ClassConnectDB();
                conn.UpdateValue(sqlupdate, Addvalue, value);
                conn.Close();
                return true;

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

示例2: showStudentSendHomeWork

//        public static DataTable showStudentSendHomeWork(string detailTeachid, string numhomework)
//        {
//            try
//            {
//                ClassConnectDB conn = new ClassConnectDB();
//                string sql = @"SELECT     Student.Std_FName, Student.Std_LName, edu.EduStdLevel, dedu.DeEduStdClass,
//                        Homework.Homework_Num, Homework.Homework_Path,   
//                        CONVERT(VARCHAR(11),Homework.Update_date, 106) 
//                        , CONVERT(VARCHAR(8),Homework.Update_date, 108)
//                        FROM    EnrollIn INNER JOIN
//                      Homework ON EnrollIn.Enroll_ID = Homework.Enroll_ID INNER JOIN
//                      Student ON EnrollIn.Std_Campus_Code = Student.Std_Campus_Code INNER JOIN
//                      DetailEducationOfStudent dedu ON EnrollIn.DeEduStd = dedu.DeEduStd INNER JOIN
//                      EducationOfStudents edu ON dedu.EduStdID=edu.EduStdID 
//                      Where (Homework.Homework_Num='" + numhomework + "') AND  ( edu.EduStdID  = '" + detailTeachid + "') ";

//                SqlDataReader drr = conn.SelectSqlDataReader(sql);
//                DataTable dt = new DataTable();
//                dt.Load(drr);

//                return dt;

//            }
//            catch (Exception)
//            {
//                return null;
//            }
//        }

        public static bool showStudentSendHomeWork(string homeworkid, string enroolid, string path)
        {

            try
            {
                string sqlupdate = "UPDATE Homework SET   Update_date =getdate(), Homework_Status ='Y', Homework_Path [email protected]  WHERE [email protected]";
                string addvalue = "@path,@hwid";
                string value = path + "," + homeworkid;

                ClassConnectDB conn = new ClassConnectDB();
                bool update = conn.UpdateValue(sqlupdate, addvalue, value);
                conn.Close();
                if (update)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:AppCPC,项目名称:WebComSci,代码行数:55,代码来源:ClassRoom.cs

示例3: updateSubjectPage

        public static bool updateSubjectPage(Entity.CurriculumInfo subject)
        {
            try
            {
                string code = subject.StructSub_Code;
                string nameTha = subject.StructSub_NameTha;
                string nameEn = subject.StructSub_NameEn;
                string detail = subject.StructSub_Detail;
                string credit = subject.StructSub_Credit;

                string sql = @"UPDATE    StructSubject 
                    SET  StructSub_NameTha [email protected], StructSub_NameEn [email protected], StructSub_Detail [email protected], StructSub_Credit [email protected]
                    Where   StructSub_Code [email protected] ";
                string Addvalue = "@nametha,@nameEn,@nameDe,@nameCre,@code";
                string value = nameTha + "," + nameEn + "," + detail + "," + credit + "," + code;

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

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

示例4: updateTeacher

        public static bool updateTeacher(Entity.Teacher tch)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();

                string id = tch.Tch_ID.ToString();
                string fname = tch.Tch_FName.ToString();
                string fnameEn = tch.Tch_FNameEn.ToString();
                string lname = tch.Tch_LName.ToString();
                string lnameEn = tch.Tch_LNameEn.ToString();
                string nickname = tch.Tch_Nickname.ToString();
                string sex = tch.Tch_Sex.ToString();
               // string birth = tch.Tch_Birth.ToString();
                string address = tch.Tch_Address.ToString();
                string tel = tch.Tch_Tel.ToString();
                string type = tch.Tch_Type.ToString();
                string email = tch.Tch_email.ToString();
                string username = tch.Tch_username.ToString();
                string password = tch.Tch_password.ToString();
                string picturepath = tch.Tch_picturepath.ToString();
                string typeTch = tch.Tch_TypeInSch.ToString();

                string sqlupdate = "";
                string Adddvalue = "";
                string value = "";
                if (username == "1")
                {
                    //************************ ไมอัพเดท username password
                    sqlupdate = @"UPDATE  Teacher SET Tch_FName [email protected], Tch_LName [email protected], Tch_FNameEn [email protected], Tch_LNameEn [email protected], Tch_Nickname [email protected], Tch_Sex [email protected], Tch_Address [email protected], Tch_Tel [email protected], Tch_Type [email protected], Tch_email [email protected], 
                      [email protected] ,[email protected] where [email protected]";

                    Adddvalue = "@fname,@lname,@fnameEn,@lnameEn,@nickName,@sex,@address,@tel,@type,@email,@id,@pic,@tchtype";
                    value = fname + "," + lname + "," + fnameEn + "," + lnameEn + "," + nickname + "," + sex + "," + address + "," + tel + "," + type + "," + email + ","+ id + "," + picturepath+","+typeTch;
                }
                else
                {
                     sqlupdate = @"UPDATE  Teacher SET Tch_FName [email protected], Tch_LName [email protected], Tch_FNameEn [email protected], Tch_LNameEn [email protected], Tch_Nickname [email protected], Tch_Sex [email protected], Tch_Address [email protected], Tch_Tel [email protected], Tch_Type [email protected], Tch_email [email protected], 
                      Tch_username [email protected], Tch_password [email protected] , [email protected] ,[email protected] where [email protected]";

                     Adddvalue = "@fname,@lname,@fnameEn,@lnameEn,@nickName,@sex,@address,@tel,@type,@email,@username,@pass,@id,@pic,@tchtype";
                     value = fname + "," + lname + "," + fnameEn + "," + lnameEn + "," + nickname + "," + sex + "," + address + "," + tel + "," + type + "," + email + "," + username + "," + password + "," + id + "," + picturepath+","+typeTch;

                }
                bool update = conn.UpdateValue(sqlupdate, Adddvalue, value);

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

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

示例5: updateChangeNewsPasswordPage

        public static bool updateChangeNewsPasswordPage(string userID, string newPassword)
        {
            try
            {
                string sqlupdate = "UPDATE Student SET  [email protected] Where [email protected]";
                string Addvalue = "@pass,@id";
                string value = newPassword + "," + userID;

                ClassConnectDB conn = new ClassConnectDB();
                conn.UpdateValue(sqlupdate, Addvalue, value);
                conn.Close();
                return true;

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

示例6: updateUserStudent

        public static bool updateUserStudent(Entity.Student student)
        {
            try
            {
                ClassConnectDB conn = new ClassConnectDB();

                string id = student.Std_Campus_Code.ToString();
                string code = student.Std_Campus_Code.ToString();
                string fname = student.Std_FName.ToString();
                string fnameEn = student.Std_FNameEn.ToString();
                string lname = student.Std_LName.ToString();
                string lnameEn = student.Std_LNameEn.ToString();
                string nickname = student.Std_Nickname.ToString();
                string sex = student.Std_Sex.ToString();
                string birth = student.Std_Birth.ToString();
                string address = student.Std_Address.ToString();
                string tel = student.Std_Tel.ToString();
                string type = student.Std_Type.ToString();
                string email = student.Std_email.ToString();
                string username = student.Std_Campus_Code.ToString();
                string password = student.Std_Password.ToString();
                string group = student.Std_Group.ToString();
                string year = student.Std_YearEducate.ToString();
                string picturepath = student.std_picturepath.ToString();

                string sqlupdate = @"UPDATE Student SET [email protected], Std_LName [email protected], Std_FNameEn [email protected], Std_LNameEn [email protected],
                                         Std_Nickname [email protected], Std_Campus_Code [email protected], Std_Sex [email protected], Std_Birth [email protected], Std_Address [email protected], Std_Tel [email protected], Std_Type [email protected], 
                                         Std_YearEducate [email protected], Std_Group [email protected], Std_email [email protected], Std_Username [email protected], Std_Password [email protected] ,[email protected] where [email protected]";

                string Adddvalue = "@name,@lname,@fnameEn,@LnameEn,@nickname,@code,@sex,@birth,@address,@tel,@type,@year,@group,@email,@username,@pass,@picpath,@id";
                string value = fname + "," + lname + "," + fnameEn + "," + lnameEn + "," + nickname + "," + code + "," + sex + "," + birth + "," + address + "," + tel + "," + type + "," + year + "," + group + "," + email + "," + username + "," + password + "," + picturepath + "," + id;

                bool update = conn.UpdateValue(sqlupdate, Adddvalue, value);

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

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


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