コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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));
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(SqlTransaction sqltran, Entities.ExamCategory model)
 {
     return(Dal.ExamCategory.Instance.Update(sqltran, model));
 }
コード例 #6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Entities.ExamCategory model)
 {
     return(Dal.ExamCategory.Instance.Update(model));
 }
コード例 #7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Insert(Entities.ExamCategory model)
 {
     return(Dal.ExamCategory.Instance.Insert(model));
 }