Esempio n. 1
0
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="produce">产品实体集</param>
        /// <returns>修改结果</returns>
        public int Update(Tunnel.Model.Tunnel_Produce produce)
        {
            string strSQL = string.Format("UPDATE Tunnel_Produce SET ProName='{1}',ModiDate='{2}',ModiUser={3} WHERE ProID={0} AND ProState='N'",
                                          +produce.ProID, produce.ProName, produce.ModiDate, produce.ModiUser);
            object obj = DbHelperSQL.ExecuteSql(strSQL);

            if (null != obj)
            {
                return(Convert.ToInt32(obj));
            }
            else
            {
                return(0);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 新增一条数据
        /// </summary>
        /// <param name="produce">实体集</param>
        /// <returns>新增结果</returns>
        public int Add(Tunnel.Model.Tunnel_Produce produce)
        {
            string strSQL = string.Format("INSERT INTO Tunnel_Produce (ProType,ProTitle,ProName,ProSrc,CreateDate,CreateUser,ProState) "
                                          + "VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", produce.ProType, produce.ProTitle, produce.ProName, produce.ProSrc, produce.CreateDate, produce.CreateUser, produce.ProState);
            object obj = DbHelperSQL.ExecuteSql(strSQL);

            if (null != obj)
            {
                return(Convert.ToInt32(obj));
            }
            else
            {
                return(0);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获得产品实体集
        /// </summary>
        /// <param name="proID">产品编号</param>
        /// <returns>产品实体集</returns>
        public Tunnel.Model.Tunnel_Produce GetProduceModel(int proID)
        {
            Tunnel.Model.Tunnel_Produce produce = new Tunnel.Model.Tunnel_Produce();
            string strSQL = string.Format("SELECT ProID,ProType,ProTitle,ProName,ProSrc FROM Tunnel_Produce WHERE ProID={0}", proID);

            using (SqlDataReader reader = DbHelperSQL.ExecuteReader(strSQL))
            {
                if (reader.Read())
                {
                    produce.ProID    = Convert.ToInt32(reader["ProID"]);
                    produce.ProType  = reader["ProType"].ToString().Trim();
                    produce.ProTitle = reader["ProType"].ToString().Trim();
                    produce.ProName  = reader["ProName"].ToString().Trim();
                    produce.ProSrc   = reader["ProSrc"].ToString().Trim();
                }
            }
            return(produce);
        }
Esempio n. 4
0
        /// <summary>
        /// 获得分页集合
        /// </summary>
        /// <param name="pb">页类</param>
        /// <param name="count">总数</param>
        /// <returns>集合</returns>
        public List <Tunnel.Model.Tunnel_Produce> GetList(PageBase pb, ref int count)
        {
            DataTable dt = m_Produce.GetList(pb, ref count).Tables[0];
            List <Tunnel.Model.Tunnel_Produce> modelList = new List <Tunnel.Model.Tunnel_Produce>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0 && pb.DoCount == 0)
            {
                Tunnel.Model.Tunnel_Produce model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model            = new Tunnel.Model.Tunnel_Produce();
                    model.ProID      = Convert.ToInt32(dt.Rows[n]["ProID"].ToString());
                    model.ProName    = dt.Rows[n]["ProName"].ToString();
                    model.ProTitle   = dt.Rows[n]["ProTitle"].ToString();
                    model.ProType    = dt.Rows[n]["ProType"].ToString();
                    model.ProSrc     = dt.Rows[n]["ProSrc"].ToString();
                    model.CreateUser = Convert.ToInt32(dt.Rows[n]["CreateUser"].ToString());
                    model.CreateDate = Convert.ToDateTime(dt.Rows[n]["CreateDate"]);
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 5
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="produce">产品实体集</param>
 /// <returns>修改结果</returns>
 public int Update(Tunnel.Model.Tunnel_Produce produce)
 {
     return(m_Produce.Update(produce));
 }
Esempio n. 6
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="produce">产品实体集</param>
 /// <returns>添加结果</returns>
 public int Add(Tunnel.Model.Tunnel_Produce produce)
 {
     return(m_Produce.Add(produce));
 }