public string Login(dynamic obj) { string userinfo = Convert.ToString(obj.usr); string pwd = Convert.ToString(obj.pwd); return(DbOp.Login(userinfo, pwd)); }
SQLiteDataAdapter DBInsert(DbOp op, string query, SQLiteConnection connection) { return(new SQLiteDataAdapter() { InsertCommand = new SQLiteCommand(query, connection) }); }
public override OleDbDataAdapter AdapterUpdate(DbOp op, string query, OleDbConnection connection) { OleDbDataAdapter A = new OleDbDataAdapter(query, connection); A.UpdateCommand = new OleDbCommand(query, connection); return(A); }
private string AddDbOp(Article article, DbOpType opType) { string db_file_path = DbFilePath; article.Html = null; string opId = Guid.NewGuid().ToString(); var op = new DbOp { Id = opId, Op = opType, }; switch (opType) { case DbOpType.Add: op.Article = article; break; case DbOpType.Delete: op.ArticleId = article.Id; break; default: break; } using (TextWriter writer = new StreamWriter(new FileStream(db_file_path, FileMode.Append, FileAccess.Write))) { writer.WriteLine(JsonConvert.SerializeObject(op)); } return(op.Id); }
public override OleDbDataAdapter AdapterInsert(DbOp op, string query, OleDbConnection connection) { OleDbDataAdapter A = new OleDbDataAdapter(null, connection); A.InsertCommand = new OleDbCommand(query, connection); return(A); }
public override SqlDataAdapter AdapterUpdate(DbOp op, string query, SqlConnection connection) { SqlDataAdapter A = new SqlDataAdapter(); A.UpdateCommand = new SqlCommand(query, connection); return(A); }
public JArray ListUsre(int st, int pz) { if (pz > 100) { pz = 100; } return(DbOp.GetUserByAddTime(st, pz)); }
/// <summary> /// This method is responsible for Parameterizing the Command. /// </summary> /// <param name="op"></param> /// <param name="query"></param> /// <param name="connection"></param> /// <returns></returns> public virtual TAdapter AdapterUpdate(DbOp op, string query, TConnection connection) { if (this.AdapterUpdateAction != null) { return(this.AdapterUpdateAction.Invoke(op, query, connection)); } return((TAdapter)null); }
public string Register(dynamic obj) { string usn = Convert.ToString(obj.usn); string pwd = Convert.ToString(obj.pwd); string email = Convert.ToString(obj.email); string regip = Convert.ToString(obj.regip); return(DbOp.RegUser(usn, pwd, email, regip)); }
public SQLiteDataAdapter AdapterUpdate(DbOp op, string Query, SQLiteConnection c) { SQLiteDataAdapter a = new SQLiteDataAdapter(); // a.SelectCommand = new SQLiteCommand("SELECT 'return something so we don''t have an empty table.' [result];",c); a.UpdateCommand = new SQLiteCommand(Query, c); this.ParameterizeUpdate(a.UpdateCommand); return(a); }
virtual public TAdapter DefaultSelectAdapter(DbOp op, string query, TConnection connection) { return(new TAdapter() { SelectCommand = new TCommand() { CommandText = query, Connection = connection } }); }
public override SQLiteDataAdapter SelectCategoryAdapter(DbOp op, string query, SQLiteConnection connection) { return(new SQLiteDataAdapter(query, connection)); }
/// <inheritdoc/> public override SQLiteDataAdapter AdapterUpdate(DbOp op, string query, SQLiteConnection connection) { SQLiteDataAdapter A = new SQLiteDataAdapter(null, connection); A.UpdateCommand = new SQLiteCommand(query, connection); return(A); }
public override OleDbDataAdapter SelectCategoryAdapter(DbOp op, string query, OleDbConnection connection) { return(new OleDbDataAdapter(query, connection)); }
public abstract TAdapter SelectCategoryAdapter(DbOp op, string query, TConnection connection);
public override SqlDataAdapter UpdateCategoryAdapter(DbOp op, string query, SqlConnection connection) { return(new SqlDataAdapter(query, connection)); }
public override SqlDataAdapter AdapterSelect(DbOp op, string query, SqlConnection connection) { return(new SqlDataAdapter(query, connection)); }
public bool DelUser(Guid iduser) { return(DbOp.DeleteUser(iduser)); }
/// <summary> /// Callback: Retrieves the DataAdapter for the respective call. /// </summary> /// <param name="o"></param> /// <param name="query"></param> /// <param name="C"></param> /// <returns></returns> static SQLiteDataAdapter SelectTemplatesAdapter(DbOp o, string query, SQLiteConnection C) { return(new SQLiteDataAdapter(query, C)); }