Ejemplo n.º 1
0
 public OrderPart(int id, int len, int width, int num)
 {
     Product     = new Model.Rectange(len, width);
     ProductNum  = num;
     ProductType = id;
     AllItem     = new List <Model.PartItem>();
     Part        = new Model.OrderPart();
     Part.Num    = num;
 }
Ejemplo n.º 2
0
        public Model.OrderPart FindOrderPartByOrderPartOID(int OrderPartOID)
        {
            string strCmd = @"SELECT [OrderPartOID], [OrderID], [PartNumber], [PartName], [PartSpec], [PartUnitName], [UnitPrice]
                                                FROM [dbo].[OrderPart]
                                                where [OrderPartOID] = @OrderPartOID";
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(SqlHelper.CreateParameter("@OrderPartOID", SqlDbType.Int, OrderPartOID));
            DataTable dt = SqlHelper.AdapterFill(strCmd, parameters);

            if (dt.Rows.Count == 0)
            {
                return(null);
            }

            Model.OrderPart op = this.GetOrderPart(dt.Rows[0]);
            return(op);
        }
Ejemplo n.º 3
0
 private Model.OrderPart GetOrderPart(DataRow dr)
 {
     if (dr == null)
     {
         return(null);
     }
     Model.OrderPart op = new Model.OrderPart();
     op.OrderPartOID = Convert.ToInt32(dr["OrderPartOID"]);
     op.OrderID      = Convert.ToString(dr["OrderID"]);
     op.PartNumber   = Convert.ToString(dr["PartNumber"]);
     op.PartName     = Convert.ToString(dr["PartName"]);
     op.PartSpec     = Convert.ToString(dr["PartSpec"]);
     op.PartUnitName = Convert.ToString(dr["PartUnitName"]);
     if (!SqlHelper.IsNull(dr["UnitPrice"]))
     {
         op.UnitPrice = Convert.ToInt32(dr["UnitPrice"]);
     }
     return(op);
 }