public static void InsertAnalyseItemLog(string group_item_id, string start_name, string end_name, string EditdepartName) { //exec p_insert_mon_analyse_item_log @group_item_id='B5C417D2-A8A0-47CB-A46E-83B46DD03B28',@analyse_person=N'',@analyse_time=''2014-05-26 13:10:31:313'',@edit_person=N'',@edit_time=''2014-05-26 13:10:31:313'',@edit_person_department=N'',@action_type=N'修改',@remark=N'' SqlParameter[] parmeters = { new SqlParameter("@group_item_id", SqlDbType.UniqueIdentifier), new SqlParameter("@analyse_person", SqlDbType.VarChar, 350), new SqlParameter("@analyse_time", SqlDbType.DateTime), new SqlParameter("@edit_person", SqlDbType.VarChar, 50), new SqlParameter("@edit_time", SqlDbType.DateTime), new SqlParameter("@edit_person_department", SqlDbType.VarChar, 50), new SqlParameter("@action_type", SqlDbType.VarChar, 50), new SqlParameter("@remark", SqlDbType.VarChar, 4000) }; parmeters[0].Value = new Guid(group_item_id); parmeters[1].Value = start_name; parmeters[2].Value = DateTime.Now; parmeters[3].Value = end_name; parmeters[4].Value = DateTime.Now; parmeters[5].Value = EditdepartName; parmeters[6].Value = "修改"; parmeters[7].Value = ""; adoHelper.ExecuteSPNonQuery("p_insert_mon_analyse_item_log", parmeters); //v_mon_analyse_item_log }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LinkCategoryModel model) { SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 8), new SqlParameter("@Category", SqlDbType.VarChar, 50), new SqlParameter("@AddedDate", SqlDbType.DateTime), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@Type", SqlDbType.Int, 4) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = model.Category; parameters[2].Value = model.AddedDate; parameters[3].Value = model.Sort; parameters[4].Value = model.Type; adoHelper.ExecuteSPNonQuery("sp_LinkCategory_Add", parameters); return((int)parameters[0].Value); }
/// <summary> /// 删除类别表信息 /// </summary> /// <param name="categoryId">类别编号</param> /// <returns></returns> public bool DeleteCategory(int categoryId) { SqlParameter[] parm = { new SqlParameter("@TopicsCategoryId", SqlDbType.Int, 4), new SqlParameter("@Return", SqlDbType.Int, 4) }; parm[0].Value = categoryId; parm[1].Direction = ParameterDirection.Output; adoHelper.ExecuteSPNonQuery("sp_TopicsCategory_Del", parm); return(Convert.ToBoolean(parm[1].Value)); }
/// <summary> /// 返回节点集string /// </summary> /// <param name="CategoryId">节点</param> /// <returns></returns> public static string GetChildNodes(string CategoryId) { AdoHelper adoHelper = AdoHelper.CreateHelper("DB_Instance"); SqlParameter[] parameters = { new SqlParameter("@CategoryId", SqlDbType.Int, 4), new SqlParameter("@Nodes", SqlDbType.VarChar, 1000) }; parameters[0].Value = CategoryId; parameters[1].Direction = ParameterDirection.Output; adoHelper.ExecuteSPNonQuery("sp_GetChildNodes", parameters); return(parameters[1].Value.ToString()); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LinkModel model) { SqlParameter[] parameters = { new SqlParameter("@LinkId", SqlDbType.BigInt, 8), new SqlParameter("@Title", SqlDbType.VarChar, 50), new SqlParameter("@Link", SqlDbType.VarChar, 100), new SqlParameter("@Image", SqlDbType.VarChar, 100), new SqlParameter("@DisplayMode", SqlDbType.Int, 4), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@CategoryId", SqlDbType.Int, 4) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = model.Title; parameters[2].Value = model.Link; parameters[3].Value = model.Image; parameters[4].Value = model.DisplayMode; parameters[5].Value = model.Sort; parameters[6].Value = model.CategoryId; return(adoHelper.ExecuteSPNonQuery("sp_Link_Add", parameters)); return((int)parameters[0].Value); }
/// <summary> /// 添加日志 /// </summary> /// <param name="userId">用户标识</param> /// <param name="ip">登陆用户所在机子的IP地址</param> /// <param name="url">引发日志操作所在的页面地址</param> /// <param name="description">操作描述</param> /// <returns>添加成功,返回日志标识,否则返回-1</returns> public int Add(int userId, string ip, string url, string description) { AdoHelper helper = AdoHelper.CreateHelper("DB_Instance"); SqlParameter[] paras = new SqlParameter[5]; paras[0] = new SqlParameter("@UserId", userId); paras[1] = new SqlParameter("@IP", ip); paras[2] = new SqlParameter("@Url", url); paras[3] = new SqlParameter("@Description", description); paras[4] = new SqlParameter("@LogId", SqlDbType.Int, 4); paras[4].Direction = ParameterDirection.Output; if (helper.ExecuteSPNonQuery("sp_Log_Add", (IDataParameter[])paras) == 1) { return((int)paras[4].Value); } return(-1); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(NewsModel model) { SqlParameter[] parameters = { new SqlParameter("@NewsID", SqlDbType.Int, 4), new SqlParameter("@Title", SqlDbType.VarChar, 100), new SqlParameter("@SubHead", SqlDbType.VarChar, 100), new SqlParameter("@Body", SqlDbType.Text), new SqlParameter("@AddedUserId", SqlDbType.Int, 4), new SqlParameter("@PublicationUnit", SqlDbType.VarChar, 50), new SqlParameter("@AddedDate", SqlDbType.DateTime), new SqlParameter("@IsTop", SqlDbType.Int, 4), new SqlParameter("@IndexCommend", SqlDbType.Int, 4), new SqlParameter("@ArticleType", SqlDbType.Int, 4), new SqlParameter("@ReleaseDate", SqlDbType.DateTime), new SqlParameter("@ExpireDate", SqlDbType.DateTime), new SqlParameter("@CategoryId", SqlDbType.Int, 4), new SqlParameter("@Approved", SqlDbType.Int, 4), new SqlParameter("@ViewCount", SqlDbType.Int, 4), new SqlParameter("@ImgLink", SqlDbType.VarChar, 500), new SqlParameter("@IsState", SqlDbType.Int, 4), new SqlParameter("@HotPic", SqlDbType.VarChar, 100), new SqlParameter("@KeyWord", SqlDbType.VarChar, 500), new SqlParameter("@HotDays", SqlDbType.Int, 4), new SqlParameter("@FromSource", SqlDbType.VarChar, 50), new SqlParameter("@IsComment", SqlDbType.Int, 4), new SqlParameter("@IsScrool", SqlDbType.Int, 4), new SqlParameter("@Period", SqlDbType.VarChar, 100), new SqlParameter("@Leaderid", SqlDbType.Int, 4), new SqlParameter("@ShareToPlatform", SqlDbType.VarChar, 50), new SqlParameter("@ShareToSubject", SqlDbType.VarChar, 1000), new SqlParameter("@ShareToMarket", SqlDbType.VarChar, 1000) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = model.Title; parameters[2].Value = model.SubHead; parameters[3].Value = model.Body; parameters[4].Value = model.AddedUserId; parameters[5].Value = model.PublicationUnit; parameters[6].Value = model.AddedDate; parameters[7].Value = model.IsTop; parameters[8].Value = model.IndexCommend; parameters[9].Value = model.ArticleType; parameters[10].Value = model.ReleaseDate; parameters[11].Value = model.ExpireDate; parameters[12].Value = model.CategoryId; parameters[13].Value = model.Approved; parameters[14].Value = model.ViewCount; parameters[15].Value = model.ImgLink; parameters[16].Value = model.IsState; parameters[17].Value = model.HotPic; parameters[18].Value = model.KeyWord; parameters[19].Value = model.HotDays; parameters[20].Value = model.FromSource; parameters[21].Value = model.IsComment; parameters[22].Value = model.IsScrool; parameters[23].Value = model.Period; parameters[24].Value = model.Leaderid; parameters[25].Value = model.ShareToPlatform; parameters[26].Value = model.ShareToSubject; parameters[27].Value = model.ShareToMarket; adoHelper.ExecuteSPNonQuery("sp_News_Add", parameters); return((int)parameters[0].Value); }