Example #1
0
        //[001] code end
        #endregion

        /// <summary>
        /// Returns a new TermsDetails instance filled with the DataReader's current record data
        /// </summary>
        protected virtual TermsDetails GetTermsFromReader(DbDataReader reader)
        {
            TermsDetails terms = new TermsDetails();

            if (reader.HasRows)
            {
                terms.TermsId   = GetReaderValue_Int32(reader, "TermsId", 0);                 //From: [Table]
                terms.ClientNo  = GetReaderValue_Int32(reader, "ClientNo", 0);                //From: [Table]
                terms.Days      = GetReaderValue_Int32(reader, "Days", 0);                    //From: [Table]
                terms.TermsName = GetReaderValue_String(reader, "TermsName", "");             //From: [usp_datalistnugget_Company_as_Customers]
                terms.Buy       = GetReaderValue_Boolean(reader, "Buy", false);               //From: [Table]
                terms.Sell      = GetReaderValue_Boolean(reader, "Sell", false);              //From: [Table]
                terms.InAdvance = GetReaderValue_Boolean(reader, "InAdvance", false);         //From: [usp_selectAll_PurchaseOrderLine_Receiving_for_PurchaseOrder]
                terms.Inactive  = GetReaderValue_Boolean(reader, "Inactive", false);          //From: [Table]
                terms.UpdatedBy = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);    //From: [Table]
                terms.DLUP      = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue); //From: [Table]
            }
            return(terms);
        }
Example #2
0
 //[001] code end
 /// <summary>
 /// Get
 /// Calls [usp_select_Terms]
 /// </summary>
 public static Terms Get(System.Int32?termsId)
 {
     Rebound.GlobalTrader.DAL.TermsDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Terms.Get(termsId);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Terms obj = new Terms();
         obj.TermsId   = objDetails.TermsId;
         obj.ClientNo  = objDetails.ClientNo;
         obj.Days      = objDetails.Days;
         obj.TermsName = objDetails.TermsName;
         obj.Buy       = objDetails.Buy;
         obj.Sell      = objDetails.Sell;
         obj.InAdvance = objDetails.InAdvance;
         obj.Inactive  = objDetails.Inactive;
         obj.UpdatedBy = objDetails.UpdatedBy;
         obj.DLUP      = objDetails.DLUP;
         objDetails    = null;
         return(obj);
     }
 }