/// <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); } }
/// <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); }
/// <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); }
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)); }
public static bool Update(Model.IPClick model) { return(yny_005.DAL.IPClick.Update(model)); }
public static Hashtable Update(Model.IPClick model, Hashtable MyHs) { return(yny_005.DAL.IPClick.Update(model, MyHs)); }
public static bool Insert(Model.IPClick model) { return(yny_005.DAL.IPClick.Insert(model)); }
public static Hashtable Insert(Model.IPClick model, Hashtable MyHs) { return(yny_005.DAL.IPClick.Insert(model, MyHs)); }
/// <summary> /// 增加一条数据 /// </summary> public static bool Insert(Model.IPClick model) { return(DAL.CommonBase.RunHashtable(Insert(model, new Hashtable()))); }
/// <summary> /// 更新一条数据 /// </summary> public static bool Update(Model.IPClick model) { return(DAL.CommonBase.RunHashtable(Update(model, new Hashtable()))); }
public static bool Update(Model.IPClick model) { return(WE_Project.DAL.IPClick.Update(model)); }
public static Hashtable Update(Model.IPClick model, Hashtable MyHs) { return(WE_Project.DAL.IPClick.Update(model, MyHs)); }
public static bool Insert(Model.IPClick model) { return(WE_Project.DAL.IPClick.Insert(model)); }
public static Hashtable Insert(Model.IPClick model, Hashtable MyHs) { return(WE_Project.DAL.IPClick.Insert(model, MyHs)); }