/// <summary>
        /// 根据ID查询产品试用申请信息
        /// </summary>
        /// <param name="con"></param>
        /// <returns></returns>
        public ProductTryOur_Table GetProductTryOurTableByConn(string con)
        {
            ProductTryOur_Table obj = null;
            SqlDataReader       dr  = DBHerlper.ExecuteReader(
                "Select * from ProductTryOur_Table where PTO_id=@PTO_id",
                CommandType.Text, new SqlParameter[] {
                new SqlParameter("@PTO_id", con)
            });

            if (dr.Read())
            {
                obj = new ProductTryOur_Table()
                {
                    E_id           = Convert.ToInt32(dr["E_id"]),
                    PTO_Activate   = Convert.ToInt32(dr["PTO_Activate"]),
                    PTO_ApplyFor   = Convert.ToDateTime(dr["PTO_ApplyFor"]),
                    PTO_AuditDate  = Convert.ToDateTime(dr["PTO_AuditDate"]),
                    PTO_ExpireDate = Convert.ToDateTime(dr["PTO_ExpireDate"]),
                    PTO_id         = Convert.ToInt32(dr["PTO_id"]),
                    TO_id          = Convert.ToInt32(dr["TO_id"]),
                    PTO_Remark     = dr["PTO_Remark"].ToString(),
                    PTO_Name       = dr["TO_id"].ToString(),
                    U_id           = Convert.ToInt32(dr["U_id"])
                };
            }
            dr.Close();
            return(obj);
        }
        /// <summary>
        /// 获取全部的产品试用申请
        /// </summary>
        /// <returns></returns>
        public List <ProductTryOur_Table> GetProductTryOurTableAll()
        {
            List <ProductTryOur_Table> list = new List <ProductTryOur_Table>();
            SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"),
                                                       CommandType.StoredProcedure);

            while (dr.Read())
            {
                ProductTryOur_Table obj = new ProductTryOur_Table()
                {
                    E_id           = Convert.ToInt32(dr["E_id"]),
                    PTO_Activate   = Convert.ToInt32(dr["PTO_Activate"]),
                    PTO_ApplyFor   = Convert.ToDateTime(dr["PTO_ApplyFor"]),
                    PTO_AuditDate  = Convert.ToDateTime(dr["PTO_AuditDate"]),
                    PTO_ExpireDate = Convert.ToDateTime(dr["PTO_ExpireDate"]),
                    PTO_id         = Convert.ToInt32(dr["PTO_id"]),
                    TO_id          = Convert.ToInt32(dr["TO_id"]),
                    PTO_Remark     = dr["PTO_Remark"].ToString(),
                    PTO_Name       = dr["TO_id"].ToString(),
                    U_id           = Convert.ToInt32(dr["U_id"])
                };
                list.Add(obj);
            }
            dr.Close();
            return(list);
        }
 /// <summary>
 /// 添加产品试用申请
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_ProductTryOurTableData(ProductTryOur_Table obj)
 {
     return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"),
                                      CommandType.StoredProcedure,
                                      new SqlParameter[] {
         new SqlParameter("@E_id", obj.E_id),
         new SqlParameter("@PTO_Activate", obj.PTO_Activate),
         new SqlParameter("@PTO_ApplyFor", obj.PTO_ApplyFor),
         new SqlParameter("@PTO_AuditDate", obj.PTO_AuditDate),
         new SqlParameter("@PTO_ExpireDate", obj.PTO_ExpireDate),
         new SqlParameter("@TO_id", obj.TO_id),
         new SqlParameter("@PTO_Remark", obj.PTO_Remark),
         new SqlParameter("@PTO_Name", obj.PTO_Name),
         new SqlParameter("@U_id", obj.U_id)
     }));
 }
Exemple #4
0
 /// <summary>
 /// 更改产品试用申请信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Update_ProductTryOurTableData(ProductTryOur_Table obj)
 {
     return(relevanceClass.Update_ProductTryOurTableData(obj));
 }
Exemple #5
0
 /// <summary>
 /// 添加产品试用申请信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_ProductTryOurTableData(ProductTryOur_Table obj)
 {
     return(relevanceClass.Insert_ProductTryOurTableData(obj));
 }