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


C# Common.Exist方法代码示例

本文整理汇总了C#中JumboTCMS.DAL.Common.Exist方法的典型用法代码示例。如果您正苦于以下问题:C# Common.Exist方法的具体用法?C# Common.Exist怎么用?C# Common.Exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JumboTCMS.DAL.Common的用法示例。


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

示例1: GetDigg

        /// <summary>
        /// 得到内容
        /// </summary>
        /// <param name="_channeltype"></param>
        /// <param name="_contentid"></param>
        /// <returns></returns>
        public Normal_Digg GetDigg(string _channeltype, string _contentid)
        {
            using (DbOperHandler _doh = new Common().Doh())
            {
                Normal_Digg digg = new Normal_Digg();
                digg.ChannelType = _channeltype;
                digg.ContentId = Str2Int(_contentid);
                _doh.Reset();
                _doh.ConditionExpress = "[email protected] and [email protected]";
                _doh.AddConditionParameter("@channeltype", _channeltype);
                _doh.AddConditionParameter("@contentid", _contentid);
                if (!_doh.Exist("jcms_normal_digg"))
                {
                    _doh.Reset();
                    _doh.AddFieldItem("ChannelType", _channeltype);
                    _doh.AddFieldItem("ContentId", _contentid);

                    _doh.AddFieldItem("DiggNum", 0);
                    _doh.Insert("jcms_normal_digg");
                }
                _doh.Reset();
                _doh.ConditionExpress = "[email protected] and [email protected]";
                _doh.AddConditionParameter("@channeltype", _channeltype);
                _doh.AddConditionParameter("@contentid", _contentid);
                digg.DiggNum = Str2Int(_doh.GetField("jcms_normal_digg", "DiggNum").ToString());
                return digg;
            }
        }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:34,代码来源:DiggDAL.cs

示例2: Exists

 /// <summary>
 /// 是否存在记录
 /// </summary>
 /// <param name="_wherestr">条件</param>
 /// <returns></returns>
 public bool Exists(string _wherestr)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         int _ext = 0;
         _doh.Reset();
         _doh.ConditionExpress = _wherestr;
         if (_doh.Exist("jcms_normal_page"))
             _ext = 1;
         return (_ext == 1);
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:17,代码来源:PageDAL.cs

示例3: ExistTitle

 /// <summary>
 /// 判断重复性(标题是否存在)
 /// </summary>
 /// <param name="_title">需要检索的标题</param>
 /// <param name="_id">除外的ID</param>
 /// <param name="_wherestr">其他条件</param>
 /// <returns></returns>
 public bool ExistTitle(string _title, string _id, string _wherestr)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         int _ext = 0;
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and id<>" + _id;
         if (_wherestr != "") _doh.ConditionExpress += " and " + _wherestr;
         _doh.AddConditionParameter("@title", _title);
         if (_doh.Exist("jcms_normal_page"))
             _ext = 1;
         return (_ext == 1);
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:21,代码来源:PageDAL.cs

示例4: Exists

 /// <summary>
 /// 判断是否已经为好友
 /// </summary>
 /// <param name="_userid"></param>
 /// <param name="_friendid"></param>
 /// <returns></returns>
 public bool Exists(string _userid, string _friendid)
 {
     int _ext = 0;
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and [email protected]";
         _doh.AddConditionParameter("@friendid", _friendid);
         _doh.AddConditionParameter("@userid", _userid);
         if (_doh.Exist("jcms_normal_user_friends"))
             _ext = 1;
     }
     return (_ext == 1);
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:20,代码来源:UserFriendsDAL.cs

示例5: Move2Special

 /// <summary>
 /// 内容加入专题
 /// </summary>
 /// <param name="_specialid">专题ID</param>
 /// <param name="_channelid">频道ID</param>
 /// <param name="_channeltype">频道类型,也就是内容的模型</param>
 /// <param name="_contentids">内容ID,以,隔开</param>
 public bool Move2Special(int _specialid, string _channelid, string _channeltype, string _contentids)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         string _contentid = string.Empty;
         string _title = string.Empty;
         _doh.Reset();
         _doh.SqlCmd = "SELECT [Id],[Title] FROM [jcms_module_" + _channeltype + "] WHERE [ChannelId]=" + _channelid + " AND [Id] In (" + _contentids + ")";
         DataTable dt = _doh.GetDataTable();
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             _contentid = dt.Rows[i]["Id"].ToString();
             _title = dt.Rows[i]["Title"].ToString();
             _doh.Reset();
             _doh.ConditionExpress = "[email protected] and [email protected] and [email protected]";
             _doh.AddConditionParameter("@sid", _specialid);
             _doh.AddConditionParameter("@contentid", _contentid);
             _doh.AddConditionParameter("@channelid", _channelid);
             if (!_doh.Exist("jcms_normal_specialcontent"))
             {
                 _doh.Reset();
                 _doh.AddFieldItem("Title", _title);
                 _doh.AddFieldItem("sId", _specialid);
                 _doh.AddFieldItem("ChannelId", _channelid);
                 _doh.AddFieldItem("ContentId", _contentid);
                 _doh.Insert("jcms_normal_specialcontent");
             }
         }
     }
     return true;
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:38,代码来源:SpecialContentDAL.cs

示例6: Running

 /// <summary>
 /// 是否正在运行
 /// </summary>
 /// <param name="_oauthcode">接口代码</param>
 /// <returns></returns>
 public bool Running(string _oauthcode)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and Enabled=1";
         _doh.AddConditionParameter("@code", _oauthcode);
         return (_doh.Exist("jcms_normal_user_oauth"));
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:15,代码来源:UserOAuthDAL.cs

示例7: HasChild

 /// <summary>
 /// 判断是否有下属栏目
 /// </summary>
 /// <param name="_id"></param>
 /// <returns></returns>
 public bool HasChild(string _channelid, string _id)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "channelid=" + _channelid + " AND parentid=" + _id;
         bool _haschild = (_doh.Exist("jcms_normal_class"));
         return _haschild;
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:15,代码来源:ClassDAL.cs

示例8: Running

 /// <summary>
 /// 是否正在运行
 /// </summary>
 /// <param name="_extendname">插件名称</param>
 /// <returns></returns>
 public bool Running(string _extendname)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and Enabled=1";
         _doh.AddConditionParameter("@name", _extendname);
         return (_doh.Exist("jcms_normal_extends"));
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:15,代码来源:ExtendsDAL.cs

示例9: GetNewJSON

        /// <summary>
        /// 获得新插件列表JSON
        /// </summary>
        /// <param name="_jsonstr"></param>
        public void GetNewJSON(ref string _jsonstr)
        {
            using (DbOperHandler _doh = new Common().Doh())
            {
                DirectoryInfo di = new DirectoryInfo(HttpContext.Current.Server.MapPath(site.Dir + "extends/"));
                DirectoryInfo[] directorylist = di.GetDirectories();
                string tempstr = "table:[";
                int extendcount = 0;
                string _title = "";
                string _name = "";
                string _author = "";
                string _type = "";
                foreach (DirectoryInfo dii in directorylist)
                {
                    if (!JumboTCMS.Utils.DirFile.FileExists(site.Dir + "extends/" + dii.Name + "/install.config"))
                        continue;
                    _title = JumboTCMS.Utils.XmlCOM.ReadConfig(site.Dir + "extends/" + dii.Name + "/install", "Title");
                    _name = JumboTCMS.Utils.XmlCOM.ReadConfig(site.Dir + "extends/" + dii.Name + "/install", "Name");
                    _author = JumboTCMS.Utils.XmlCOM.ReadConfig(site.Dir + "extends/" + dii.Name + "/install", "Author");
                    _type = JumboTCMS.Utils.XmlCOM.ReadConfig(site.Dir + "extends/" + dii.Name + "/install", "Type");

                    _doh.Reset();
                    _doh.ConditionExpress = "[email protected]";
                    _doh.AddConditionParameter("@name", _name);
                    if (_doh.Exist("jcms_normal_extends"))
                        continue;
                    tempstr += ",{title: '" + _title + "'," +
                        "name: '" + _name + "'," +
                        "author: '" + _author + "'," +
                        "type: '" + _type + "'}";
                    extendcount++;
                }
                tempstr += "]";
                tempstr = tempstr.Replace("table:[,", "table:[");
                _jsonstr = "{result :\"1\",returnval :\"操作成功\",recordcount:" + extendcount + "," + tempstr + "}";

            }
        }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:42,代码来源:ExtendsDAL.cs

示例10: IPIsForbiding

 /// <summary>
 /// 检测指定IP地址是否已受到屏蔽
 /// </summary>
 /// <param name="IP地址">要检测的IP地址</param>
 /// <returns>是否属于已屏蔽的IP</returns>
 public bool IPIsForbiding(string _ip)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         long ip = JumboTCMS.Utils.IPHelp.IP2Long(System.Net.IPAddress.Parse(_ip));
         _doh.Reset();
         if (this.DBType == "0")
             _doh.ConditionExpress = "StartIP<=" + ip + " and EndIP>=" + ip + " AND datediff('d','" + DateTime.Now.ToShortDateString() + "',ExpireDate)>0";
         else
             _doh.ConditionExpress = "StartIP<=" + ip + " and EndIP>=" + ip + " AND datediff(d,'" + DateTime.Now.ToShortDateString() + "',ExpireDate)>0";
         bool _isforbiding = _doh.Exist("jcms_normal_forbidip");
         return _isforbiding;
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:19,代码来源:ForbidipDAL.cs

示例11: ChkUserSign

 /// <summary>
 /// 判断usersign是否正确
 /// </summary>
 /// <param name="_userid"></param>
 /// <param name="_usersign">长度一定是32位</param>
 /// <returns></returns>
 public bool ChkUserSign(string _userid, string _usersign)
 {
     if (_usersign.Length != 32 || _userid == "")
     {
         return false;
     }
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and [email protected] and state=1";
         _doh.AddConditionParameter("@userid", Str2Int(_userid));
         _doh.AddConditionParameter("@usersign", _usersign);
         if (_doh.Exist("jcms_normal_user"))
             return true;
         else
             return false;
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:24,代码来源:UserDAL.cs


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