public static Tuple <E_DbRState, Exception> Add(C_User user) { string cmd = "insert into grims.user (name,pwd,deptId,tel,email) values('" + user.Name + "'" + ",'" + user.Pwd + "','" + C_DbTabDept.GetIdByName(user.DeptName).Item2 + "','" + user.Tel + "','" + user.Email + "');"; return(C_Db.Exec(cmd)); }
private static void InitDb() { Exec("create database If Not Exists grims Character Set UTF8"); C_DbTabAreaCode.InitTabs(); C_DbTabAdminPwd.InitTabs(); C_DbTabDept.InitTabs(); C_DbTabUser.InitTabs(); C_DbTabWell.InitTabs(); C_DbTabWellPara.InitTabs(); C_DbTabEntWell.InitTabs(); C_DbTabEntWellPara.InitTabs(); }
public static Tuple <E_DbRState, Exception> Change(C_User user) { return(C_Db.Exec("update grims.user set name='" + user.Name + "',pwd='" + user.Pwd + "',deptId='" + C_DbTabDept.GetIdByName(user.DeptName).Item2 + "',tel='" + user.Tel + "',email='" + user.Email + "' where id='" + user.Id + "';")); }