ExecuteNonQuery() public method

public ExecuteNonQuery ( String commStr ) : bool
commStr String
return bool
コード例 #1
0
ファイル: Topic.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool DeleteTopic(int TopicId)
 {
     String commStr = "delete from Topic where id = "+TopicId;
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #2
0
ファイル: Topic.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool ModifyMessage(int TopicId, String key, String values)
 {
     String commStr = "update Topic set " + key + " = '" + values + "' where id = " + TopicId;
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #3
0
ファイル: Users.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool ModifyMessage(String UserName,String key,String values)
 {
     String commStr = "update Users set " + key + " = '" + values + "' where UserName = '******'";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #4
0
ファイル: Answer.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool DeleteAnswer(int id)
 {
     String commStr = "delete from Answer where id = " + id;
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #5
0
ファイル: Users.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool DeleteFocusPart(String UserName, String Part)
 {
     String commStr = "update Users set FocusPart = '" + GetMessage(UserName, "FocusPart").Replace(Part+",","") + "' where UserName = '******'";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #6
0
ファイル: Users.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool AddPoint(String UserName, int Point)
 {
     String commStr = "update Users set AccumulatePoint = " + (int.Parse(GetMessage(UserName, "AccumulatePoint"))+Point) + " where UserName = '******'";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #7
0
ファイル: Answer.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool CancelRecommandAnswer(int id)
 {
     String commStr = "update Answer set Recommand = 0 where id = " + id;
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #8
0
ファイル: Topic.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static int PostTopic(String Author,String Title,String Part,String Text)
 {
     String commStr1 = "select max(id) as lastId from Topic";
     SQL sql = new SQL();
     SqlDataReader r = sql.ExecuteReader(commStr1);
     int id = 0;
     if(r.Read())
         id = int.Parse(r[0].ToString())+1;
     r.Close();
     String date = DateTime.Now.ToShortDateString();
     String commStr2 = "insert into Topic values (" + id + ",'" + Author + "','" + date + "','"+ Title + "','" + Part + "','" + Text + "')";
     sql.ExecuteNonQuery(commStr2);
     sql.Dispose();
     return id;
 }
コード例 #9
0
ファイル: Topic.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool PostTopic(String Author,String Title,String Part,String Text)
 {
     String commStr = "insert into Topic (Author,Date,Title,Part,Text) values ('" + Author + "',getdate(),'"+ Title + "','" + Part + "','" + Text + "')";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #10
0
ファイル: Users.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool Register(String UserName,String Password)
 {
     String commStr = "insert into Users values ('" + UserName + "','" + Password + "','','','',0,'')";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }
コード例 #11
0
ファイル: Answer.cs プロジェクト: HIT-MSTC/HelperOfHiters
 public static bool PostAnswer(int TopicId,String Author,String Text)
 {
     String commStr = "insert into Answer(TopicId,Author,Date,Text) values (" + TopicId + ",'" + Author + "',getdate(),'" + Text + "')";
     SQL sql = new SQL();
     bool f = sql.ExecuteNonQuery(commStr);
     sql.Dispose();
     return f;
 }