Beispiel #1
0
        private static VendorPO LoadOneRecord(DataTable dt)
        {
            VendorPO retVal = new VendorPO();

            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    retVal = (Load(dr));
                }
            }
            return(retVal);
        }
Beispiel #2
0
        public void UpdateVendorPO(VendorPO _VendorPO)
        {
            using (CustomSqlConnection connection = new CustomSqlConnection())
            {
                using (SqlCommand cmd = new SqlCommand("sp_UpdateVendorPO", connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new CustomSqlParameter("id_PurchOrder", SqlDbType.UniqueIdentifier, _VendorPO.id_PurchOrder));
                    cmd.Parameters.Add(new CustomSqlParameter("PurchOrderStatus", SqlDbType.NVarChar, _VendorPO.PurchOrderStatus));
                    cmd.Parameters.Add(new CustomSqlParameter("PurchDate", SqlDbType.DateTime, _VendorPO.PurchDate));
                    cmd.Parameters.Add(new CustomSqlParameter("PODeliveryDate", SqlDbType.DateTime, _VendorPO.PODeliveryDate));

                    cmd.ExecuteNonQuery();
                }
            }
        }
Beispiel #3
0
        private static VendorPO Load(DataRow dr)
        {
            VendorPO retVal = new VendorPO
            {
                id_PurchOrder        = dr["id_PurchOrder"].EnsureGuid(),
                PurchOrderCode       = dr["PurchOrderCode"].EnsureString(),
                VendCode             = dr["VendCode"].EnsureString(),
                PurchDate            = dr["PurchDate"].EnsureDate(),
                WarehouseCode        = dr["WarehouseCode"].EnsureString(),
                PurchOrdersequential = dr["PurchOrdersequential"].EnsureInt(),
                PurchOrderStatus     = dr["PurchOrderStatus"].EnsureString(),
                VendorEmail          = dr["VendorEmail"].EnsureString()
            };

            return(retVal);
        }