예제 #1
0
        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;
        }
예제 #2
0
        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());
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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 + "%'"));
        }
예제 #5
0
        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"));
        }
예제 #6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            SqlHealper sh = new SqlHealper();

            this.dataGridView1.DataSource = sh.SelectDataBase("select * from tbl_P");
        }
예제 #7
0
        public static DataTable get_user_table()
        {
            SqlHealper sh = new SqlHealper();

            return(sh.SelectDataBase("select * from tbl_U"));
        }
예제 #8
0
        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 + "%'"));
        }
예제 #9
0
        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"));
        }