示例#1
0
文件: Perfil.aspx.cs 项目: Dyox/LAPRV
    protected void Button5_Click(object sender, EventArgs e)
    {
        string tag = TextTag.Text;
            if (tag != "")
            {
                bool existe = Rede.Tag.ExisteTag(tag);

                if (existe == false)
                {
                    Rede.Tag t = new Rede.Tag(tag);
                    t.Save();

                }

                Rede.Tag t2 = Rede.Tag.LoadByName(tag);
                MembershipUser currentLoggedInUser = Membership.GetUser();
                string id = Convert.ToString(currentLoggedInUser.ProviderUserKey);
                Rede.Perfil p = Rede.Perfil.LoadByUserId(id);
                Rede.Tag.insereRelacao(p.ID, t2.ID);
                DropDownList2.DataBind();

            }
    }
示例#2
0
文件: Tag.cs 项目: Dyox/LAPRV
        public static IList LoadAll()
        {
            try
            {
                DataSet ds = ExecuteQuery(GetConnection(false), "SELECT * from TTag");

                IList ret = new ArrayList();

                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    Tag av = new Tag(r);
                    ret.Add(av);

                    //apagar
                    // save in registry
                    //loaded[p.ID] = p;
                }

                return ret;
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Erro BD", ex);
            }
        }
示例#3
0
文件: Tag.cs 项目: Dyox/LAPRV
        public static Tag LoadByName(string tipo)
        {
            DataSet ds = ExecuteQuery("SELECT * FROM TTag WHERE Designacao='" + tipo + "'");
            Tag av = new Tag(ds.Tables[0].Rows[0]);

            return av;
        }
示例#4
0
文件: Tag.cs 项目: Dyox/LAPRV
        public static List<string> TagUser()
        {
            List<string> lst = new List<string>();
            int aux=0;
            try
            {
                DataSet ds = ExecuteQuery(GetConnection(false), "SELECT * from TTag");

                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    Tag av = new Tag(r);
                    aux = getOcurrencias(av.ID);
                    while(aux!=0){

                    lst.Add(av.Designacao);
                    aux--;
                    }

                }

            }
            catch (Exception ex)
            {
                throw new ApplicationException("Erro BD", ex);
            }
            return lst;
        }
示例#5
0
文件: Tag.cs 项目: Dyox/LAPRV
        public static Tag LoadById(int ID)
        {
            DataSet ds = ExecuteQuery("SELECT * FROM TTag WHERE TagID=" + ID);
            Tag t = new Tag(ds.Tables[0].Rows[0]);

            return t;
        }