示例#1
0
 private Model.PurchasingOrder GetPurchasingOrder(DataRow dr)
 {
     if (dr == null)
     {
         return(null);
     }
     Model.PurchasingOrder po = new Model.PurchasingOrder();
     po.PurchasingOrderOID = Convert.ToInt32(dr["PurchasingOrderOID"]);
     po.PurchasingOrderID  = Convert.ToString(dr["PurchasingOrderID"]);
     po.EmployeeID         = Convert.ToString(dr["EmployeeID"]);
     po.POBeginDate        = Convert.ToDateTime(dr["POBeginDate"]);
     return(po);
 }
示例#2
0
        public Model.PurchasingOrder FindPurchasingOrderByPurchasingOrderID(string PurchasingOrderID)
        {
            string strCmd = @"SELECT PurchasingOrderOID, PurchasingOrderID, EmployeeID, POBeginDate
                                        FROM PurchasingOrder
                                        where PurchasingOrderID = @PurchasingOrderID ";
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(SqlHelper.CreateParameter("@PurchasingOrderID", SqlDbType.VarChar, 14, PurchasingOrderID));
            DataTable dt = SqlHelper.AdapterFill(strCmd, parameters);

            if (dt.Rows.Count == 0)
            {
                return(null);
            }
            Model.PurchasingOrder po = this.GetPurchasingOrder(dt.Rows[0]);
            return(po);
        }