Exemple #1
0
 public void Add(M_VoteCategory model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Name", SqlDbType.NVarChar, 200), new SqlParameter("@Type", SqlDbType.Int, 4) };
     commandParameters[0].Value = model.Name;
     commandParameters[1].Value = 1;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_VoteCategory_Set", commandParameters);
 }
Exemple #2
0
 public M_VoteCategory GetCategory(int id)
 {
     M_VoteCategory category = new M_VoteCategory();
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@Type", SqlDbType.Int, 4) };
     commandParameters[0].Value = id;
     commandParameters[1].Value = 1;
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_VoteCategory_Get", commandParameters);
     if (table.Rows.Count > 0)
     {
         DataRow row = table.Rows[0];
         category.CategoryId = (int) row["CategoryId"];
         category.Name = row["Name"].ToString();
         return category;
     }
     return null;
 }
Exemple #3
0
 public void Update(M_VoteCategory model)
 {
     this.ivc.Update(model);
     B_Log.Add(LogType.Update, "修改投票分类成功 编号:" + model.CategoryId);
 }
Exemple #4
0
 public void Add(M_VoteCategory model)
 {
     this.ivc.Add(model);
     B_Log.Add(LogType.Add, "新增投票分类成功 分类名:" + model.Name);
 }