本文整理汇总了C#中JumboTCMS.DAL.Common.AddFieldItem方法的典型用法代码示例。如果您正苦于以下问题:C# Common.AddFieldItem方法的具体用法?C# Common.AddFieldItem怎么用?C# Common.AddFieldItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JumboTCMS.DAL.Common
的用法示例。
在下文中一共展示了Common.AddFieldItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddVIPYears
/// <summary>
/// 续费VIP
/// </summary>
/// <param name="_id">用户ID</param>
/// <param name="_vipyears">续的年数</param>
public void AddVIPYears(string _id, int _vipyears)
{
using (DbOperHandler _doh = new Common().Doh())
{
DateTime LimitDate = DateTime.Now;
_doh.Reset();
_doh.ConditionExpress = "id=" + _id;
object[] values = _doh.GetFields("jcms_normal_user", "IsVIP,VIPTime");
bool _isvip = (JumboTCMS.Utils.Validator.StrToInt(values[0].ToString(), 0) == 1);
if (!_isvip)//如果还不是VIP
LimitDate = DateTime.Now.AddYears(_vipyears);
else
{
if (JumboTCMS.Utils.Validator.ValidDate(values[1].ToString()))//如果已经过期
LimitDate = DateTime.Now.AddYears(_vipyears);
else
LimitDate = DateTime.Parse(values[1].ToString()).AddYears(_vipyears);
}
_doh.Reset();
_doh.ConditionExpress = "id=" + _id;
_doh.AddFieldItem("IsVIP", 1);
_doh.AddFieldItem("VIPTime", LimitDate);
_doh.Update("jcms_normal_user");
}
}
示例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;
}
示例3: 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;
}
}
示例4: SaveLog
/// <summary>
/// 保存用户日志
/// </summary>
/// <param name="_uid">会员ID</param>
/// <param name="_info">保存信息</param>
/// <param name="_type">操作类型,1=分组移动,2=扣除博币,3=积分增加(2,3为系统操作),4=增加博币,5=VIP升级,6积分扣除(4,5,6为管理员操作)</param>
public void SaveLog(string _uid, string _info, int _type)
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.AddFieldItem("UserId", _uid);
_doh.AddFieldItem("OperInfo", _info);
_doh.AddFieldItem("OperType", _type);
_doh.AddFieldItem("OperTime", DateTime.Now.ToString());
_doh.AddFieldItem("OperIP", IPHelp.ClientIP);
_doh.Insert("jcms_normal_user_logs");
}
}
示例5: 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;
}
示例6: NewGoods
/// <summary>
/// 新增购物车商品信息
/// </summary>
/// <param name="_cart"></param>
/// <returns></returns>
public int NewGoods(JumboTCMS.Entity.Normal_UserCart _cart)
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.AddFieldItem("UserId", _cart.UserId);
_doh.AddFieldItem("ProductId", _cart.ProductId);
_doh.AddFieldItem("ProductLink", _cart.ProductLink);
_doh.AddFieldItem("BuyCount", _cart.BuyCount);
_doh.AddFieldItem("State", 0);
_doh.AddFieldItem("CartTime", DateTime.Now.ToString());
int _newid = _doh.Insert("jcms_normal_user_cart");
return _newid;
}
}
示例7: AddFriend
/// <summary>
/// 加为好友,如果已经存在返回false
/// </summary>
/// <param name="_userid">主动方ID</param>
/// <param name="_username">主动方name</param>
/// <param name="_friendid">被动方ID</param>
/// <returns></returns>
public bool AddFriend(string _userid, string _username, string _friendid)
{
if (Exists(_userid, _friendid)) return false;//已经存在
_username = _username == "" ? "user(id:" + _userid + ")" : _username;
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.AddFieldItem("FriendId", _friendid);
_doh.AddFieldItem("UserId", _userid);
_doh.AddFieldItem("AddDate", DateTime.Now.ToString());
_doh.Insert("jcms_normal_user_friends");
new JumboTCMS.DAL.Normal_UserNoticeDAL().SendNotite("加好友", "<a href=\"javascript:void(0);\" onclick=\"ShowUserPage(" + _userid + ");\">" + _username + "</a> 把你加为了好友", _friendid, "friend");
}
return true;
}
示例8: SendNotite
/// <summary>
/// 发站内通知
/// </summary>
/// <param name="_Title">标题</param>
/// <param name="_Content">内容</param>
/// <param name="_ReceiveUserId">接收人ID,0表示所有人</param>
/// <param name="_NoticeType">类型,比如:friend</param>
public bool SendNotite(string _Title, string _Content, string _ReceiveUserId, string _NoticeType)
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.AddFieldItem("Title", _Title);
_doh.AddFieldItem("AddDate", DateTime.Now.ToString());
_doh.AddFieldItem("Content", _Content);
_doh.AddFieldItem("UserId", _ReceiveUserId);
_doh.AddFieldItem("NoticeType", _NoticeType);
_doh.AddFieldItem("State", 0);
_doh.AddFieldItem("ReadTime", DateTime.Now.ToString());
_doh.Insert("jcms_normal_user_notice");
return true;
}
}
示例9: NewOrder
/// <summary>
/// 新增充值信息
/// </summary>
/// <param name="_uid"></param>
/// <param name="_points">博币</param>
/// <param name="_payway">如:alipay、tenpay等</param>
/// <returns></returns>
public string NewOrder(string _uid, int _points, string _payway)
{
using (DbOperHandler _doh = new Common().Doh())
{
string _ordernum = GetProductOrderNum();//订单号
_doh.Reset();
_doh.AddFieldItem("UserId", _uid);
_doh.AddFieldItem("OrderNum", _ordernum);
_doh.AddFieldItem("Points", _points);
_doh.AddFieldItem("State", 0);
_doh.AddFieldItem("PaymentWay", _payway);
_doh.AddFieldItem("OrderTime", DateTime.Now.ToString());
_doh.AddFieldItem("OrderIP", IPHelp.ClientIP);
_doh.Insert("jcms_normal_recharge");
return _ordernum;
}
}
示例10: SendMessage
/// <summary>
/// 发站内短信
/// </summary>
/// <param name="_Title">标题</param>
/// <param name="_Content">内容</param>
/// <param name="_SendUserId">发送人ID</param>
/// <param name="_ReceiveUserId">接收人ID,多个用逗号隔开</param>
/// <param name="_ReceiveUserName">接收人用户名,多个用逗号隔开</param>
public bool SendMessage(string _Title, string _Content, string _SendUserId, string _ReceiveUserId, string _ReceiveUserName)
{
using (DbOperHandler _doh = new Common().Doh())
{
string[] _uId = _ReceiveUserId.Split(',');
string[] _uName = _ReceiveUserName.Split(',');
for (int i = 0; i < _uId.Length; i++)
{
_doh.Reset();
_doh.AddFieldItem("Title", _Title);
_doh.AddFieldItem("AddDate", DateTime.Now.ToString());
_doh.AddFieldItem("Content", _Content);
_doh.AddFieldItem("SendIP", IPHelp.ClientIP);
_doh.AddFieldItem("SendUserId", _SendUserId);
_doh.AddFieldItem("ReceiveUserId", _uId[i]);
_doh.AddFieldItem("ReceiveUserName", _uName[i]);
_doh.AddFieldItem("State", 0);
_doh.Insert("jcms_normal_user_message");
}
return true;
}
}
示例11: InsertGUID
/// <summary>
/// 插入GUID
/// </summary>
/// <param name="_id"></param>
public string InsertGUID(string _id, DbOperHandler doh)
{
using (DbOperHandler _doh = new Common().Doh())
{
string _guid = "";
_doh.Reset();
_doh.SqlCmd = "SELECT [GUID] FROM [jcms_normal_user] WHERE [Id]=" + _id;
DataTable dt = _doh.GetDataTable();
if (dt.Rows.Count > 0)
{
_guid = dt.Rows[0][0].ToString();
}
if (_guid.Length != 36)
{
_guid = Guid.NewGuid().ToString();
_doh.ConditionExpress = "id=" + _id;
_doh.AddFieldItem("guid", _guid);
_doh.Update("jcms_normal_user");
}
return _guid;
}
}
示例12: UpdateGoods
/// <summary>
/// 更新购物车商品信息
/// </summary>
/// <param name="_productid">根据产品查询</param>
/// <param name="_buycount"></param>
/// <param name="_state">1表示状态发生了变化</param>
/// <returns></returns>
public bool UpdateGoods(string _uid, string _productid, int _buycount, int _state)
{
using (DbOperHandler _doh = new Common().Doh())
{
int _num = 0;
if (_state == 0)
{
_doh.Reset();
_doh.ConditionExpress = "ProductId=" + _productid + " and state=0 and userid=" + _uid;
_doh.AddFieldItem("BuyCount", _buycount);
_doh.AddFieldItem("CartTime", DateTime.Now.ToString());
_num = _doh.Update("jcms_normal_user_cart");
}
else if (_state == 1)
{
_doh.Reset();
_doh.ConditionExpress = "ProductId=" + _productid + " and state=1 and userid=" + _uid;
_doh.AddFieldItem("State", 1);
_num = _doh.Update("jcms_normal_user_cart");
}
return (_num == 1);
}
}
示例13: Register
public int Register(string _username, string _nickname, string _userpass, bool isMD5Passwd, int _sex, string _email, string _birthday, string _usersign, string _adminname, string _adminpass, string _oauth_code, string _oauth_token)
{
if (_oauth_code == "") _oauth_code = "tencent";
if (Exists(string.Format("username='{0}'", _username)))
return 0;
using (DbOperHandler _doh = new Common().Doh())
{
string _md5pass = isMD5Passwd ? _userpass : JumboTCMS.Utils.MD5.Lower32(_userpass);
string _md5pass2 = isMD5Passwd ? _adminpass : JumboTCMS.Utils.MD5.Lower32(_adminpass);
int dPoints = Str2Int(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "DefaultPoints"), 0);
int uState = site.CheckReg ? 0 : 1;
object[,] addFields = new object[2, 19] {
{
"UserName", "NickName", "UserPass", "Sex", "Email", "Birthday",
"Group", "Points", "Login", "State", "AdminId", "Setting", "UserSign",
"AdminState", "IsVIP", "Integral","RegTime", "RegIp","Token_"+_oauth_code},
{
_username, _nickname, _md5pass, _sex,_email, _birthday,
1, dPoints, 0, uState,0, ",,", _usersign,
0,0, 0, DateTime.Now.ToString(),IPHelp.ClientIP,_oauth_token}
};
_doh.Reset();
_doh.AddFieldItems(addFields);
int _uID = _doh.Insert("jcms_normal_user");
#region 复制头像
JumboTCMS.Utils.DirFile.CopyFile("~/_data/avatar/0_l.jpg", "~/_data/avatar/" + _uID + "_l.jpg", true);
JumboTCMS.Utils.DirFile.CopyFile("~/_data/avatar/0_m.jpg", "~/_data/avatar/" + _uID + "_m.jpg", true);
JumboTCMS.Utils.DirFile.CopyFile("~/_data/avatar/0_s.jpg", "~/_data/avatar/" + _uID + "_s.jpg", true);
#endregion
#region 同步升级为管理员
if (_adminname.Length > 0 && _adminpass.Length > 0)
{
_doh.Reset();
_doh.ConditionExpress = "id=" + _uID;
_doh.AddFieldItem("State", 1);
_doh.AddFieldItem("AdminState", 1);
_doh.AddFieldItem("AdminId", _uID);
_doh.AddFieldItem("AdminName", _adminname);
_doh.AddFieldItem("AdminPass", _md5pass2);
_doh.AddFieldItem("Group", site.AdminGroupId);
_doh.Update("jcms_normal_user");
_doh.Reset();
_doh.ConditionExpress = "id=" + site.AdminGroupId;
_doh.Add("jcms_normal_usergroup", "UserTotal");
}
else
{
_doh.Reset();
_doh.ConditionExpress = "id=1";
_doh.Add("jcms_normal_usergroup", "UserTotal");
}
#endregion
#region 论坛同步注册
if (site.ForumAPIKey != "")
{
string _ForumAutoRegister = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ForumAutoRegister");
if (_ForumAutoRegister == "true")//表示自动注册论坛用户
{
JumboTCMS.API.Discuz.Toolkit.DiscuzSession ds = JumboTCMS.API.Discuz.DiscuzSessionHelper.GetSession();
int _userid = ds.Register(_username, _userpass, _email, isMD5Passwd);
if (_userid > 0)
{
//注册成功
_doh.Reset();
_doh.ConditionExpress = "id=" + _uID;
_doh.AddFieldItem("ForumName", _username);
_doh.AddFieldItem("ForumPass", _md5pass);
_doh.Update("jcms_normal_user");
return _uID;
}
return 0;
}
return _uID;
}
#endregion
return _uID;
}
}
示例14: InsertTags
/// <summary>
/// 自动增添Tag标签到数据库
/// </summary>
/// <param name="_channelid">频道ID</param>
/// <param name="_tags">要增加的Tag,多个Tag以,隔开</param>
public void InsertTags(string _channelid, string _tags)
{
using (DbOperHandler _doh = new Common().Doh())
{
if (_tags.Length == 0) return;
string[] tag = _tags.Split(',');
for (int i = 0; i < tag.Length; i++)
{
if (!ExistTitle(tag[i].ToString(), "0", "ChannelId=" + _channelid))
{
_doh.Reset();
_doh.AddFieldItem("Title", tag[i].ToString());
_doh.AddFieldItem("ClickTimes", "0");
_doh.AddFieldItem("ChannelId", _channelid);
_doh.Insert("jcms_normal_tag");
}
}
}
}
示例15: ChangePsd
/// <summary>
/// 修改密码
/// </summary>
/// <param name="_id">用户ID</param>
/// <param name="_pass">修改后的密码</param>
public void ChangePsd(string _id, string _pass)
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.ConditionExpress = "id=" + _id;
_doh.AddFieldItem("UserPass", _pass);
_doh.Update("jcms_normal_user");
}
}