Beispiel #1
0
 //[001] code end
 /// <summary>
 /// Get
 /// Calls [usp_select_Contact]
 /// </summary>
 public static Contact Get(System.Int32?contactId)
 {
     Rebound.GlobalTrader.DAL.ContactDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Contact.Get(contactId);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Contact obj = new Contact();
         obj.ContactId           = objDetails.ContactId;
         obj.ContactName         = objDetails.ContactName;
         obj.Salutation          = objDetails.Salutation;
         obj.FirstName           = objDetails.FirstName;
         obj.LastName            = objDetails.LastName;
         obj.Telephone           = objDetails.Telephone;
         obj.Extension           = objDetails.Extension;
         obj.Fax                 = objDetails.Fax;
         obj.Title               = objDetails.Title;
         obj.EMail               = objDetails.EMail;
         obj.HomeTelephone       = objDetails.HomeTelephone;
         obj.MobileTelephone     = objDetails.MobileTelephone;
         obj.CompanyNo           = objDetails.CompanyNo;
         obj.Notes               = objDetails.Notes;
         obj.AddressNo           = objDetails.AddressNo;
         obj.ContactPositionNo   = objDetails.ContactPositionNo;
         obj.TextOnlyEmail       = objDetails.TextOnlyEmail;
         obj.Inactive            = objDetails.Inactive;
         obj.UpdatedBy           = objDetails.UpdatedBy;
         obj.DLUP                = objDetails.DLUP;
         obj.CompanyName         = objDetails.CompanyName;
         obj.FullName            = objDetails.FullName;
         obj.ClientNo            = objDetails.ClientNo;
         obj.Salesman            = objDetails.Salesman;
         obj.DefaultPOContactNo  = objDetails.DefaultPOContactNo;
         obj.DefaultSOContactNo  = objDetails.DefaultSOContactNo;
         obj.SalesmanName        = objDetails.SalesmanName;
         obj.TeamNo              = objDetails.TeamNo;
         obj.DivisionNo          = objDetails.DivisionNo;
         obj.HasSupplementalData = objDetails.HasSupplementalData;
         obj.HasUserDefinedData  = objDetails.HasUserDefinedData;
         //[001] code start
         obj.FinanceContact = objDetails.FinanceContact;
         //[001] code end
         objDetails = null;
         return(obj);
     }
 }
Beispiel #2
0
        //[001] code end
        #endregion

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

            if (reader.HasRows)
            {
                contact.ContactId           = GetReaderValue_Int32(reader, "ContactId", 0);                     //From: [Table]
                contact.ContactName         = GetReaderValue_String(reader, "ContactName", "");                 //From: [Table]
                contact.Salutation          = GetReaderValue_String(reader, "Salutation", "");                  //From: [Table]
                contact.FirstName           = GetReaderValue_String(reader, "FirstName", "");                   //From: [Table]
                contact.LastName            = GetReaderValue_String(reader, "LastName", "");                    //From: [Table]
                contact.Telephone           = GetReaderValue_String(reader, "Telephone", "");                   //From: [Table]
                contact.Extension           = GetReaderValue_String(reader, "Extension", "");                   //From: [Table]
                contact.Fax                 = GetReaderValue_String(reader, "Fax", "");                         //From: [Table]
                contact.Title               = GetReaderValue_String(reader, "Title", "");                       //From: [Table]
                contact.EMail               = GetReaderValue_String(reader, "EMail", "");                       //From: [Table]
                contact.HomeTelephone       = GetReaderValue_String(reader, "HomeTelephone", "");               //From: [Table]
                contact.MobileTelephone     = GetReaderValue_String(reader, "MobileTelephone", "");             //From: [Table]
                contact.CompanyNo           = GetReaderValue_NullableInt32(reader, "CompanyNo", null);          //From: [Table]
                contact.Notes               = GetReaderValue_String(reader, "Notes", "");                       //From: [Table]
                contact.AddressNo           = GetReaderValue_NullableInt32(reader, "AddressNo", null);          //From: [Table]
                contact.ContactPositionNo   = GetReaderValue_NullableInt32(reader, "ContactPositionNo", null);  //From: [Table]
                contact.TextOnlyEmail       = GetReaderValue_NullableBoolean(reader, "TextOnlyEmail", null);    //From: [Table]
                contact.Inactive            = GetReaderValue_Boolean(reader, "Inactive", false);                //From: [Table]
                contact.UpdatedBy           = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);          //From: [Table]
                contact.DLUP                = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);       //From: [Table]
                contact.CompanyName         = GetReaderValue_String(reader, "CompanyName", "");                 //From: [usp_datalistnugget_Contact]
                contact.SalesmanName        = GetReaderValue_String(reader, "SalesmanName", "");                //From: [usp_datalistnugget_Contact]
                contact.RowCnt              = GetReaderValue_NullableInt32(reader, "RowCnt", null);             //From: [usp_datalistnugget_Contact]
                contact.FullName            = GetReaderValue_String(reader, "FullName", "");                    //From: [usp_select_Contact]
                contact.ClientNo            = GetReaderValue_Int32(reader, "ClientNo", 0);                      //From: [usp_select_Contact]
                contact.Salesman            = GetReaderValue_NullableInt32(reader, "Salesman", null);           //From: [usp_select_Contact]
                contact.DefaultPOContactNo  = GetReaderValue_NullableInt32(reader, "DefaultPOContactNo", null); //From: [usp_select_Contact]
                contact.DefaultSOContactNo  = GetReaderValue_NullableInt32(reader, "DefaultSOContactNo", null); //From: [usp_select_Contact]
                contact.TeamNo              = GetReaderValue_NullableInt32(reader, "TeamNo", null);             //From: [usp_select_Contact]
                contact.DivisionNo          = GetReaderValue_NullableInt32(reader, "DivisionNo", null);         //From: [usp_select_Contact]
                contact.HasSupplementalData = GetReaderValue_Int32(reader, "HasSupplementalData", 0);           //From: [usp_select_Contact]
                contact.HasUserDefinedData  = GetReaderValue_Int32(reader, "HasUserDefinedData", 0);            //From: [usp_select_Contact]
                contact.DefaultPO           = GetReaderValue_NullableBoolean(reader, "DefaultPO", null);        //From: [usp_selectAll_Contact_for_Company]
                contact.DefaultSO           = GetReaderValue_NullableBoolean(reader, "DefaultSO", null);        //From: [usp_selectAll_Contact_for_Company]
            }
            return(contact);
        }
Beispiel #3
0
 /// <summary>
 /// GetForPage
 /// Calls [usp_select_Contact_for_Page]
 /// </summary>
 public static Contact GetForPage(System.Int32?contactId)
 {
     Rebound.GlobalTrader.DAL.ContactDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Contact.GetForPage(contactId);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Contact obj = new Contact();
         obj.ContactId   = objDetails.ContactId;
         obj.ContactName = objDetails.ContactName;
         obj.Inactive    = objDetails.Inactive;
         obj.CompanyNo   = objDetails.CompanyNo;
         obj.TeamNo      = objDetails.TeamNo;
         obj.DivisionNo  = objDetails.DivisionNo;
         obj.Salesman    = objDetails.Salesman;
         obj.ClientNo    = objDetails.ClientNo;
         objDetails      = null;
         return(obj);
     }
 }