public void update_index() { SqlHealper sh = new SqlHealper(); DataTable dt = sh.SelectDataBase("select P_index from tbl_P where P_ID='" + this.ID + "'"); this.index = Convert.ToInt32(dt.Rows[0]["P_index"].ToString()); return; }
public void initial_from_ID(string ID) { SqlHealper sh = new SqlHealper(); DataTable dt = new DataTable(); dt = sh.SelectDataBase("select * from tbl_U where U_ID = '" + ID + "'"); this.index = Convert.ToInt32(dt.Rows[0]["U_index"].ToString()); this.ID = dt.Rows[0]["U_ID"].ToString(); this.Name = dt.Rows[0]["U_Name"].ToString(); this.Pwd = dt.Rows[0]["U_Pwd"].ToString(); this.Role = Convert.ToInt32(dt.Rows[0]["U_Role"].ToString()); this.Limit = Convert.ToInt32(dt.Rows[0]["U_Limit"].ToString()); }
public bool judge() { SqlHealper sh = new SqlHealper(); DataTable dt = new DataTable(); dt = sh.SelectDataBase("select U_pwd from tbl_U where U_ID = '" + this.user + "'"); if (dt.Rows.Count == 0)//if the query is none result { return(false); } string pwd = dt.Rows[0]["U_pwd"].ToString(); if (pwd == this.passwd) { return(true); } else { return(false); } }
public static DataTable search(string field, string key) { SqlHealper sh = new SqlHealper(); return(sh.SelectDataBase("SELECT P_ID as ID, P_Name as Name, P_Sex as Sex, P_Birthday as Birthday, P_Jobday as Jobday, P_Education as education, P_Department as department, P_Duty as duty, P_Jobtype as jobtype FROM tbl_P where " + field + " like '%" + key + "%'")); }
public static DataTable RefreashTable() { SqlHealper sh = new SqlHealper(); return(sh.SelectDataBase("SELECT P_ID as ID, P_Name as Name, P_Sex as Sex, P_Birthday as Birthday, P_Jobday as Jobday, P_Education as education, P_Department as department, P_Duty as duty, P_Jobtype as jobtype FROM tbl_P")); }
private void Form1_Load(object sender, EventArgs e) { SqlHealper sh = new SqlHealper(); this.dataGridView1.DataSource = sh.SelectDataBase("select * from tbl_P"); }
public static DataTable get_user_table() { SqlHealper sh = new SqlHealper(); return(sh.SelectDataBase("select * from tbl_U")); }
public static DataTable search(string field, string key) { SqlHealper sh = new SqlHealper(); return(sh.SelectDataBase("SELECT M_ID as ID, M_Classify as Classify, M_MakePrice as makeprice, M_SellPrice as sellprice, M_Unit as unit, M_Memo as memo FROM tbl_M where " + field + " like '%" + key + "%'")); }
public static DataTable refreash_table() { SqlHealper sh = new SqlHealper(); return(sh.SelectDataBase("select M_ID as ID, M_Classify as classify, M_MakePrice as makePrice, M_SellPrice as sellprice, M_Unit as unit , M_Memo as memo from tbl_M")); }