public void DeleteEmployee(string userId) { Hashtable user = new Hashtable(); user["id"] = userId; DBUtil.Execute("delete from t_employee where id = @id", user); }
public string InsertNode(Hashtable n) { string id = (n["id"] == null || n["id"].ToString() == "") ? Guid.NewGuid().ToString() : n["id"].ToString(); n["id"] = id; string sql = "insert into plus_file (id, name, type, size, url, pid, createdate, updatedate, folder, num)" + " values(@id, @name, @type, @size, @url, @pid, @createdate, @updatedate, @folder, @num)"; DBUtil.Execute(sql, n); return(id); }
public void UpdateTreeNode(Hashtable n) { string sql = @" update plus_file set name = @name, type = @type, size = @size, url = @url, pid = @pid, createdate = @createdate, updatedate = @updatedate, folder = @folder, num = @num where id = @id"; DBUtil.Execute(sql, n); }
public void UpdateDepartment(Hashtable d) { Hashtable db_d = GetDepartment(d["id"].ToString()); foreach (DictionaryEntry de in d) { db_d[de.Key] = de.Value; } string sql = @" update t_department set name = @name, manager = @manager, manager_name = @manager_name where id = @id"; DBUtil.Execute(sql, db_d); }
public string InsertEmployee(Hashtable user) { string id = (user["id"] == null || user["id"].ToString() == "") ? Guid.NewGuid().ToString() : user["id"].ToString(); user["id"] = id; if (user["name"] == null) { user["name"] = ""; } if (user["gender"] == null || String.IsNullOrEmpty(user["gender"].ToString())) { user["gender"] = 0; } string sql = "insert into t_employee (id, loginname, name, age, married, gender, birthday, country, city, dept_id, position, createtime, salary, educational, school, email, remarks)" + " values(@id, @loginname, @name, @age, @married, @gender, @birthday, @country, @city, @dept_id, @position, @createtime, @salary, @educational, @school, @email, @remarks)"; DBUtil.Execute(sql, user); return(id); }
public void RemoveNode(Hashtable n) { DBUtil.Execute("delete from plus_file where id = @id", n); }