Beispiel #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static Hashtable Update(WE_Project.Model.EPJX model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update EPJX set ");
            strSql.Append("EPJXTime=@EPJXTime,");
            strSql.Append("EPJXRemark=@EPJXRemark,");
            strSql.Append("EPJXMID=@EPJXMID");
            strSql.Append(" where JXID=@JXID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EPJXTime",   SqlDbType.DateTime),
                new SqlParameter("@EPJXRemark", SqlDbType.VarChar,  200),
                new SqlParameter("@EPJXMID",    SqlDbType.VarChar,   50),
                new SqlParameter("@JXID",       SqlDbType.Int, 4)
            };
            parameters[0].Value = model.EPJXTime;
            parameters[1].Value = model.EPJXRemark;
            parameters[2].Value = model.EPJXMID;
            parameters[3].Value = model.JXID;

            strSql.AppendFormat(" ;select '{0}'", guid);

            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
Beispiel #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Insert(WE_Project.Model.EPJX model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into EPJX(");
            strSql.Append("EPJXTime,EPJXRemark,EPJXMID)");
            strSql.Append(" values (");
            strSql.Append("@EPJXTime,@EPJXRemark,@EPJXMID)");
            strSql.AppendFormat(" ;select '{0}'", guid);
            SqlParameter[] parameters =
            {
                new SqlParameter("@EPJXTime",   SqlDbType.DateTime),
                new SqlParameter("@EPJXRemark", SqlDbType.VarChar, 200),
                new SqlParameter("@EPJXMID",    SqlDbType.VarChar, 50)
            };
            parameters[0].Value = model.EPJXTime;
            parameters[1].Value = model.EPJXRemark;
            parameters[2].Value = model.EPJXMID;

            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
Beispiel #3
0
        /// <summary>
        ///  实体转换
        /// <summary>
        private static WE_Project.Model.EPJX TranEntity(DataRow dr)
        {
            if (dr != null)
            {
                WE_Project.Model.EPJX model = new WE_Project.Model.EPJX();

                if (!string.IsNullOrEmpty(dr["EPJXTime"].ToString()))
                {
                    model.EPJXTime = DateTime.Parse(dr["EPJXTime"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["JXID"].ToString()))
                {
                    model.JXID = int.Parse(dr["JXID"].ToString());
                }
                model.EPJXRemark = dr["EPJXRemark"].ToString();
                model.EPJXMID    = dr["EPJXMID"].ToString();

                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #4
0
 public static bool Update(WE_Project.Model.EPJX model)
 {
     return(WE_Project.DAL.EPJX.Update(model));
 }
Beispiel #5
0
 public static Hashtable Update(WE_Project.Model.EPJX model, Hashtable MyHs)
 {
     return(WE_Project.DAL.EPJX.Update(model, MyHs));
 }
Beispiel #6
0
 public static bool Insert(WE_Project.Model.EPJX model)
 {
     return(WE_Project.DAL.EPJX.Insert(model));
 }
Beispiel #7
0
 public static Hashtable Insert(WE_Project.Model.EPJX model, Hashtable MyHs)
 {
     return(WE_Project.DAL.EPJX.Insert(model, MyHs));
 }
Beispiel #8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static bool Insert(WE_Project.Model.EPJX model)
 {
     return(DAL.CommonBase.RunHashtable(Insert(model, new Hashtable())));
 }
Beispiel #9
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static bool Update(WE_Project.Model.EPJX model)
 {
     return(DAL.CommonBase.RunHashtable(Update(model, new Hashtable())));
 }