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


C# Common.AddConditionParameter方法代码示例

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


在下文中一共展示了Common.AddConditionParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: BatchOper

 /// <summary>
 /// 批量操作插件
 /// </summary>
 /// <param name="_act">行为</param>
 /// <param name="_ids">id,以,隔开</param>
 public bool BatchOper(string _act, string _ids)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         string[] idValue;
         idValue = _ids.Split(',');
         if (_act == "pass")
         {
             for (int i = 0; i < idValue.Length; i++)
             {
                 _doh.Reset();
                 _doh.ConditionExpress = "[email protected]";
                 _doh.AddConditionParameter("@id", idValue[i]);
                 _doh.AddFieldItem("Enabled", 1);
                 _doh.Update("jcms_normal_user_oauth");
             }
         }
         else if (_act == "nopass")
         {
             for (int i = 0; i < idValue.Length; i++)
             {
                 _doh.Reset();
                 _doh.ConditionExpress = "[email protected]";
                 _doh.AddConditionParameter("@id", idValue[i]);
                 _doh.AddFieldItem("Enabled", 0);
                 _doh.Update("jcms_normal_user_oauth");
             }
         }
     }
     return true;
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:36,代码来源:UserOAuthDAL.cs

示例3: BatchOper

 /// <summary>
 /// 批量操作插件
 /// </summary>
 /// <param name="_act">行为</param>
 /// <param name="_ids">id,以,隔开</param>
 public bool BatchOper(string _act, string _ids)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         string[] idValue;
         idValue = _ids.Split(',');
         if (_act == "pass")
         {
             for (int i = 0; i < idValue.Length; i++)
             {
                 _doh.Reset();
                 _doh.ConditionExpress = "[email protected]";
                 _doh.AddConditionParameter("@id", idValue[i]);
                 _doh.AddFieldItem("Enabled", 1);
                 _doh.Update("jcms_normal_extends");
             }
         }
         else if (_act == "nopass")
         {
             for (int i = 0; i < idValue.Length; i++)
             {
                 _doh.Reset();
                 _doh.ConditionExpress = "[email protected]";
                 _doh.AddConditionParameter("@id", idValue[i]);
                 _doh.AddFieldItem("Enabled", 0);
                 _doh.Update("jcms_normal_extends");
             }
         }
         string TempStr = "";
         _doh.Reset();
         _doh.SqlCmd = JumboTCMS.Utils.SqlHelp.GetSql("[Title],[Name],[Type],[Enabled]", "jcms_normal_extends", "pId", 100, 1, "desc", "");
         DataTable dt = _doh.GetDataTable();
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             if(dt.Rows[i]["Enabled"].ToString() =="1")
                 TempStr += "\r\nvar Plugin" + dt.Rows[i]["Name"].ToString() + "	= true;//" + dt.Rows[i]["Title"].ToString() + "插件";
             else
                 TempStr += "\r\nvar Plugin" + dt.Rows[i]["Name"].ToString() + "	= false;//" + dt.Rows[i]["Title"].ToString() + "插件";
         }
         string _globalJS = JumboTCMS.Utils.DirFile.ReadFile("~/_data/jcmsV5.js");
         string _strBegin = "//<!--插件开关begin";
         string _strEnd = "//-->插件开关end";
         System.Collections.ArrayList TagArray = JumboTCMS.Utils.Strings.GetHtmls(_globalJS, _strBegin, _strEnd, true, true);
         if (TagArray.Count > 0)//标签存在
         {
             _globalJS = _globalJS.Replace(TagArray[0].ToString(), _strBegin + "\r\n\r\n" + TempStr + "\r\n\r\n" + _strEnd);
         }
         JumboTCMS.Utils.DirFile.SaveFile(_globalJS, "~/_data/jcmsV5.js");
     }
     return true;
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:56,代码来源:ExtendsDAL.cs

示例4: DeleteByFriendID

        /// <summary>
        /// 通过对方ID删除好友,如果不存在返回false
        /// </summary>
        /// <param name="_userid">发起方id</param>
        /// <param name="_username">发起方name</param>
        /// <param name="_friendid">自增长id</param>
        /// <returns></returns>
        public bool DeleteByFriendID(string _userid, string _username, string _friendid)
        {
            _username = _username == "" ? "user(id:" + _userid + ")" : _username;
            using (DbOperHandler _doh = new Common().Doh())
            {
                _doh.Reset();
                _doh.ConditionExpress = "[email protected] and [email protected]";
                _doh.AddConditionParameter("@friendid", _friendid);
                _doh.AddConditionParameter("@userid", _userid);
                int _del = _doh.Delete("jcms_normal_user_friends");
                if (_del == 1)
                    new JumboTCMS.DAL.Normal_UserNoticeDAL().SendNotite("解除好友", "<a href=\"javascript:void(0);\" onclick=\"ShowUserPage(" + _userid + ");\">" + _username + "</a> 和你解除了好友关系", _friendid, "friend");

                return (_del == 1);
            }
        }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:23,代码来源:UserFriendsDAL.cs

示例5: AddClickTimes

 /// <summary>
 /// 增加标签点击数
 /// </summary>
 /// <param name="_channelid"></param>
 /// <param name="_tagname"></param>
 public void AddClickTimes(string _channelid, string _tagname)
 {
     if (_tagname.Length == 0) return;
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected] and ChannelId=" + _channelid;
         _doh.AddConditionParameter("@Title", _tagname);
         _doh.Add("jcms_normal_tag", "ClickTimes");
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:16,代码来源:TagDAL.cs

示例6: DeleteByID

 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool DeleteByID(string _id)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected]";
         _doh.AddConditionParameter("@id", _id);
         int _del = _doh.Delete("jcms_normal_page");
         return (_del == 1);
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:14,代码来源:PageDAL.cs

示例7: 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

示例8: 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

示例9: ChkUserLogin

        /// <summary>
        /// 会员登录
        /// </summary>
        /// <param name="_username"></param>
        /// <param name="_userpass"></param>
        /// <param name="iExpires"></param>
        /// <param name="isMD5Passwd"></param>
        /// <returns></returns>
        public string ChkUserLogin(string _username, string _userpass, int iExpires, bool isMD5Passwd)
        {
            if (!isMD5Passwd)
                _userpass = JumboTCMS.Utils.MD5.Lower32(_userpass);
            using (DbOperHandler _doh = new Common().Doh())
            {
                _username = _username.Replace("\'", "");
                _doh.Reset();
                _doh.ConditionExpress = "[email protected]";
                _doh.AddConditionParameter("@username", _username);
                string _userid = _doh.GetField("jcms_normal_user", "id").ToString();
                if (_userid != "")
                {
                    JumboTCMS.Entity.Normal_User _User = new JumboTCMS.DAL.Normal_UserDAL().GetEntity(_userid);
                    if (_User.UserPass != _userpass)
                    {
                        return "密码错误";
                    }
                    if (_User.State != 1)
                    {
                        return "帐号被锁定";
                    }
                    _doh.Reset();
                    _doh.SqlCmd = "SELECT [id],[GroupName],[IsLogin],[Setting] FROM [jcms_normal_usergroup] WHERE [Id]=" + _User.Group;
                    DataTable dtUserGroup = _doh.GetDataTable();
                    if (dtUserGroup.Rows.Count == 0)
                    {
                        return "用户组有误";
                    }
                    if (dtUserGroup.Rows[0]["IsLogin"].ToString() != "1")
                    {
                        return "帐号禁止登录";
                    }
                    string _userGroupid = dtUserGroup.Rows[0]["Id"].ToString();
                    string _userGroupname = dtUserGroup.Rows[0]["GroupName"].ToString();
                    string _userSetting = dtUserGroup.Rows[0]["Setting"].ToString();
                    dtUserGroup.Clear();
                    dtUserGroup.Dispose();
                    string _userCookies = "c" + (new Random().Next(10000000, 99999999)).ToString();
                    //设置Cookies
                    System.Collections.Specialized.NameValueCollection myCol = new System.Collections.Specialized.NameValueCollection();
                    myCol.Add("id", _userid);
                    myCol.Add("name", _User.UserName);
                    myCol.Add("nickname", _User.NickName);
                    myCol.Add("password", _User.UserPass);
                    myCol.Add("email", _User.Email);
                    myCol.Add("groupid", _userGroupid);
                    myCol.Add("groupname", _userGroupname);
                    myCol.Add("setting", _userSetting);
                    myCol.Add("cookies", _userCookies);
                    JumboTCMS.Utils.Cookie.SetObj(site.CookiePrev + "user", 60 * 60 * 24 * iExpires, myCol, site.CookieDomain, site.CookiePath);

                    //更新User登陆信息
                    _doh.Reset();
                    _doh.ConditionExpress = "[email protected] and state=1";
                    _doh.AddConditionParameter("@id", _userid);
                    _doh.AddFieldItem("Cookies", _userCookies);
                    _doh.AddFieldItem("LastTime", DateTime.Now.ToString());
                    _doh.AddFieldItem("LastIP", IPHelp.ClientIP);
                    _doh.AddFieldItem("UserSign", "");
                    _doh.Update("jcms_normal_user");
                    if (site.ForumAPIKey != "")
                    {
                        bool _AutoLogining = false;
                        string _ForumAutoRegister = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ForumAutoRegister");
                        if (_ForumAutoRegister == "true")//表示自动注册论坛用户
                            _AutoLogining = true;
                        if (_AutoLogining == true)
                        {
                            //登陆社区
                            _doh.Reset();
                            _doh.ConditionExpress = "[email protected] and state=1";
                            _doh.AddConditionParameter("@id", _userid);
                            object[] _forumInfo = _doh.GetFields("jcms_normal_user", "ForumName,ForumPass");
                            if (_forumInfo[0].ToString().Length > 0 && _forumInfo[1].ToString().Length > 0)
                            {
                                JumboTCMS.API.Discuz.Toolkit.DiscuzSession ds = JumboTCMS.API.Discuz.DiscuzSessionHelper.GetSession();
                                ds.Login(ds.GetUserID(_forumInfo[0].ToString()), _forumInfo[1].ToString(), true, iExpires, site.CookieDomain);
                            }
                        }
                    }
                    return "ok";
                }
                else
                {
                    return "帐号不存在";
                }

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

示例10: 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

示例11: 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

示例12: 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

示例13: DeleteByID

        /// <summary>
        /// 删除一个插件
        /// </summary>
        /// <param name="_id"></param>
        /// <param name="_err">返回错误信息</param>
        /// <returns></returns>
        public bool DeleteByID(string _id, ref string _err)
        {
            using (DbOperHandler _doh = new Common().Doh())
            {
                if (_id != "" && _id != "0")
                {
                    _doh.Reset();
                    _doh.ConditionExpress = "[email protected]";
                    _doh.AddConditionParameter("@id", _id);
                    object[] _values = _doh.GetFields("jcms_normal_extends", "Name,Locked,Enabled,BaseTable");
                    string eName = _values[0].ToString();
                    string eLocked = _values[1].ToString();
                    string eEnabled = _values[2].ToString();
                    string _delTables = _values[3].ToString();
                    if (eLocked == "1")
                    {
                        _err = "锁定的插件不可删";
                        return false;
                    }

                    if (eEnabled == "1")
                    {
                        _err = "先把插件禁用再卸载";
                        return false;
                    }

                    if (_delTables.Trim().Length > 0)//需要删除插件表
                    {
                        string[] _delTable = _delTables.Split(',');
                        for (int i = 0; i < _delTable.Length; i++)
                        {
                            _doh.Reset();
                            _doh.DropTable(_delTable[i]);
                        }
                    }
                    //删除插件整个目录
                    JumboTCMS.Utils.DirFile.DeleteDir(site.Dir + "extends/" + eName + "/");
                    _doh.Reset();
                    _doh.ConditionExpress = "[email protected]";
                    _doh.AddConditionParameter("@id", _id);
                    _doh.Delete("jcms_normal_extends");
                }
                else
                {
                    _err = "参数错误";
                    return false;
                }
                return true;
            }
        }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:56,代码来源:ExtendsDAL.cs

示例14: UpdateIPData

 /// <summary>
 /// 更新起/始IP整型值
 /// </summary>
 /// <param name="_id">编号</param>
 /// <param name="_startip">开始IP</param>
 /// <param name="_endip">结束IP</param>
 public bool UpdateIPData(string _id, string _startip, string _endip)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.ConditionExpress = "[email protected]";
         _doh.AddConditionParameter("@id", _id);
         _doh.AddFieldItem("StartIP", JumboTCMS.Utils.IPHelp.IP2Long(System.Net.IPAddress.Parse(_startip)));
         _doh.AddFieldItem("EndIP", JumboTCMS.Utils.IPHelp.IP2Long(System.Net.IPAddress.Parse(_endip)));
         _doh.AddFieldItem("Enabled", 1);
         int _update = _doh.Update("jcms_normal_forbidip");
         return (_update == 1);
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:20,代码来源:ForbidipDAL.cs

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