/// <summary> /// 删除时,改变状态,不显示出来 /// </summary> /// <returns></returns> public int UpdateDelete(int id) { int num = 0; string sql = "update CompanyTab set IsDelete=1 where CompanyID=@id"; SqlParameter[] para = { new SqlParameter("@id", SqlDbType.Int, 4) }; para[0].Value = id; num = Convert.ToInt32(crm.GetSingle(sql, para)); return(num); }
/// <summary> /// 判断是否发布了企业名片 /// </summary> /// <param name="name"></param> /// <returns></returns> public int IfCompany(string name) { int num = 0; string sql = "select count(CompanyID) from CompanyTab where LoginName=@name"; SqlParameter[] para = { new SqlParameter("@name", SqlDbType.VarChar, 50) }; para[0].Value = name; num = Convert.ToInt32(crm.GetSingle(sql, para)); return(num); }
/// <summary> /// 添加访问者信息 /// </summary> /// <param name="InfoID">项目所对应的InfoID</param> /// <param name="Name">访问者</param> /// <param name="Time">访问时间</param> /// <param name="Ip">访问IP</param> /// <param name="Proince">访问者所在省名</param> /// <returns></returns> public int AccessInsert(string InfoID, string Name, string Time, string Ip, string Proince) { string sql = "insert into AccessInfoTab(InfoID,AccessName,AccessTime,AccessIP,ProinceID) values " + "(@InfoID,@Name,@Time,@Ip,@Proince)"; SqlParameter[] para = { new SqlParameter("@InfoID", SqlDbType.VarChar, 20), new SqlParameter("@Name", SqlDbType.VarChar, 50), new SqlParameter("@Time", SqlDbType.VarChar, 50), new SqlParameter("@Ip", SqlDbType.VarChar, 50), new SqlParameter("@Proince", SqlDbType.VarChar, 50) }; para[0].Value = InfoID; para[1].Value = Name; para[2].Value = Time; para[3].Value = Ip; para[4].Value = Proince; int count = Convert.ToInt32(crm.GetSingle(sql, para)); return(count); }
public int AddPromotion(int id, string name, string remark) { int num = 0; string sql = "INSERT INTO [PromotionInfoTab] ([Coding],[PromotionName] ,[Remark]) VALUES " + "(@id,@name,@remark)"; SqlParameter[] para = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@name", SqlDbType.VarChar, 50), new SqlParameter("@remark", SqlDbType.VarChar, 1000) }; para[0].Value = id; para[1].Value = name; para[2].Value = remark; num = Convert.ToInt32(crm.GetSingle(sql, para)); return(num); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Tz888.Model.Recomm.recommResourceM model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into recommResource("); strSql.Append("ResourceId,ResourceTitle,ResourceTypeId,ResourceUrl,RecommName,RecommToUser,RecommDate)"); strSql.Append(" values ("); strSql.Append("@ResourceId,@ResourceTitle,@ResourceTypeId,@ResourceUrl,@RecommName,@RecommToUser,getdate())"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ResourceId", SqlDbType.BigInt, 8), new SqlParameter("@ResourceTitle", SqlDbType.VarChar, 200), new SqlParameter("@ResourceTypeId", SqlDbType.Int, 4), new SqlParameter("@ResourceUrl", SqlDbType.VarChar, 100), new SqlParameter("@RecommName", SqlDbType.VarChar, 50), new SqlParameter("@RecommToUser", SqlDbType.VarChar, 50) //new SqlParameter("@RecommDate", SqlDbType.DateTime) }; parameters[0].Value = model.ResourceId; parameters[1].Value = model.ResourceTitle; parameters[2].Value = model.ResourceTypeId; parameters[3].Value = model.ResourceUrl; parameters[4].Value = model.RecommName; parameters[5].Value = model.RecommToUser; //parameters[6].Value = model.RecommDate; object obj = crm.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }