private Entities.CustHistoryTemplateMapping LoadSingleCustHistoryTemplateMapping(DataRow row)
        {
            Entities.CustHistoryTemplateMapping model = new Entities.CustHistoryTemplateMapping();

            if (row["RecID"].ToString() != "")
            {
                model.RecID = long.Parse(row["RecID"].ToString());
            }
            model.TaskID = row["TaskID"].ToString();
            if (row["TemplateID"].ToString() != "")
            {
                model.TemplateID = int.Parse(row["TemplateID"].ToString());
            }
            if (row["SolveUserEID"].ToString() != "")
            {
                model.SolveUserEID = int.Parse(row["SolveUserEID"].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>
        ///  更新一条数据
        /// </summary>
        public int Update(Entities.CustHistoryTemplateMapping model)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@RecID",        SqlDbType.BigInt,     8),
                new SqlParameter("@TaskID",       SqlDbType.VarChar,   20),
                new SqlParameter("@TemplateID",   SqlDbType.Int,        4),
                new SqlParameter("@SolveUserEID", SqlDbType.Int,        4),
                new SqlParameter("@CreateTime",   SqlDbType.DateTime),
                new SqlParameter("@CreateUserID", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.RecID;
            parameters[1].Value = model.TaskID;
            parameters[2].Value = model.TemplateID;
            parameters[3].Value = model.SolveUserEID;
            parameters[4].Value = model.CreateTime;
            parameters[5].Value = model.CreateUserID;

            return(SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_CUSTHISTORYTEMPLATEMAPPING_UPDATE, parameters));
        }
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Insert(Entities.CustHistoryTemplateMapping model)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@RecID",        SqlDbType.Int,        8),
                new SqlParameter("@TaskID",       SqlDbType.VarChar,   20),
                new SqlParameter("@TemplateID",   SqlDbType.Int,        4),
                new SqlParameter("@SolveUserEID", SqlDbType.Int,        4),
                new SqlParameter("@CreateTime",   SqlDbType.DateTime),
                new SqlParameter("@CreateUserID", SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.TaskID;
            parameters[2].Value     = model.TemplateID;
            parameters[3].Value     = model.SolveUserEID;
            parameters[4].Value     = model.CreateTime;
            parameters[5].Value     = model.CreateUserID;

            SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_CUSTHISTORYTEMPLATEMAPPING_INSERT, parameters);
            return((int)parameters[0].Value);
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Entities.CustHistoryTemplateMapping model)
 {
     return(Dal.CustHistoryTemplateMapping.Instance.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Insert(Entities.CustHistoryTemplateMapping model)
 {
     return(Dal.CustHistoryTemplateMapping.Instance.Insert(model));
 }