//Return one client contact that matches _UserID.  Return an empty ClientContact if the _UserID is not found.
        public static ClientContact GetClientContactFromUserID(int _UserID)
        {
            ClientContact             clientContacts = new ClientContact();
            ClientContactsDataContext dc             = new ClientContactsDataContext();
            var item = dc.S1_ClientContacts_GetClientContactFromUserID(_UserID).FirstOrDefault();

            if (item != null)
            {
                clientContacts = new ClientContact(item.ClientContactID, item.ClientContactName, item.ClientContactFirstName, item.ClientContactLastName,
                                                   item.ClientContactTitle, item.ClientContactAddress1, item.ClientContactAddress2, item.ClientContactCity, item.ClientContactStateCode,
                                                   item.ClientContactZIP, item.ClientContactBusinessPhone, item.ClientContactCellPhone, item.ClientContactFax, item.ClientContactEmail,
                                                   item.BillingContactName, item.IsPrimaryBillingContact1, item.OnlyShowInvoices, Convert.ToInt32(item.ClientID),
                                                   Convert.ToInt32(item.UserID), item.BillingDeliveryMethod, Convert.ToBoolean(item.IsBillingContact), item.LastLoginDate,
                                                   item.BillAsClientName, item.DueText, item.BillingContactAddress1, item.BillingContactAddress2, item.BillingContactCity,
                                                   item.BillingContactStateCode, item.BillingContactZIP, item.BillingContactEmail, item.BillingContactBusinessPhone, item.BillingContactFax,
                                                   item.BillingContactPOName, item.BillingContactPONumber, item.BillingContactNotes,
                                                   Convert.ToBoolean(item.ClientContactStatus), Convert.ToBoolean(item.BillingContactStatus), item.BillingContactID, item.LoginUserName);
            }
            else
            {
                clientContacts = new ClientContact();
            }

            return(clientContacts);
        }
Beispiel #2
0
        public BillingStatement(int _BillingContactID, DateTime _StartDate, DateTime _EndDate)
        {
            billingStatementRows = new List <BillingStatementRow>();

            BillingStatementDataContext dc = new BillingStatementDataContext();
            var result = dc.S1_BillingStatement_GetCurrentStatement(_BillingContactID, _StartDate, _EndDate);

            foreach (var item in result)
            {
                BillingStatementRow billingStatementRow = new BillingStatementRow(item.Date, item.InvoiceNumber,
                                                                                  item.Type, item.Amount.Value, item.LinkID);

                billingStatementRows.Add(billingStatementRow);
            }

            ClientContactsDataContext ccdc = new ClientContactsDataContext();

            billingContact = ClientContacts.GetClientContactFromBillingContactID(_BillingContactID);
        }
        public static List <ClientContact> GetClientContactsFromClientID(int _ClientID)
        {
            List <ClientContact>      clientContacts = new List <ClientContact>();
            ClientContactsDataContext dc             = new ClientContactsDataContext();
            var result = dc.S1_ClientContacts_GetClientContactsFromClientID(_ClientID);

            foreach (var item in result)
            {
                ClientContact tempClientContact = new ClientContact(item.ClientContactID, item.ClientContactName, item.ClientContactFirstName, item.ClientContactLastName,
                                                                    item.ClientContactTitle, item.ClientContactAddress1, item.ClientContactAddress2, item.ClientContactCity, item.ClientContactStateCode,
                                                                    item.ClientContactZIP, item.ClientContactBusinessPhone, item.ClientContactCellPhone, item.ClientContactFax, item.ClientContactEmail,
                                                                    item.BillingContactName, item.IsPrimaryBillingContact, item.OnlyShowInvoices, _ClientID, Convert.ToInt32(item.UserID),
                                                                    item.BillingDeliveryMethod, Convert.ToBoolean(item.IsBillingContact), item.LastLoginDate, item.BillAsClientName, item.DueText,
                                                                    item.BillingContactAddress1, item.BillingContactAddress2, item.BillingContactCity, item.BillingContactStateCode, item.BillingContactZIP,
                                                                    item.BillingContactEmail, item.BillingContactBusinessPhone, item.BillingContactFax, item.BillingContactPOName, item.BillingContactPONumber,
                                                                    item.BillingContactNotes, Convert.ToBoolean(item.ClientContactStatus), Convert.ToBoolean(item.BillingContactStatus), item.BillingContactID, item.LoginUserName);
                clientContacts.Add(tempClientContact);
            }

            return(clientContacts);
        }
Beispiel #4
0
 public BillingStatement()
 {
     billingStatementRows = new List <BillingStatementRow>();
     billingContact       = new ClientContact();
 }