当前位置: 首页>>代码示例>>C#>>正文


C# CY类代码示例

本文整理汇总了C#中CY的典型用法代码示例。如果您正苦于以下问题:C# CY类的具体用法?C# CY怎么用?C# CY使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CY类属于命名空间,在下文中一共展示了CY类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCommentCountByMiniBlogId

        public int GetCommentCountByMiniBlogId(CY.UME.Core.Business.MiniBlog miniBlog)
        {
            int count = 0;

            if (miniBlog == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@MiniBlogId", SqlDbType.BigInt, miniBlog.Id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_MiniBlogComment_SelectCount_By_MiniBlogId");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:28,代码来源:MiniBlogCommentProvider.cs

示例2: GetAllGrade

        //��ѯ�����꼶
        public IList<Core.Business.Grade> GetAllGrade(CY.UME.Core.PagingInfo pagingInfo)
        {
            IList<Core.Business.Grade> gradelist = new List<Core.Business.Grade>();
            SqlServerUtility sql = new SqlServerUtility(SqlConnectionString);

            sql.AddParameter("@PageNumber", SqlDbType.Int, pagingInfo.CurrentPage);
            sql.AddParameter("@PageSize", SqlDbType.Int, pagingInfo.PageSize);

            sql.AddParameter("@Tables", SqlDbType.NVarChar, "Grade");
            sql.AddParameter("@PK", SqlDbType.NVarChar, "Id");
            sql.AddParameter("@Sort", SqlDbType.NVarChar, "Id DESC");
            sql.AddParameter("@Fields", SqlDbType.NVarChar, "[Id], [Year]");
            //sql.AddParameter("@Filter", SqlDbType.NVarChar, "");

            SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Grade grade = new Core.Business.Grade();

                    if (!reader.IsDBNull(0)) grade.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) grade.Year = reader.GetInt32(1);

                    grade.MarkOld();
                    gradelist.Add(grade);
                }
                reader.Close();
            }
            return gradelist;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:33,代码来源:GradeProvider.cs

示例3: ConstructorUnit

 /// <summary>
 ///  构建 Unit
 /// </summary>
 protected string ConstructorUnit(CY.CSTS.Core.Business.UnitSearchJson json, CY.CSTS.Core.Business.PagingInfo pageinfo)
 {
     StringBuilder sbResult = new StringBuilder();
     try
     {
         if (json == null || pageinfo == null)
         {
             throw new Exception("error");
         }
         sbResult.Append("[");
         IEnumerable<CY.CSTS.Core.Business.UnitInfo> units = CY.CSTS.Core.Business.UnitInfo.SelectUnitinfoBySearchConditionPageInfo(json, pageinfo);
         if (units != null)
         {
             foreach (CY.CSTS.Core.Business.UnitInfo unit in units)
             {
                 sbResult.Append("{");
                 sbResult.Append(string.Format("id:'{0}'", CY.Utility.Common.StringUtility.HTMLEncode(unit.Id.ToString())));
                 sbResult.Append(string.Format(",name:'{0}'", CY.Utility.Common.StringUtility.HTMLEncode(unit.UnitName)));
                 sbResult.Append("},");
             }
             if (units.Count() > 0)
             {
                 sbResult.Remove(sbResult.Length - 1, 1);
             }
         }
         sbResult.Append("]");
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return sbResult.ToString();
 }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:36,代码来源:GetUnitList.ashx.cs

示例4: GetAccountRequestList

        /// <summary>
        /// ��ø��û������ĺ�������
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public IList<CY.UME.Core.Business.Friendship> GetAccountRequestList(CY.UME.Core.Business.Account account)
        {
            string sqlstr = "AccountId=" + account.Id;
            IList<Core.Business.Friendship> friendshiplist = new List<Core.Business.Friendship>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            string sqlwhere = "SELECT  * FROM [dbo].[Friendship] where ";
            sqlwhere += sqlstr + " ORDER BY [Id] desc";
            SqlDataReader reader = sql.ExecuteSqlReader(sqlwhere);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Friendship friendship = new Core.Business.Friendship();

                    if (!reader.IsDBNull(0)) friendship.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) friendship.AccountId = reader.GetInt64(1);
                    if (!reader.IsDBNull(2)) friendship.FriendId = reader.GetInt64(2);
                    if (!reader.IsDBNull(3)) friendship.GroupId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) friendship.IsChecked = reader.GetBoolean(4);
                    if (!reader.IsDBNull(5)) friendship.Remark = reader.GetString(5);
                    if (!reader.IsDBNull(6)) friendship.CommunicateNum = reader.GetInt32(6);
                    if (!reader.IsDBNull(7)) friendship.DateCreated = reader.GetDateTime(7);

                    friendship.MarkOld();
                    friendshiplist.Add(friendship);
                }
                reader.Close();
            }
            return friendshiplist;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:37,代码来源:FriendshipProvider.cs

示例5: BindData

        protected void BindData(CY.UME.Core.Business.Activities active)
        {
            CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

            pageInfo.CurrentPage = 1;
            pageInfo.PageSize = 20;

            if (active != null)
            {
                topicList = CY.UME.Core.Business.Topic.GetActiveTopicesByDateCreated(active.Id.ToString(), pageInfo);
            }

            int count = active.GetActiveTopicesNum();

            authorname.Value = "";
            minviewnum.Value = "";
            maxviewnum.Value = "";
            minreplynum.Value = "";
            maxreplynum.Value = "";
            title.Value = "";

            tm_HiddenPageSize.Value = "20";
            tm_HiddenRecordCount.Value = count.ToString();
            tm_HiddenSiteUrl.Value = SiteUrl;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:25,代码来源:TopManage.aspx.cs

示例6: TryGetAccount

        private bool TryGetAccount(long accountId, out CY.UME.Core.Business.Account account)
        {
            account = null;

            if (accountId < 1)
            {
                return false;
            }

            try
            {
                account = CY.UME.Core.Business.Account.Load(accountId);

                if (account != null)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch
            {
                return false;
            }
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:27,代码来源:CreditService.cs

示例7: Initial

        /// <summary>
        /// 
        /// </summary>
        /// <param name="json"></param>
        /// <param name="centers"></param>
        /// <param name="assists"></param>
        protected void Initial(out CY.CSTS.Core.Business.InstrumentStatisticalJson json, out IEnumerable<CY.CSTS.Core.Business.UnitInfo> centers, out IEnumerable<CY.CSTS.Core.Business.UnitInfo> assists)
        {
            try
            {

                centers = CY.CSTS.Core.Business.UnitInfo.SelectUnitInfosByUnitFlag(CY.Utility.Common.CodeInterface.UnitFlag.SubCenter);

                if (centers != null)
                {
                    centers = centers.Where(item => item.AuditingState == CY.Utility.Common.CodeInterface.UnitState.Audited);
                }
                assists = CY.CSTS.Core.Business.UnitInfo.SelectUnitInfosByUnitFlag(CY.Utility.Common.CodeInterface.UnitFlag.AssistUnit);

                if (assists != null)
                {
                    assists = assists.Where(item => item.AuditingState == CY.Utility.Common.CodeInterface.UnitState.Audited);
                }

                json = new CY.CSTS.Core.Business.InstrumentStatisticalJson();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:31,代码来源:InstrumentStatistical.aspx.cs

示例8: AddMessage

        public void AddMessage(String Content, CY.UME.Core.Business.AsynResult asynResult, String accountId)
        {
            //当传入的内容为"-1"时,表示为建立连接请求,即为了维持一个从客户端到服务器的链接而建立的链接(那个等待的链接)
            //此时该链接保存到Ilist<AsynResult> Clients中,等待再有消息发送过来时,该Clients会被遍历,并且会在该消息输出后结束该链接
            if (Content == "-1")
            {
                Clients.Add(asynResult);
            }
            else
            {
                //将当前请求的内容输出到客户端
                asynResult.Content = Content;
                asynResult.AccountId = accountId;
                asynResult.Send(null);

                //遍历说有已缓存的Clients,并将当前内容输出到客户端
                foreach (AsynResult result in Clients)
                {
                    result.Content = Content;
                    result.AccountId = accountId;
                    result.Send(null);
                }

                //清空Ilist<AsynResult> Clients
                Clients.Clear();
            }
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:27,代码来源:CometMessage.cs

示例9: BindData

        protected void BindData(CY.UME.Core.Business.Group group)
        {
            CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

            pageInfo.CurrentPage = 1;
            pageInfo.PageSize = 15;

            CY.UME.Core.Business.Album album =new CY.UME.Core.Business.Album();
            if (group != null)
            {
                album = group.GetGroupAlbum();
                picList = album.GetPictures(pageInfo);
            }

            int count = album.GetPictureCount();

            DDLGroup.SelectedValue = group.Id.ToString();

            minPubDate.Value = "";
            maxPubDate.Value = "";
            picname.Value = "";
            authorName.Value = "";

            gpm_HiddenPageSize.Value = "15";
            gpm_HiddenRecordCount.Value = count.ToString();
            gpm_HiddenSiteUrl.Value = SiteUrl;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:27,代码来源:GroupPictureManage.aspx.cs

示例10: Add

        public void Add(CY.HotelBooking.Core.Business.Web_Module m)
        {
            SqlServerUtility sqlhelper = new SqlServerUtility();
            sqlhelper.AddParameter("@Module_Code", SqlDbType.VarChar, m.Module_Code, 10);
            sqlhelper.AddParameter("@Module_Name", SqlDbType.VarChar, m.Module_Name, 20);
            sqlhelper.AddParameter("@Module_IsParent", SqlDbType.VarChar, m.Module_IsParent);

            SqlDataReader reader = sqlhelper.ExecuteSqlReader(strSQLInsert);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0))
                {
                    int id;
                    if (int.TryParse(reader.GetValue(0).ToString(), out id))
                    {
                        m.Id = id;
                    }
                }

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
开发者ID:dalinhuang,项目名称:cyhotelbooking,代码行数:28,代码来源:Web_ModuleProvider.cs

示例11: Insert

        public void Insert(CY.HotelBooking.Core.Business.Settings setting)
        {
            SqlServerUtility db = new SqlServerUtility();

            db.AddParameter("@HotelName", SqlDbType.NVarChar, setting.HotelName);
            db.AddParameter("@Copyright", SqlDbType.NVarChar, setting.Copyright);
            db.AddParameter("@Author", SqlDbType.NVarChar, setting.SysAuthor);
            db.AddParameter("@ReadInfo",SqlDbType.Text,setting.ReadInfo);
            db.AddParameter("@Contact", SqlDbType.Text, setting.Contact);
            db.AddParameter("@Address", SqlDbType.Text, setting.Address);
            db.AddParameter("@EmailBody", SqlDbType.Text, setting.EmailBody);

            SqlDataReader reader = db.ExecuteSqlReader(SqlInsertSetting);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0))
                {
                    int id;
                    if (int.TryParse(reader.GetValue(0).ToString(), out id))
                    {
                        setting.Id = id;
                    }
                }

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
开发者ID:dalinhuang,项目名称:cyhotelbooking,代码行数:33,代码来源:SettingsProvider.cs

示例12: BindData

        protected void BindData(CY.UME.Core.Business.Group group)
        {
            CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

            pageInfo.CurrentPage = 1;
            pageInfo.PageSize = 20;

            if (group != null)
            {
                topicList = CY.UME.Core.Business.Topic.GetGroupTopicesByDateCreated(group.Id.ToString(), pageInfo);
            }

            int count = group.GetGroupTopicesNum();

            DDLGroup.SelectedValue = group.Id.ToString();
            authorname.Value = "";
            minviewnum.Value = "";
            maxviewnum.Value = "";
            minreplynum.Value = "";
            maxreplynum.Value = "";
            title.Value = "";
            isRecommend.SelectedIndex = 0;

            tm_HiddenPageSize.Value = "20";
            tm_HiddenRecordCount.Value = count.ToString();
            tm_HiddenSiteUrl.Value = SiteUrl;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:27,代码来源:TopicManage.aspx.cs

示例13: GetAllNotice

        public List<CY.UME.Core.Business.Notice> GetAllNotice(CY.UME.Core.Business.Account account)
        {
            List<Core.Business.Notice> noticelist = new List<Core.Business.Notice>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@AccountId", SqlDbType.BigInt, account.Id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_Notice_SelectAll_By_AccountId");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Notice notice = new Core.Business.Notice();

                    if (!reader.IsDBNull(0)) notice.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) notice.Content = reader.GetString(1);
                    if (!reader.IsDBNull(2)) notice.AccountId = reader.GetInt64(2);
                    if (!reader.IsDBNull(3)) notice.AuthorId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) notice.DateCreated = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) notice.IsReaded = reader.GetBoolean(5);
                    if (!reader.IsDBNull(6)) notice.Type = reader.GetString(6);
                    if (!reader.IsDBNull(7)) notice.InstanceId = reader.GetString(7);

                    notice.MarkOld();
                    noticelist.Add(notice);
                }
                reader.Close();
            }
            return noticelist;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:30,代码来源:NoticeProvider.cs

示例14: GetCommentCountByFavoritesId

        public int GetCommentCountByFavoritesId(CY.UME.Core.Business.Favorites favorites)
        {
            int count = 0;

            if (favorites == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@FavoritesId", SqlDbType.BigInt, favorites.Id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetFavoritesCommentCountByInstanceId);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:28,代码来源:FavoritesCommentProvider.cs

示例15: BuildMenu

        private string BuildMenu(CY.CSTS.Core.Business.Control.sfMenu menu)
        {
            System.Text.StringBuilder sbResult = new StringBuilder();
            try
            {
                if (menu != null)
                {

                    sbResult.Append(string.Format("<ul id='{0}' >", menu.Name));
                    if (menu.SubMenu != null && menu.SubMenu.Count() > 0)
                    {

                        foreach (sfMenu m in menu.SubMenu)
                        {
                            sbResult.Append(string.Format("<li><a href='{0}'>{1}</a>", m.Url, m.Name));
                            if (m.SubMenu != null && m.SubMenu.Count() > 0)
                            {
                                sbResult.Append(BuildMenu(m));
                            }
                            sbResult.Append("</li>");
                        }

                    }
                    sbResult.Append("</ul>");

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return sbResult.ToString();
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:33,代码来源:Menu.ascx.cs


注:本文中的CY类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。