public static void insertPwd(string usr, string pwd) { usr = usr.Replace("'", "__").Replace("◇", "'"); pwd = pwd.Replace("'", "__").Replace("◇", "'"); string sql = "insert into log([user], [pwd], [time]) values('" + usr + "','" + pwd + "',#" + DateTime.Now.ToString() + "#)"; if (YctOrm.exeSql(sql) > 0) { Const.info = "新增用户成功"; } else { Const.info = "新增用户失败"; } }
public static void updatePwd(string usr, string pwd) { usr = usr.Replace("'", "__").Replace("◇", "'"); pwd = pwd.Replace("'", "__").Replace("◇", "'"); string sql = "update log set [pwd] = '" + pwd + "', [time] = #" + DateTime.Now.ToString() + "# where [user] = '" + usr + "'"; if (YctOrm.exeSql(sql) > 0) { Const.info = "修改密码成功"; } else { Const.info = "修改密码失败"; } }
private void delToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("删除后不可恢复,确定删除?", "删除提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { YctMode mode = getModeFromNowRow(); if (mode == null) { MessageBox.Show("请选中一行进行删除操作。"); return; } string sql = "delete * from yct where id = " + mode.id; YctOrm.exeSql(sql); showStatus(Const.info); } }