예제 #1
0
        public void Edit_NormalCase()
        {
            const string url = "https://api.vk.com/method/groups.edit?group_id=103292418&title=Raven&v=5.37&access_token=token";
            const string json =
                @"{
                    'response': 1
                  }";

            var cat = GetMockedGroupCategory(url, json);
            var group = new GroupInfo
            {
                Title = "Raven"
            };
            var groups = cat.Edit(103292418, group);

            groups.ShouldBeTrue();
        }
예제 #2
0
        ///// <summary>
        ///// ���ݰ༶���Ƶõ��༶Id 
        ///// </summary>
        ///// <param name="className"></param>
        ///// <returns></returns>
        //int GetClassIdByClassName(string className)
        //{
        //    SqlParameter param = new SqlParameter("@className", className);
        //    int classId = Convert.ToInt32(SQLHelper.ExecuteScalar(SQLHelper.ConnectionStringSTEduSys,
        //        CommandType.StoredProcedure, "SP_GetClassIdByClassName", param));
        //    return classId;
        //}
        /// <summary>
        /// ���ݰ༶ID�õ��˰����е���
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<GroupInfo> GetAllGroupsByClassID(int id)
        {
            SqlParameter param = new SqlParameter("@classID", id);
            List<GroupInfo> result = new List<GroupInfo>();

            using (SqlDataReader dr = SQLHelper.ExecuteReader(SQLHelper.ConnectionStringSTEduSys,
                CommandType.StoredProcedure, "SP_GetAllGroupsByClassID", param))
            {
                while (dr.Read())
                {
                    GroupInfo a = new GroupInfo();
                    a.IClassID = Convert.ToInt32(dr["classID"]);
                    a.IGroupId = Convert.ToInt32(dr["ID"]);
                    a.StrGroupNO = dr["groupNO"].ToString();
                    result.Add(a);
                }
            }
            return result;
        }
예제 #3
0
 public bool Edit(ulong groupId, GroupInfo groupInfo)
 {
     var parameters = new VkParameters
     {
         {"group_id", groupId},
         {"title", groupInfo.Title},
         {"description", groupInfo.Description},
         {"address", groupInfo.Address},
         {"place", groupInfo.Place},
         {"wall", groupInfo.Wall},
         {"photos", groupInfo.Photos},
         {"video", groupInfo.Video},
         {"audio", groupInfo.Audio},
         {"docs", groupInfo.Docs},
         {"topics", groupInfo.Topics},
         {"wiki", groupInfo.Wiki},
         {"access", groupInfo.Access},
         {"subject", groupInfo.Subject},
         {"website", groupInfo.Website},
         {"contacts", groupInfo.Contacts},
         {"places", groupInfo.Places},
         {"events", groupInfo.Events},
         {"links", groupInfo.Links},
         {"public_date", groupInfo.PublicDate},
         {"public_subcategory", groupInfo.PublicSubcategory},
         {"public_category", groupInfo.PublicCategory},
         {"event_group_id", groupInfo.EventGroupId},
         {"event_finish_date", groupInfo.EventFinishDate},
         {"event_start_date", groupInfo.EventStartDate},
         {"rss", groupInfo.Rss},
         {"phone", groupInfo.Phone},
         {"email", groupInfo.Email},
         {"screen_name", groupInfo.ScreenName}
     };
     return _vk.Call("groups.edit", parameters);
 }