public IList <PermanentCustomerNote> LoadPermanentCustomerNote(int customerId)
        {
            IList <PermanentCustomerNote> permanentNotes = new List <PermanentCustomerNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesPermanent_LoadByCustomerID",
                                                                          CreateCustomerIdParameter(customerId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        PermanentCustomerNote permanentCustomerNote =
                            new PermanentCustomerNote(cleverReader.FromBigInteger("NotesID"),
                                                      cleverReader.ToDate("Created"),
                                                      parsedNotes,
                                                      cleverReader.ToInteger("CreatedBy"),
                                                      cleverReader.ToString("EmployeeName"),
                                                      cleverReader.ToInteger("ModifiedBy"),
                                                      cleverReader.ToString("ModifiedByEmployeeName"),
                                                      cleverReader.ToDate("Modified"));
                        permanentNotes.Add(permanentCustomerNote);
                    }
                }
            }

            return(permanentNotes);
        }
        private IList <CustomerNote> ExecuteLoadCustomerNotes(SqlParameter[] sqlParameters)
        {
            IList <CustomerNote> customerNotes = new List <CustomerNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesCurrent_GetCustomerNotes",
                                                                          sqlParameters))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (!cleverReader.IsNull && cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        CustomerNote customerNote = new CustomerNote(cleverReader.FromBigInteger("NotesID"),
                                                                     cleverReader.ToDate("Created"),
                                                                     ActivityType.Parse(cleverReader.ToInteger("ActivityTypeId")),
                                                                     NoteType.Parse(cleverReader.ToInteger("NoteTypeId")),
                                                                     parsedNotes,
                                                                     cleverReader.ToInteger("CreatedBy"),
                                                                     cleverReader.ToString("EmployeeName"),
                                                                     cleverReader.ToInteger("ModifiedBy"),
                                                                     cleverReader.ToString("ModifiedByEmployeeName"),
                                                                     cleverReader.ToDate("Modified")
                                                                     );
                        customerNotes.Add(customerNote);
                    }
                }
            }
            return(customerNotes);
        }
Ejemplo n.º 3
0
        public ICffClient GetCffClientByClientId(int clientId)
        {
            ICffClient cffClient = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (
                    SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure,
                                                                       "Client_GetClientByCleintID",
                                                                       CreateClientIdParameter(clientId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    if (!cleverReader.IsNull && cleverReader.Read())
                    {
                        if (cleverReader.FromBigInteger("ClientID") == -1)
                        {
                            cffClient = AllClients.Create();
                        }
                        else
                        {
                            cffClient = new CffClient(cleverReader.ToString("ClientName"),
                                                      cleverReader.FromBigInteger("ClientID"),
                                                      cleverReader.FromBigInteger("ClientNum"),
                                                      cleverReader.ToSmallInteger("FacilityType"),
                                                      cleverReader.ToString("CollectionsBankAccount"),
                                                      cleverReader.ToSmallInteger("CFFDebtorAdmin"),        //MSazra [20151006]
                                                      cleverReader.ToBoolean("ClientHasLetterTemplates")    //MSazra [20151006]
                                                      );
                        }
                    }
                }
            }
            return(cffClient);
        }
        public IList <AllClientsPermanentNote> LoadCffPermanentNotes()
        {
            IList <AllClientsPermanentNote> notes = new List <AllClientsPermanentNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesClientPerm_LoadAll"))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        AllClientsPermanentNote note = new AllClientsPermanentNote(cleverReader.FromBigInteger("NotesID"),
                                                                                   cleverReader.FromBigInteger("ClientID"),
                                                                                   cleverReader.ToString("ClientName"),
                                                                                   cleverReader.ToDate("Created"),
                                                                                   parsedNotes,
                                                                                   cleverReader.ToInteger("CreatedBy"),
                                                                                   cleverReader.ToString("EmployeeName"),
                                                                                   cleverReader.ToInteger("ModifiedBy"),
                                                                                   cleverReader.ToString(
                                                                                       "ModifiedByEmployeeName"),
                                                                                   cleverReader.ToDate("Modified"));
                        notes.Add(note);
                    }
                }
            }

            return(notes);
        }
        public IList <ClientNote> LoadClientNotesFor(int clientId)
        {
            IList <ClientNote> notes = new List <ClientNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesClient_LoadForAClient",
                                                                          CreateNotesClientPerm_LoadForAClientParameters
                                                                              (clientId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        ClientNote note = new ClientNote(
                            cleverReader.FromBigInteger("NotesID"),
                            cleverReader.ToDate("Created"),
                            ActivityType.Parse(cleverReader.ToInteger("ActivityTypeId")),
                            NoteType.Parse(cleverReader.ToInteger("NoteTypeId")),
                            parsedNotes,
                            cleverReader.ToInteger("CreatedBy"),
                            cleverReader.ToString("EmployeeName"),
                            cleverReader.FromBigInteger("ClientID"),
                            cleverReader.ToInteger("ModifiedBy"),
                            cleverReader.ToString("ModifiedByEmployeeName"),
                            cleverReader.ToDate("Modified"));
                        notes.Add(note);
                    }
                }
            }
            return(notes);
        }
 public InvoiceBatch Build(CleverReader reader)
 {
     return(new InvoiceBatch(reader.FromBigInteger("BatchNumber"),
                             reader.ToDate("BatchDate"),
                             reader.ToDecimal("FacInv"),
                             reader.ToDecimal("NFInv"),
                             reader.ToDecimal("Admin"),
                             reader.ToDecimal("FactorFee"),
                             reader.ToDecimal("Retention"),
                             reader.ToDecimal("Repurchase"),
                             reader.ToDecimal("Credit"),
                             reader.ToDecimal("Post"),
                             reader.ToNullableDate("Released"),
                             reader.ToString("txtStatus"), // Status?
                             reader.ToString("CreatedBy"),
                             reader.ToDate("Modified"),
                             reader.ToString("ModifiedBy"),
                             reader.ToString("Header"),
                             reader.ToDecimal("TotalInv"),
                             reader.ToString("ClientName"),
                             reader.FromBigInteger("ClientID"),
                             reader.ToInteger("FacilityType"),
                             reader.ToDecimal("NonCompliantFee"),
                             reader.ToDecimal("RetnPercent")
                             ));
 }
        public ClientInformation Build()
        {
            //MSarza [20150901] : Data type changed from bool to small int for dbo.ClientFinancials.CffDebtorAdmin.
            //string cffDebtorAdmin = "Yes";
            //if (reader.ToBoolean("DebtorAdmin") == false)
            //{
            //    cffDebtorAdmin = "No";
            //}

            bool cffDebtorAdmin = (CffDebtorAdminHelper.CffIsDebtorAdminForClient(reader.ToSmallInteger("DebtorAdmin"))) ? true : false;

            //string debtorAdministration = Enum.Parse(typeof(CffDebtorAdmin), reader.ToSmallInteger("DebtorAdmin").ToString()).ToString();

            return(new ClientInformation(reader.FromBigInteger("ClientNum"),
                                         reader.FromBigInteger("Companynum"),
                                         reader.ToInteger("ClientActions"),
                                         reader.ToDate("Created"),
                                         reader.ToString("StandardTerms"),
                                         reader.ToString("SetCustTerms"),
                                         reader.ToString("SetInvTerms"),
                                         reader.ToString("Facilitytype"),
                                         reader.ToString("GSTNumber"),
                                         reader.ToDecimal("CurrentAccountCustLimitSum"),
                                         reader.ToBoolean("HasOwnLetterTemplates"),
                                         //debtorAdministration
                                         reader.ToSmallInteger("DebtorAdmin")
                                         ));
        }
Ejemplo n.º 8
0
 public CffClientInformation Build(CffClient client)
 {
     return(new CffClientInformation(client,
                                     reader.ToSmallInteger("ClientNoCalls"),
                                     reader.ToString("CffLegalEntity"), //MSarza [20150730]
                                     reader.ToString("ClientSignature") //MSarza [20150810]
                                     ));
 }
 public Charge Build()
 {
     return(new Charge(reader.FromBigInteger("BChargeID"),
                       ChargeType.Parse(reader.ToSmallInteger("ChargeTypeID")),
                       reader.ToDecimal("Amount"),
                       reader.ToString("Descriptn"),
                       reader.ToDate("Modified"),
                       reader.ToString("ModifiedBy")));
 }
 public RetentionSchedule Build()
 {
     return(new RetentionSchedule(reader.FromBigInteger("RetnID"),
                                  reader.ToString("ClientName"),
                                  reader.ToDate("eom"),
                                  reader.ToString("status"),
                                  reader.ToNullableDate("Released"),
                                  reader.FromBigInteger("ClientID"),
                                  reader.ToString("RetnNotes"),
                                  reader.ToSmallInteger("ClientFacilityType")));
 }
        public CffUserActivation ApproveUser(Guid mKey, Guid uKey)
        {
            ArgumentChecker.ThrowIfGuidEmpty(mKey, "mKey");
            ArgumentChecker.ThrowIfGuidEmpty(uKey, "uKey");
            CffUserActivation record = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "ApproveUserAccess", CreateAccessActionParameter(mKey, uKey)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        int nStatus = cleverReader.ToInteger("Status");
                        if (nStatus > 0)
                        { //valid - UKey must pickup from customer-id
                            record = new CffUserActivation(cleverReader.ToString("Name"), "", "", cleverReader.ToString("USERMAIL"), nStatus);
                        }
                        else
                        { //invalid
                            record = new CffUserActivation("", "", "", "", nStatus);
                        }
                    }
                }
            }
            return(record);
        }
        public IRetentionNote LoadRetentionNotesFor(int retentionScheduleId)
        {
            IRetentionNote retentionNote;

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "RetnNotes_LoadNote",
                                                                          CreateRetnNotes_LoadNoteParameters
                                                                              (retentionScheduleId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    if (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));
                        retentionNote = new RetentionNote(parsedNotes);
                    }
                    else
                    {
                        retentionNote = new NullRetentionNote();
                    }
                }
            }
            return(retentionNote);
        }
        public List <UserSpecialAccounts> GetSpecialAccountAccessByID(int userId)
        {
            // continue tomorrow - request to db all clients for this user
            ArgumentChecker.ThrowIfNull(userId, "userId");
            List <UserSpecialAccounts> userSpecialAccounts = new List <UserSpecialAccounts>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetSpecialAccountAccessByUserId", CreateUserIdParameter(userId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        Guid   uid       = cleverReader.ToGuid("UserID");
                        string name      = cleverReader.ToString("Name");
                        int    isClient  = cleverReader.ToInteger("IsClient");
                        bool   bisClient = isClient != 0 ? true : false;
                        Int64  id        = cleverReader.FromBigInteger("ID");
                        bool   bisLocked = cleverReader.ToBoolean("IsLockedOut");
                        if (!bisLocked)
                        { //add on dropdownlist if not locked out
                            userSpecialAccounts.Add(new UserSpecialAccounts(uid, name, bisClient, id, bisLocked));
                        }
                    }
                }
            }
            return(userSpecialAccounts);
        }
        public CffUserActivation ActivateUser(Guid uid, String pKey)
        {
            ArgumentChecker.ThrowIfNull(pKey, "pKey");
            ArgumentChecker.ThrowIfGuidEmpty(uid, "uid");
            CffUserActivation record = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "ActivateNewUser", CreateActivationParameter(uid, pKey)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        int nStatus = cleverReader.ToInteger("Status");
                        if (nStatus == 1)
                        { //valid - UKey must pickup from customer-id
                            record = new CffUserActivation(cleverReader.ToString("Name"), cleverReader.ToString("MngtEmail"), cleverReader.ToGuid("UKey").ToString(), cleverReader.ToString("USERMAIL"), nStatus);
                        }
                        else
                        { //invalid
                            record = new CffUserActivation("", "", "", "", nStatus);
                        }
                    }
                }
            }
            return(record);
        }
        public IList <PermanentCustomerNote> LoadPermanentCustomerNoteOnRange(int customerId, DateRange dateRange)
        {
            SqlParameter customerIdParameter = new SqlParameter("@CustomerId", SqlDbType.BigInt);

            customerIdParameter.Value = customerId;

            SqlParameter dateFromParameter = new SqlParameter("@DateFrom", SqlDbType.DateTime);

            dateFromParameter.Value = Convert.ToDateTime(dateRange.StartDate.ToShortDateString());

            SqlParameter dateToParameter = new SqlParameter("@DateTo", SqlDbType.DateTime);

            dateToParameter.Value = Convert.ToDateTime(dateRange.EndDate.ToShortDateString());

            SqlParameter[] paramObjects = new SqlParameter[] { customerIdParameter, dateFromParameter, dateToParameter };

            IList <PermanentCustomerNote> permanentNotes = new List <PermanentCustomerNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesPermanent_LoadCustomerInRange",
                                                                          paramObjects
                                                                          ))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        PermanentCustomerNote permanentCustomerNote =
                            new PermanentCustomerNote(cleverReader.FromBigInteger("NotesID"),
                                                      cleverReader.ToDate("Created"),
                                                      parsedNotes,
                                                      cleverReader.ToInteger("CreatedBy"),
                                                      cleverReader.ToString("EmployeeName"),
                                                      cleverReader.ToInteger("ModifiedBy"),
                                                      cleverReader.ToString("ModifiedByEmployeeName"),
                                                      cleverReader.ToDate("Modified"));
                        permanentNotes.Add(permanentCustomerNote);
                    }
                }
            }
            return(permanentNotes);
        }
 public CffCustomerInformation Build(CffCustomer customer, IDate lastPaid, decimal lastAmount, 
     ClientCustomerTerm clientCustomerTerm, AgeingBalances ageingBalances)
 {
     return new CffCustomerInformation(customer,
                                       reader.ToSmallInteger("StopCredit"),
                                       reader.ToDecimal("CreditLimit"),
                                       reader.ToDate("Created"),
                                       reader.ToDate("NextCall"),
                                       reader.ToSmallInteger("customerNoCalls"),
                                       lastPaid, lastAmount,
                                       clientCustomerTerm, ageingBalances,
                                       reader.ToString("Address1"),
                                       reader.ToString("Address2"),
                                       reader.ToString("Address3"),
                                       reader.ToString("Address4"),
                                       reader.ToString("EmailStatmentsAddr"),
                                       reader.ToDate("NotifyDate")
                                       );
 }
        public IList <AllClientsPermanentNote> LoadCffPermanentNotesOnRange(DateRange dateRange)
        {
            ArgumentChecker.ThrowIfNull(dateRange, "fromDate");

            SqlParameter[] sqlParameters = new[]
            {
                CreateFromDateParameter(dateRange.StartDate),
                CreateToDateParameters(dateRange.EndDate)
            };

            IList <AllClientsPermanentNote> notes = new List <AllClientsPermanentNote>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NotesClientPerm_LoadAllOnRange", sqlParameters))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        string parsedNotes = CustomerNotesParser.Parse(cleverReader.ToString("notes"));

                        AllClientsPermanentNote note = new AllClientsPermanentNote(cleverReader.FromBigInteger("NotesID"),
                                                                                   cleverReader.FromBigInteger("ClientID"),
                                                                                   cleverReader.ToString("ClientName"),
                                                                                   cleverReader.ToDate("Created"),
                                                                                   parsedNotes,
                                                                                   cleverReader.ToInteger("CreatedBy"),
                                                                                   cleverReader.ToString("EmployeeName"),
                                                                                   cleverReader.ToInteger("ModifiedBy"),
                                                                                   cleverReader.ToString(
                                                                                       "ModifiedByEmployeeName"),
                                                                                   cleverReader.ToDate("Modified"));
                        notes.Add(note);
                    }
                }
            }

            return(notes);
        }
Ejemplo n.º 18
0
        public IList <ICffClient> GetClientNameAndNum(string searchString, int numberOfCustomersToReturn)
        {
            IList <ICffClient> clientsList = new List <ICffClient>();

            using (SqlConnection connection = CreateConnection())
            {
                using (
                    SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure,
                                                                       "GetMatchedClient",
                                                                       CreateShowMatchedNamesParameters(searchString,
                                                                                                        numberOfCustomersToReturn))
                    )
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    if (!cleverReader.IsNull)
                    {
                        while (cleverReader.Read())
                        {
                            if (cleverReader.FromBigInteger("ClientID") == -1)
                            {
                                clientsList.Add(AllClients.Create());
                            }
                            else
                            {
                                clientsList.Add(new CffClient(cleverReader.ToString("ClientName"),
                                                              cleverReader.FromBigInteger("ClientID"),
                                                              cleverReader.FromBigInteger("ClientNum"),
                                                              cleverReader.ToSmallInteger("FacilityType"),
                                                              cleverReader.ToString("CollectionsBankAccount"),
                                                              cleverReader.ToSmallInteger("CFFDebtorAdmin"),     //MSazra [20151006]
                                                              cleverReader.ToBoolean("ClientHasLetterTemplates") //MSazra [20151006]
                                                              ));
                            }
                        }
                    }
                }
            }

            return(clientsList);
        }
        public CffUserActivation DeclineUser(Guid mKey, Guid uKey)
        {
            ArgumentChecker.ThrowIfGuidEmpty(mKey, "mKey");
            ArgumentChecker.ThrowIfGuidEmpty(uKey, "uKey");
            CffUserActivation record           = null;
            String            userEmployeeName = "";
            String            userEmail        = "";

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetEmployeeDetailsByUID", CreateEmployeeParameter(uKey, "ALL")))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        userEmployeeName = cleverReader.ToString("EmployeeName");
                        userEmail        = cleverReader.ToString("EmailAddress");
                    }
                }
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "DeclineUserAccess", CreateAccessActionParameter(mKey, uKey)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        int nStatus = cleverReader.ToInteger("Status");
                        if (nStatus >= 0)
                        { //valid - UKey must pickup from customer-id
                            record = new CffUserActivation(userEmployeeName, "", "", userEmail, nStatus);
                        }
                        else
                        { //invalid
                            record = new CffUserActivation("", "", "", "", nStatus);
                        }
                    }
                }
            }
            return(record);
        }
Ejemplo n.º 20
0
 public RetentionDeductable Build()
 {
     return(new RetentionDeductable(reader.ToDecimal("intCharges"),
                                    reader.ToDecimal("bkfees"),
                                    reader.ToDecimal("postRate"),
                                    reader.ToDecimal("postamt"),
                                    reader.ToDecimal("disc"),
                                    reader.ToDecimal("prerep"),
                                    reader.ToDecimal("precr"),
                                    reader.ToDecimal("tolls"),
                                    reader.ToDecimal("letters"),
                                    reader.ToDecimal("repayt"),
                                    reader.ToDecimal("LikelyRepurchases"),
                                    System.Convert.ToDecimal(reader.ToDouble("GSTRate")),
                                    reader.ToString("RetnNotes")));
 }
        public IList <TransactionSearchResult> SearchTransactions(DateRange dateRange, string invoiceNumber, TransactionSearchType transactionType, SearchScope searchScope, CffCustomer customer, ICffClient client, string batchFrom, string batchTo)
        {
            if (invoiceNumber.Length < 3)
            {
                throw new ArgumentException("You need more than 3 invoice number to search ");
            }
            SqlParameter[] queryBuilder = CreateSqlBuilder(dateRange, invoiceNumber,
                                                           transactionType, searchScope, customer, client, batchFrom, batchTo);
            IList <TransactionSearchResult> transactionSearchResults = new List <TransactionSearchResult>();

            using (SqlConnection connection = CreateConnection())
            {
                try
                {
                    using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                              CommandType.StoredProcedure,
                                                                              "stGetCustomersSearchAll",
                                                                              queryBuilder))
                    {
                        CleverReader cleverReader = new CleverReader(dataReader);
                        while (!cleverReader.IsNull && cleverReader.Read())
                        {
                            var transactionSearchResult =
                                new TransactionSearchResult(cleverReader.ToDate("Transdate"),
                                                            cleverReader.ToDate("factorDate"),
                                                            cleverReader.ToString("TransRef"),
                                                            cleverReader.ToDecimal("TransAmount"),
                                                            cleverReader.ToDecimal("TransBalance"),
                                                            cleverReader.FromBigInteger("BatchID"),
                                                            cleverReader.FromBigInteger("CustNum"),
                                                            cleverReader.FromBigInteger("CustomerID"),
                                                            cleverReader.ToString("Customer"),
                                                            cleverReader.FromBigInteger("ClientID"),
                                                            cleverReader.ToString("ClientName"),
                                                            cleverReader.ToString("Title"),
                                                            cleverReader.ToDecimal("Balance"),
                                                            cleverReader.ToString("BatchFrom"),
                                                            cleverReader.ToString("BatchTo"));
                            transactionSearchResults.Add(transactionSearchResult);
                        }
                    }
                }
                catch (SqlException exception)
                {
                    if (exception.Message.Contains("Timeout expired"))
                    {
                        throw new CffTimeoutException(exception.Message, exception);
                    }
                    throw;
                }
            }
            Console.WriteLine(transactionSearchResults.Count);
            return(RecordLimiter.ReturnMaximumRecords(transactionSearchResults));
        }
        public String GetDashboardContent()
        {
            String content = "";

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetCFFContent", CreateContentIdparameter(1)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        content = cleverReader.ToString("MsgContent");
                    }
                }
            }
            return(content);
        }
        public string GetPasskey(long clientId)
        {
            string key = string.Empty;

            ArgumentChecker.ThrowIfNull(clientId, "clientId");
            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetPassKey", CreateClientIdParameter(clientId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        key = cleverReader.ToString("PASSKEY");
                    }
                }
            }
            return(key);
        }
        public String GetRoleByPassKey(String userPassKey)
        {
            ArgumentChecker.ThrowIfNull(userPassKey, "userPassKey");
            String sRole = "Staff";

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetRoleByPassKey", CreateUserPassKeyParameter(userPassKey)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        sRole = cleverReader.ToString("ROLE");
                    }
                }
            }
            return(sRole);
        }
 public CffCustomerContact Build()
 {
     return(new CffCustomerContact()
     {
         IsDefault = reader.ToBoolean("IsDefault"),
         LName = reader.ToString("LName"),
         FName = reader.ToString("FName"),
         Phone = reader.ToString("Phone"),
         Fax = reader.ToString("Fax"),
         Email = reader.ToString("Email"),
         Cell = reader.ToString("Cell"),
         Role = reader.ToString("Role"),
         Attn = reader.ToBoolean("Attn"),
         EmailStatement = reader.ToBoolean("EmailStatement"),
         EmailReceipt = reader.ToInteger("EmailReceipt")
     });
 }
Ejemplo n.º 26
0
 public RetentionDetails Build(RetentionInfo retentionInfo, RetentionDeductable retentionDeductable,
                               TransactionsAfterEndOfMonth transactionsAfterEndOfMonth,
                               RetentionSummary retentionSummary, ChargeCollection charges, OverdueFee overdueFee)
 {
     return(new RetentionDetails(reader.FromBigInteger("RetnID"),
                                 reader.ToNullableDate("Released"),
                                 reader.ToDate("eom"),
                                 reader.ToDecimal("nfinvs"),
                                 reader.ToDecimal("facinvs"),
                                 retentionInfo,
                                 retentionDeductable,
                                 reader.ToDecimal("nfrec"),
                                 transactionsAfterEndOfMonth,
                                 retentionSummary,
                                 charges,
                                 overdueFee,
                                 reader.ToString("status"),
                                 reader.ToSmallInteger("hold"),
                                 reader.ToSmallInteger("clientFacilityType")));
 }
Ejemplo n.º 27
0
        public IDictionary <int, string> LoadNoteTypes()
        {
            IDictionary <int, string> activityTypes = new Dictionary <int, string>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "NoteType_GetNoteTypes"))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (!cleverReader.IsNull && cleverReader.Read())
                    {
                        activityTypes.Add(cleverReader.ToInteger("NoteTypeId"),
                                          cleverReader.ToString("NoteType"));
                    }
                }
            }
            return(activityTypes);
        }
        public CffLoginAccount GetSpecialAccessAccount(String owner, Guid accessId)
        {
            ArgumentChecker.ThrowIfNull(owner, "owner");
            ArgumentChecker.ThrowIfGuidEmpty(accessId, "accessId");

            CffLoginAccount account = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetSpecialMapAccount", CreateSpecialAccountParameter(owner, accessId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        account = new CffLoginAccount(cleverReader.ToString("USERNAME"), cleverReader.ToString("PASSWORD"));
                    }
                }
            }
            return(account);
        }
        public List <UserSpecialAccounts> GetSpecialAccountAccess(string username, string password)
        {
            List <UserSpecialAccounts> userSpecialAccounts = new List <UserSpecialAccounts>();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure, "GetSpecialAccountAccess", CreateAccountParameter(username, password)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    while (cleverReader.Read())
                    {
                        Guid   uid       = cleverReader.ToGuid("UserID");
                        string name      = cleverReader.ToString("Name");
                        int    isClient  = cleverReader.ToInteger("IsClient");
                        bool   bisClient = isClient != 0 ? true : false;
                        int    id        = cleverReader.ToInteger("ID");
                        bool   isLocked  = cleverReader.ToBoolean("IsLockedOut");
                        userSpecialAccounts.Add(new UserSpecialAccounts(uid, name, bisClient, id, isLocked));
                    }
                }
            }
            return(userSpecialAccounts);
        }
Ejemplo n.º 30
0
        public CustomerContact Build()
        {
            return(new CustomerContact(reader.FromBigInteger("CustContactsID"),
                                       reader.FromBigInteger("ClientId"),
                                       reader.FromBigInteger("ClientNumber"),
                                       reader.ToString("ClientName"),
                                       reader.FromBigInteger("CustomerID"),
                                       reader.FromBigInteger("CustomerNumber"),
                                       reader.ToString("CustomerName"),
                                       reader.ToString("LName"),
                                       reader.ToString("FName"),
                                       reader.ToString("Phone"),
                                       reader.ToString("Fax"),
                                       reader.ToString("Email"),
                                       reader.ToString("Cell"),
                                       reader.ToString("Role"),
                                       reader.ToBoolean("isDefault"),
                                       reader.ToBoolean("Attn"),
                                       reader.ToDateTimeWithMinimum("Modified"),
                                       reader.ToSmallInteger("ModifiedBy"),
                                       reader.ToString("Address1"),
                                       reader.ToString("Address2"),
                                       reader.ToString("Address3"),
                                       reader.ToString("Address4"),
                                       reader.ToBoolean("emailstatement"),
                                       reader.ToSmallInteger("emailReceipt")             //MSarza - inserted line

                                       ));
        }