private Entities.ExamCategory LoadSingleExamCategory(DataRow row) { Entities.ExamCategory model = new Entities.ExamCategory(); if (row["ECID"].ToString() != "") { model.ECID = int.Parse(row["ECID"].ToString()); } model.Name = row["Name"].ToString(); if (row["Type"].ToString() != "") { model.Type = int.Parse(row["Type"].ToString()); } if (row["Status"].ToString() != "") { model.Status = int.Parse(row["Status"].ToString()); } if (row["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(row["CreateTime"].ToString()); } if (row["CreateUserID"].ToString() != "") { model.CreateUserID = int.Parse(row["CreateUserID"].ToString()); } return(model); }
/// <summary> /// 根据分类ID获取分类名称 /// </summary> /// <param name="PagerID"></param> /// <returns></returns> public string GetCatageName(string PagerID) { string name = ""; int catageID = 0; if (int.TryParse(PagerID, out catageID)) { Entities.ExamCategory model = BLL.ExamCategory.Instance.GetExamCategory(catageID); if (model != null) { name = model.Name; } } return(name); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(SqlTransaction sqltran, Entities.ExamCategory model) { SqlParameter[] parameters = { new SqlParameter("@ECID", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 100), new SqlParameter("@Type", SqlDbType.Int, 4), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@CreateUserID", SqlDbType.Int, 4) }; parameters[0].Value = model.ECID; parameters[1].Value = model.Name; parameters[2].Value = model.Type; parameters[3].Value = model.Status; parameters[4].Value = model.CreateTime; parameters[5].Value = model.CreateUserID; return(SqlHelper.ExecuteNonQuery(sqltran, CONNECTIONSTRINGS, CommandType.StoredProcedure, P_EXAMCATEGORY_UPDATE, parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Insert(Entities.ExamCategory model) { SqlParameter[] parameters = { new SqlParameter("@ECID", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 100), new SqlParameter("@Type", SqlDbType.Int, 4), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@CreateUserID", SqlDbType.Int, 4) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = model.Name; parameters[2].Value = model.Type; parameters[3].Value = model.Status; parameters[4].Value = model.CreateTime; parameters[5].Value = model.CreateUserID; SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_EXAMCATEGORY_INSERT, parameters); return((int)parameters[0].Value); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(SqlTransaction sqltran, Entities.ExamCategory model) { return(Dal.ExamCategory.Instance.Update(sqltran, model)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Entities.ExamCategory model) { return(Dal.ExamCategory.Instance.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Insert(Entities.ExamCategory model) { return(Dal.ExamCategory.Instance.Insert(model)); }