示例#1
0
        /// <summary>
        ///  实体转换
        /// <summary>
        private static Model.IPClick TranEntity(DataRow dr)
        {
            if (dr != null)
            {
                Model.IPClick model = new Model.IPClick();

                if (!string.IsNullOrEmpty(dr["Id"].ToString()))
                {
                    model.Id = int.Parse(dr["Id"].ToString());
                }
                model.MID = dr["MID"].ToString();
                model.IP  = dr["IP"].ToString();
                if (!string.IsNullOrEmpty(dr["ClickTime"].ToString()))
                {
                    model.ClickTime = DateTime.Parse(dr["ClickTime"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["Money"].ToString()))
                {
                    model.Money = decimal.Parse(dr["Money"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static Hashtable Update(Model.IPClick model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update IPClick set ");

            strSql.Append(" MID = @MID , ");
            strSql.Append(" IP = @IP , ");
            strSql.Append(" ClickTime = @ClickTime , ");
            strSql.Append(" Money = @Money  ");
            strSql.Append(" where Id=@Id ");
            strSql.AppendFormat(" ;select '{0}'", guid);

            SqlParameter[] parameters =
            {
                new SqlParameter("@Id",        SqlDbType.Int,        4),
                new SqlParameter("@MID",       SqlDbType.VarChar,   50),
                new SqlParameter("@IP",        SqlDbType.VarChar,   20),
                new SqlParameter("@ClickTime", SqlDbType.DateTime),
                new SqlParameter("@Money",     SqlDbType.Decimal, 9)
            };

            parameters[0].Value = model.Id;
            parameters[1].Value = model.MID;
            parameters[2].Value = model.IP;
            parameters[3].Value = model.ClickTime;
            parameters[4].Value = model.Money;
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
示例#3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Insert(Model.IPClick model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into IPClick(");
            strSql.Append("MID,IP,ClickTime,Money");
            strSql.Append(") values (");
            strSql.Append("@MID,@IP,@ClickTime,@Money");
            strSql.Append(") ");
            strSql.AppendFormat(";select '{0}'", guid);
            SqlParameter[] parameters =
            {
                new SqlParameter("@MID",       SqlDbType.VarChar,   50),
                new SqlParameter("@IP",        SqlDbType.VarChar,   20),
                new SqlParameter("@ClickTime", SqlDbType.DateTime),
                new SqlParameter("@Money",     SqlDbType.Decimal, 9)
            };

            parameters[0].Value = model.MID;
            parameters[1].Value = model.IP;
            parameters[2].Value = model.ClickTime;
            parameters[3].Value = model.Money;
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
示例#4
0
 public static bool AddIP(string mid, string ip)
 {
     Model.IPClick mm = new Model.IPClick();
     mm.MID       = mid;
     mm.IP        = ip;
     mm.ClickTime = DateTime.Now;
     return(Insert(mm));
 }
示例#5
0
 public static bool Update(Model.IPClick model)
 {
     return(yny_005.DAL.IPClick.Update(model));
 }
示例#6
0
 public static Hashtable Update(Model.IPClick model, Hashtable MyHs)
 {
     return(yny_005.DAL.IPClick.Update(model, MyHs));
 }
示例#7
0
 public static bool Insert(Model.IPClick model)
 {
     return(yny_005.DAL.IPClick.Insert(model));
 }
示例#8
0
 public static Hashtable Insert(Model.IPClick model, Hashtable MyHs)
 {
     return(yny_005.DAL.IPClick.Insert(model, MyHs));
 }
示例#9
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static bool Insert(Model.IPClick model)
 {
     return(DAL.CommonBase.RunHashtable(Insert(model, new Hashtable())));
 }
示例#10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static bool Update(Model.IPClick model)
 {
     return(DAL.CommonBase.RunHashtable(Update(model, new Hashtable())));
 }
示例#11
0
 public static bool Update(Model.IPClick model)
 {
     return(WE_Project.DAL.IPClick.Update(model));
 }
示例#12
0
 public static Hashtable Update(Model.IPClick model, Hashtable MyHs)
 {
     return(WE_Project.DAL.IPClick.Update(model, MyHs));
 }
示例#13
0
 public static bool Insert(Model.IPClick model)
 {
     return(WE_Project.DAL.IPClick.Insert(model));
 }
示例#14
0
 public static Hashtable Insert(Model.IPClick model, Hashtable MyHs)
 {
     return(WE_Project.DAL.IPClick.Insert(model, MyHs));
 }