Esempio n. 1
0
        public ClientInformation(int clientNumber, int companyNumber, int clientQueries, Date created, string creditTerms, string individualCustomerTerms,
                                 string individualInvoiceTerms, string facilityType, string gstNumber, decimal currentAccountCustLimitSum, //bool administeredByCff,
                                 bool hasOwnLetterTemplates, short debtorAdministrationType)
        {
            this.clientNumber               = clientNumber;
            this.companyNumber              = companyNumber;
            this.clientQueries              = clientQueries;
            this.created                    = created;
            this.creditTerms                = creditTerms;
            this.individualCustomerTerms    = individualCustomerTerms;
            this.individualInvoiceTerms     = individualInvoiceTerms;
            this.facilityType               = facilityType;
            this.gstNumber                  = gstNumber;
            this.currentAccountCustLimitSum = currentAccountCustLimitSum;
            this.hasOwnLetterTemplates      = hasOwnLetterTemplates;

            // client queries       int
            // administrated by     string yes/no
            // created              datetime
            // credit terms         string
            // ind customer terms   can be set / can't be set
            // ind inv terms        can be set / can't be set
            // facility type        string (or object)
            // client #             int
            // company #            int
            // gst#                 string

            //MSarza [20150901]
            //this.administeredByCff = administeredByCff;
            this.debtorAdministrationType  = debtorAdministrationType;
            this.isCffDebtorAdminForClient = CffDebtorAdminHelper.CffIsDebtorAdminForClientAsCff(debtorAdministrationType);
            this.isClientDebtorAdmin       = CffDebtorAdminHelper.ClientIsDebtorAdmin(debtorAdministrationType);
        }
        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")
                                         ));
        }