Пример #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));
 }