示例#1
0
        public bool updateData(muser k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "UPDATE tblmuser SET NAME=@NAME,PASSWORD=@PASSWORD,GDIV=@GDIV,LOCATIONID=@LOCATIONID, " +
                                       "EMAIL=@EMAIL,PHONE=@PHONE,TTD=@TTD,PATH=@PATH,ADDRESS=@ADDRESS,ACTIVE=@ACTIVE " +
                                       "WHERE USERID=@USERID";
                strQuery.Parameters.AddWithValue("@USERID", k.USERID);
                strQuery.Parameters.AddWithValue("@NAME", k.NAME);
                strQuery.Parameters.AddWithValue("@PASSWORD", k.PASSWORD);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@LOCATIONID", k.LOCATIONID);
                strQuery.Parameters.AddWithValue("@EMAIL", k.EMAIL);
                strQuery.Parameters.AddWithValue("@PHONE", k.PHONE);
                strQuery.Parameters.AddWithValue("@TTD", k.TTD);
                strQuery.Parameters.AddWithValue("@PATH", k.PATH);
                strQuery.Parameters.AddWithValue("@ADDRESS", k.ADDRESS);
                strQuery.Parameters.AddWithValue("@ACTIVE", k.ACTIVE);
                strQuery.ExecuteNonQuery();
                ConnG.Putus();
                stat = true;
            }
            catch
            {
            }
            return(stat);
        }
示例#2
0
        //------------------CRUD
        public bool insertData(muser k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "INSERT INTO tblmuser(USERID,NAME,PASSWORD,GDIV,LOCATIONID,EMAIL,PHONE,TTD,PATH,ADDRESS,ACTIVE) " +
                                       " VALUES (@USERID,@NAME,@PASSWORD,@GDIV,@LOCATIONID,@EMAIL,@PHONE,@TTD,@PATH,@ADDRESS,@ACTIVE)";
                strQuery.Parameters.AddWithValue("@USERID", k.USERID);
                strQuery.Parameters.AddWithValue("@NAME", k.NAME);
                strQuery.Parameters.AddWithValue("@PASSWORD", k.PASSWORD);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@LOCATIONID", k.LOCATIONID);
                strQuery.Parameters.AddWithValue("@EMAIL", k.EMAIL);
                strQuery.Parameters.AddWithValue("@PHONE", k.PHONE);
                strQuery.Parameters.AddWithValue("@TTD", k.TTD);
                strQuery.Parameters.AddWithValue("@PATH", k.PATH);
                strQuery.Parameters.AddWithValue("@ADDRESS", k.ADDRESS);
                strQuery.Parameters.AddWithValue("@ACTIVE", k.ACTIVE);


                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }