Ejemplo n.º 1
0
 private void FetchObject(SafeDataReader dr)
 {
     _id            = dr.GetGuid("Id");
     _tableCount    = dr.GetInt32("TableCount");
     _seatCount     = dr.GetInt32("SeatCount");
     _shipping      = dr.GetString("Shipping");
     _payCompany    = dr.GetString("PayCompany");
     _payAddress1   = dr.GetString("PayAddress1");
     _payAddress2   = dr.GetString("PayAddress2");
     _payCity       = dr.GetString("PayCity");
     _payPostal     = dr.GetString("PayPostal");
     _payCountry    = dr.GetString("PayCountry");
     _payFirstname  = dr.GetString("PayFirstname");
     _payLastname   = dr.GetString("PayLastname");
     _payContact    = dr.GetString("PayContact");
     _payEmail      = dr.GetString("PayEmail");
     _paymentMethod = dr.GetString("PaymentMethod");
     _status        = dr.GetString("Status");
     _payStatus     = dr.GetString("PayStatus");
     _isReminded    = dr.GetInt32("IsReminded");
     _lastSendPaymentReminderEmailDate = dr.GetSmartDate("LastSendPaymentReminderEmailDate", _lastSendPaymentReminderEmailDate.EmptyIsMin);
     _amount         = dr.GetDecimal("Amount");
     _fee            = dr.GetDecimal("Fee");
     _feeShipping    = dr.GetDecimal("FeeShipping");
     _tax            = dr.GetDecimal("Tax");
     _amountReceived = dr.GetDecimal("AmountReceived");
     _invoice        = dr.GetString("Invoice");
     _dateCreated    = dr.GetSmartDate("DateCreated", _dateCreated.EmptyIsMin);
     _dateModified   = dr.GetSmartDate("DateModified", _dateModified.EmptyIsMin);
     _datePaid       = dr.GetSmartDate("Datepaid", _datePaid.EmptyIsMin);
     _remarksPayment = dr.GetString("RemarksPayment");
 }
Ejemplo n.º 2
0
 private void FetchObject(SafeDataReader dr)
 {
     _id                               = dr.GetGuid("Id");
     _registrationId                   = dr.GetGuid("RegistrationId");
     _amount                           = dr.GetDecimal("Amount");
     _fee                              = dr.GetDecimal("Fee");
     _tax                              = dr.GetDecimal("Tax");
     _grandAmount                      = dr.GetDecimal("GrandAmount");
     _payGroupId                       = dr.GetGuid("PayGroupId");
     _paymentMethod                    = dr.GetString("PaymentMethod");
     _payCompany                       = dr.GetString("PayCompany");
     _payAddress1                      = dr.GetString("PayAddress1");
     _payAddress2                      = dr.GetString("PayAddress2");
     _payCity                          = dr.GetString("PayCity");
     _payPostal                        = dr.GetString("PayPostal");
     _payCountry                       = dr.GetString("PayCountry");
     _payFirstname                     = dr.GetString("PayFirstname");
     _payLastname                      = dr.GetString("PayLastname");
     _payContact                       = dr.GetString("PayContact");
     _payStatus                        = dr.GetString("PayStatus");
     _amountReceived                   = dr.GetDecimal("AmountReceived");
     _isReminded                       = dr.GetBoolean("IsReminded");
     _lastSendPaidEmailDate            = dr.GetSmartDate("LastSendPaidEmailDate", _lastSendPaidEmailDate.EmptyIsMin);
     _lastSendPaymentReminderEmailDate = dr.GetSmartDate("LastSendPaymentReminderEmailDate", _lastSendPaymentReminderEmailDate.EmptyIsMin);
     _invoiceDate                      = dr.GetSmartDate("InvoiceDate", _invoiceDate.EmptyIsMin);
     _dateCreated                      = dr.GetSmartDate("DateCreated", _dateCreated.EmptyIsMin);
     _dateModified                     = dr.GetSmartDate("DateModified", _dateModified.EmptyIsMin);
     _invoice                          = dr.GetString("Invoice");
 }
Ejemplo n.º 3
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("itemprice"));
     LoadProperty(_Item, dr.GetInt32("item"));
     LoadProperty(_UnitName, dr.GetString("unitname"));
     LoadProperty(_ItemRate, dr.GetDecimal("unitprice"));
     LoadProperty(_ChargeType, dr.GetString("chargetype"));
     LoadProperty(_ConstantValue, dr.GetDecimal("quantity"));
 }
Ejemplo n.º 4
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("vehiclefee"));
     LoadProperty(_FeeNo, dr.GetString("feeno"));
     LoadProperty(_Date, dr.GetSmartDate("date"));
     LoadProperty(_TotalVehicles, dr.GetInt32("totalvehicles"));
     LoadProperty(_TotalServiceFees, dr.GetDecimal("totalservicefees"));
     LoadProperty(_Tax, dr.GetDecimal("tax"));
     LoadProperty(_GrandTotal, dr.GetDecimal("grandtotal"));
 }
Ejemplo n.º 5
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("itemprice"));
     LoadProperty(_Item, dr.GetInt32("item"));
     LoadProperty(_ItemUnit, dr.GetInt32("uom"));
     LoadProperty(_Rate, dr.GetDecimal("unitprice"));
     LoadProperty(_ChargeType, dr.GetInt16("classification"));
     LoadProperty(_Remarks, dr.GetString("remarks"));
     LoadProperty(_ConstantValue, dr.GetDecimal("quantity"));
 }
Ejemplo n.º 6
0
        protected void Fetch(SafeDataReader sdr)
        {
            int i = 0;

            LoadProperty(QuestionnaireAnswerScoreIDProperty, sdr.GetInt32(i++));
            LoadProperty(QuestionnaireAnswerSetIDProperty, sdr.GetInt32(i++));
            LoadProperty(TotalIndexAssessorProperty, sdr.GetInt32(i++));
            LoadProperty(TotalIndexAssessorPctProperty, sdr.GetDecimal(i++));
            LoadProperty(AuditIndexAuditorProperty, sdr.GetInt32(i++));
            LoadProperty(AuditIndexAuditorPctProperty, sdr.GetDecimal(i++));
        }
Ejemplo n.º 7
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("billitemroro"));
     LoadProperty(_Bill, dr.GetInt32("bill"));
     LoadProperty(_Quantity, dr.GetDecimal("Quantity"));
     LoadProperty(_Uom, dr.GetInt32("uom"));
     LoadProperty(_Cargo, BaseItemInfo.Get(dr, _Cargo.Name));
     LoadProperty(_Rate, dr.GetDecimal("rate"));
     LoadProperty(_IsTaxable, dr.GetBoolean("istaxable"));
     LoadProperty(_Total, this.Quantity * this.Rate);
 }
Ejemplo n.º 8
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("BillRate"));
     LoadProperty(_ItemRate, dr.GetInt32("itemrate"));
     LoadProperty(_BillingItem, dr.GetInt32("billingitem"));
     LoadProperty(_ItemRateHandling, dr.GetString("chargetype"));
     LoadProperty(_Computation1, dr.GetDecimal("computation1"));
     LoadProperty(_Computation2, dr.GetDecimal("computation2"));
     LoadProperty(_Computation3, dr.GetDecimal("computation3"));
     LoadProperty(_ItemRateUnit, dr.GetString("unitname"));
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Loads a <see cref="InvoiceLineInfo"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void Child_Fetch(SafeDataReader dr)
        {
            // Value properties
            LoadProperty(InvoiceLineIdProperty, dr.GetGuid("InvoiceLineId"));
            LoadProperty(ProductIdProperty, dr.GetGuid("ProductId"));
            LoadProperty(QuantityProperty, dr.GetInt32("Quantity"));
            LoadProperty(UnitCostProperty, dr.GetDecimal("UnitCost"));
            LoadProperty(CostProperty, dr.GetDecimal("Cost"));
            LoadProperty(PercentDiscountProperty, dr.GetByte("PercentDiscount"));
            var args = new DataPortalHookArgs(dr);

            OnFetchRead(args);
        }
Ejemplo n.º 10
0
        private void DataPortal_Fetch(int id)
        {
            using (var ctx = ConnectionManager <SqlConnection> .GetManager(ConfigHelper.GetDatabase(), false))
            {
                using (var cmd = ctx.Connection.CreateCommand())
                {
                    cmd.CommandText = string.Format(@"
                            SELECT b.bill,b.billtype,b.billno,b.billdate,b.consignee,b.billingaddress,
	                            c.contact AS {0}contact,c.code AS {0}code,c.name AS {0}name,
	                            v.contact AS {1}contact,v.code AS {1}code,v.name AS {1}name,
	                            b.billofladingno,b.voyageno,b.wtaxrate,b.totalbill,b.duedate,b.status,
	                            billofladingno,b.createdby,b.datecreated,b.updatedby,b.dateupdated,b.isincludebank
                            FROM bill b
                            LEFT JOIN contact c ON b.consignee = c.contact
                            LEFT JOIN contactaddress cca ON c.contact = cca.contact
                            LEFT JOIN contact v ON b.vessel = v.contact
                            LEFT JOIN contactaddress vca ON v.contact = vca.contact
                            WHERE b.bill = @id", _Consignee.Name, _Vessel.Name);
                    cmd.Parameters.AddWithValue("@id", id);
                    using (var dr = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        if (dr.Read())
                        {
                            LoadProperty(_Id, dr.GetInt32("bill"));
                            LoadProperty(_BillType, dr.GetInt32("billtype"));
                            LoadProperty(_BillNo, dr.GetString("billno"));
                            LoadProperty(_BillDate, dr.GetSmartDate("billdate"));
                            LoadProperty(_Consignee, BaseContactInfo.Get(dr, _Consignee.Name));
                            LoadProperty(_BillingAddress, dr.GetString("billingaddress"));
                            LoadProperty(_Vessel, BaseContactInfo.Get(dr, _Vessel.Name));
                            LoadProperty(_BillOfLadingNo, dr.GetString("BillOfLadingNo"));
                            LoadProperty(_VoyageNo, dr.GetString("voyageno"));
                            LoadProperty(_WTaxRate, dr.GetDecimal("wtaxrate"));
                            LoadProperty(_TotalBill, dr.GetDecimal("totalbill"));
                            LoadProperty(_DueDate, dr.GetSmartDate("duedate"));
                            LoadProperty(_Status, dr.GetInt32("status"));
                            LoadProperty(_CreatedBy, dr.GetInt32("createdby"));
                            LoadProperty(_DateCreated, dr.GetSmartDate("datecreated"));
                            LoadProperty(_UpdatedBy, dr.GetInt32("updatedby"));
                            LoadProperty(_DateUpdated, dr.GetSmartDate("dateupdated"));
                            LoadProperty(_IsIncludePayeeBankAccount, dr.GetBoolean("isincludebank"));
                        }
                    }
                }
            }
            LoadProperty(_BillItems, BillItems.Get(new SingleCriteria <int>(this.Id)));
            LoadProperty(_Payments, PaymentInfos.Get(new PaymentInfos.Criteria()
            {
                BillId = this.Id, Status = CargoConstants.PaymentStatus.Approved.Id
            }));
        }
Ejemplo n.º 11
0
        internal void AddAmount(SafeDataReader dr)
        {
            int parentcode = dr.GetInt32("parentcode");

            if (_donate.ContainsKey(parentcode))
            {
                _donate[parentcode] = _donate[parentcode] + dr.GetDecimal("total");
            }
            else
            {
                _donate.Add(dr.GetInt32("parentcode"), dr.GetDecimal("total"));
            }
            _total += dr.GetDecimal("total");
        }
Ejemplo n.º 12
0
        private InvoiceLineInfoDto FetchInvoiceLineInfo(SafeDataReader dr)
        {
            var invoiceLineInfo = new InvoiceLineInfoDto();

            // Value properties
            invoiceLineInfo.InvoiceLineId   = dr.GetGuid("InvoiceLineId");
            invoiceLineInfo.ProductId       = dr.GetGuid("ProductId");
            invoiceLineInfo.Quantity        = dr.GetInt32("Quantity");
            invoiceLineInfo.UnitCost        = dr.GetDecimal("UnitCost");
            invoiceLineInfo.Cost            = dr.GetDecimal("Cost");
            invoiceLineInfo.PercentDiscount = dr.GetByte("PercentDiscount");

            return(invoiceLineInfo);
        }
Ejemplo n.º 13
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("paymentdetail"));
     LoadProperty(_Payment, dr.GetInt32("Payment"));
     LoadProperty(_Bill, BillPaymentInfo.Get(dr, _Bill.Name));
     LoadProperty(_PartialPayment, dr.GetDecimal("partialpayment"));
     LoadProperty(_AmountDue, dr.GetDecimal("amountdue"));
     LoadProperty(_AmountPaid, dr.GetDecimal("amountpaid"));
     LoadProperty(_PaymentType, dr.GetInt32("paymenttype"));
     LoadProperty(_BankName, dr.GetString("bank"));
     LoadProperty(_BankBranch, dr.GetString("branch"));
     LoadProperty(_RefNo, dr.GetString("refno"));
     LoadProperty(_RefDate, dr.GetSmartDate("refdate"));
     LoadProperty(_Comments, dr.GetString("comments"));
 }
Ejemplo n.º 14
0
        private void GetUomConversion(int?Uom)
        {
            if (this.Cargo == null && Uom == null)
            {
                return;
            }

            using (var ctx = ConnectionManager <SqlConnection> .GetManager(ConfigHelper.GetDatabase(), false))
            {
                using (var cmd = ctx.Connection.CreateCommand())
                {
                    cmd.CommandText = @"SELECT quantity
                              FROM itemuomconversion
                              WHERE item = @id AND uom = @uom";
                    cmd.Parameters.AddWithValue("@id", this.Cargo.Id);
                    cmd.Parameters.AddWithValue("@uom", Uom);
                    using (var dr = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        if (dr.Read())
                        {
                            this.QtyConversion = dr.GetDecimal("quantity");
                        }
                    }
                }
            }
        }
Ejemplo n.º 15
0
        private void GetWTaxRate()
        {
            if (this.Consignee == null)
            {
                return;
            }

            using (var ctx = ConnectionManager <SqlConnection> .GetManager(ConfigHelper.GetDatabase(), false))
            {
                using (var cmd = ctx.Connection.CreateCommand())
                {
                    cmd.CommandText = @"SELECT wtaxrate
                              FROM consignee
                              WHERE contact = @id";
                    cmd.Parameters.AddWithValue("@id", this.Consignee.Id);
                    using (var dr = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        if (dr.Read())
                        {
                            this.WTaxRate = dr.GetDecimal("wtaxrate");
                        }
                    }
                }
            }
        }
Ejemplo n.º 16
0
        public QcyarndtlModelList GetModelList(QcyarndtlModel model)
        {
            QcyarndtlTable   table = new QcyarndtlTable();
            SelectSqlSection sql   = DataAccess.DefaultDB.Select(table, table.AllColumns());

            if (model.QualityCode != "")
            {
                sql.Where(table.QualityCode == model.QualityCode);
            }
            using (SafeDataReader sdr = new SafeDataReader(sql.ToDataReader()))
            {
                QcyarndtlModelList result = new QcyarndtlModelList();
                while (sdr.Read())
                {
                    QcyarndtlModel m = new QcyarndtlModel();
                    m.Iden          = sdr.GetInt32(table.Iden);
                    m.QualityCode   = sdr.GetString(table.QualityCode);
                    m.YarnType      = sdr.GetString(table.YarnType);
                    m.YarnCount     = sdr.GetString(table.YarnCount);
                    m.Threads       = sdr.GetInt32(table.Threads);
                    m.YarnRatio     = sdr.GetDecimal(table.YarnRatio);
                    m.YarnComponent = sdr.GetString(table.YarnComponent);
                    m.WarpWeft      = sdr.GetString(table.WarpWeft);
                    m.YarnDensity   = sdr.GetInt32(table.YarnDensity);
                    result.Add(m);
                }
                return(result);
            }
        }
Ejemplo n.º 17
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("itemuomrate"));
     LoadProperty(_Item, dr.GetInt32("item"));
     LoadProperty(_Rate, dr.GetDecimal("rate"));
     LoadProperty(_Uom, dr.GetInt32("uom"));
 }
Ejemplo n.º 18
0
 private void Fetch(SafeDataReader dr)
 {
     Database.LogInfo("ProductOrderDetail.FetchDR", GetHashCode());
     try
     {
         _OrderID              = dr.GetInt32("OrderID");
         _UnitPrice            = dr.GetDecimal("UnitPrice");
         _Quantity             = dr.GetInt16("Quantity");
         _Discount             = dr.GetFloat("Discount");
         _Order_CustomerID     = dr.GetString("Order_CustomerID");
         _Order_EmployeeID     = (int?)dr.GetValue("Order_EmployeeID");
         _Order_OrderDate      = dr.GetSmartDate("Order_OrderDate").Text;
         _Order_RequiredDate   = dr.GetSmartDate("Order_RequiredDate").Text;
         _Order_ShippedDate    = dr.GetSmartDate("Order_ShippedDate").Text;
         _Order_ShipVia        = (int?)dr.GetValue("Order_ShipVia");
         _Order_Freight        = (decimal?)dr.GetValue("Order_Freight");
         _Order_ShipName       = dr.GetString("Order_ShipName");
         _Order_ShipAddress    = dr.GetString("Order_ShipAddress");
         _Order_ShipCity       = dr.GetString("Order_ShipCity");
         _Order_ShipRegion     = dr.GetString("Order_ShipRegion");
         _Order_ShipPostalCode = dr.GetString("Order_ShipPostalCode");
         _Order_ShipCountry    = dr.GetString("Order_ShipCountry");
     }
     catch (Exception ex)             // FKItem Fetch
     {
         Database.LogException("ProductOrderDetail.FetchDR", ex);
         throw new DbCslaException("ProductOrderDetail.Fetch", ex);
     }
     MarkOld();
 }
Ejemplo n.º 19
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("vehicletype"));
     LoadProperty(_Type, dr.GetInt32("type"));
     LoadProperty(_Name, dr.GetString("name"));
     LoadProperty(_Fee, dr.GetDecimal("fee"));
 }
Ejemplo n.º 20
0
        public Order Map(SafeDataReader reader)
        {
            var item = (Order)Activator.CreateInstance(typeof(Order), true);

            using (BypassPropertyChecks(item))
            {
                item.OrderId             = reader.GetInt32("OrderId");
                item.UserId              = reader.GetString("UserId");
                item.OrderDate           = reader.GetDateTime("OrderDate");
                item.ShipAddr1           = reader.GetString("ShipAddr1");
                item.ShipAddr2           = reader.GetString("ShipAddr2");
                item.ShipCity            = reader.GetString("ShipCity");
                item.ShipState           = reader.GetString("ShipState");
                item.ShipZip             = reader.GetString("ShipZip");
                item.ShipCountry         = reader.GetString("ShipCountry");
                item.BillAddr1           = reader.GetString("BillAddr1");
                item.BillAddr2           = reader.GetString("BillAddr2");
                item.BillCity            = reader.GetString("BillCity");
                item.BillState           = reader.GetString("BillState");
                item.BillZip             = reader.GetString("BillZip");
                item.BillCountry         = reader.GetString("BillCountry");
                item.Courier             = reader.GetString("Courier");
                item.TotalPrice          = reader.GetDecimal("TotalPrice");
                item.BillToFirstName     = reader.GetString("BillToFirstName");
                item.BillToLastName      = reader.GetString("BillToLastName");
                item.ShipToFirstName     = reader.GetString("ShipToFirstName");
                item.ShipToLastName      = reader.GetString("ShipToLastName");
                item.AuthorizationNumber = reader.GetInt32("AuthorizationNumber");
                item.Locale              = reader.GetString("Locale");
            }

            MarkOld(item);

            return(item);
        }
Ejemplo n.º 21
0
 private void Fetch(SafeDataReader dr)
 {
     Database.LogInfo("OrderOrderDetail.FetchDR", GetHashCode());
     try
     {
         _ProductID               = dr.GetInt32("ProductID");
         _UnitPrice               = dr.GetDecimal("UnitPrice");
         _Quantity                = dr.GetInt16("Quantity");
         _Discount                = dr.GetFloat("Discount");
         _Product_ProductName     = dr.GetString("Product_ProductName");
         _Product_SupplierID      = (int?)dr.GetValue("Product_SupplierID");
         _Product_CategoryID      = (int?)dr.GetValue("Product_CategoryID");
         _Product_QuantityPerUnit = dr.GetString("Product_QuantityPerUnit");
         _Product_UnitPrice       = (decimal?)dr.GetValue("Product_UnitPrice");
         _Product_UnitsInStock    = (Int16?)dr.GetValue("Product_UnitsInStock");
         _Product_UnitsOnOrder    = (Int16?)dr.GetValue("Product_UnitsOnOrder");
         _Product_ReorderLevel    = (Int16?)dr.GetValue("Product_ReorderLevel");
         _Product_Discontinued    = dr.GetBoolean("Product_Discontinued");
     }
     catch (Exception ex)             // FKItem Fetch
     {
         Database.LogException("OrderOrderDetail.FetchDR", ex);
         throw new DbCslaException("OrderOrderDetail.Fetch", ex);
     }
     MarkOld();
 }
Ejemplo n.º 22
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("itemuomconversion"));
     LoadProperty(_Item, dr.GetInt32("item"));
     LoadProperty(_Quantity, dr.GetDecimal("quantity"));
     LoadProperty(_Uom, dr.GetInt32("uom"));
 }
Ejemplo n.º 23
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("disbursementitem"));
     LoadProperty(_Disbursement, dr.GetString("disbursement"));
     LoadProperty(_Particulars, dr.GetString("particulars"));
     LoadProperty(_Amount, dr.GetDecimal("amount"));
 }
Ejemplo n.º 24
0
 private void DataPortal_Fetch(int id)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager(ConfigHelper.GetDatabase(), false))
     {
         using (var cmd = ctx.Connection.CreateCommand())
         {
             cmd.CommandText = @"SELECT vehiclefee,feeno,date,status,ppatotal,createdby,datecreated,updatedby,dateupdated
                     FROM vehiclefee
                     WHERE vehiclefee = @id";
             cmd.Parameters.AddWithValue("@id", id);
             using (var dr = new SafeDataReader(cmd.ExecuteReader()))
             {
                 if (dr.Read())
                 {
                     LoadProperty(_Id, dr.GetInt32("vehiclefee"));
                     LoadProperty(_FeeNo, dr.GetString("feeno"));
                     LoadProperty(_Date, dr.GetSmartDate("date"));
                     LoadProperty(_PPATotal, dr.GetDecimal("ppatotal"));
                     LoadProperty(_Status, dr.GetInt32("status"));
                     LoadProperty(_CreatedBy, dr.GetInt32("createdby"));
                     LoadProperty(_DateCreated, dr.GetSmartDate("datecreated"));
                     LoadProperty(_UpdatedBy, dr.GetInt32("updatedby"));
                     LoadProperty(_DateUpdated, dr.GetSmartDate("dateupdated"));
                 }
             }
         }
     }
     LoadProperty(_VehicleFeeItems, VehicleFeeItems.Get(new SingleCriteria <int>(this.Id)));
 }
Ejemplo n.º 25
0
        private void DataPortal_Fetch(int id)
        {
            using (var ctx = ConnectionManager <SqlConnection> .GetManager(ConfigHelper.GetDatabase(), false))
            {
                using (var cmd = ctx.Connection.CreateCommand())
                {
                    cmd.CommandText = string.Format(@"SELECT s.consignee,s.contact,s.wtaxrate,s.tinnumber,
                                              c.contact as {0}contact,c.code as {0}code,c.name as {0}name,
                                              c.contacttype as {0}contacttype,c.phone as {0}phone,
                                              c.fax as {0}fax,c.email as {0}email,a.contact as {1}contact,                                      
                                              a.contactaddress as {1}contactaddress,a.addressname as {1}addressname,a.street as {1}street,
                                              a.city as {1}city,a.province as {1}province,a.state as {1}state,a.country as {1}country
                                            FROM consignee s
                                            INNER JOIN contact c ON s.contact = c.contact
                                            LEFT JOIN contactaddress a ON a.contact = c.contact
                                            WHERE s.consignee = @id", _Contact.Name, _Address.Name);
                    cmd.Parameters.AddWithValue("@id", id);

                    using (var dr = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        if (dr.Read())
                        {
                            LoadProperty(_Id, dr.GetInt32("consignee"));
                            LoadProperty(_WTaxRate, dr.GetDecimal("wtaxrate"));
                            LoadProperty(_TIN, dr.GetString("tinnumber"));
                            LoadProperty(_Contact, Contact.Get(dr, _Contact.Name));
                            LoadProperty(_Address, Address.Get(dr, _Address.Name));
                        }
                    }
                }
            }
            //this.ChildFetch();
        }
Ejemplo n.º 26
0
        protected void Fetch(SafeDataReader sdr)
        {
            using (BypassPropertyChecks)
            {
                int i = 0;
                LoadProperty(MovieIDProperty, sdr.GetInt32(i++));
                LoadProperty(MovieGenreIDProperty, sdr.GetInt32(i++));
                LoadProperty(MovieTitleProperty, sdr.GetString(i++));
                LoadProperty(MovieDescriptionProperty, sdr.GetString(i++));
                LoadProperty(MovieImageURLProperty, sdr.GetString(i++));
                LoadProperty(PriceProperty, sdr.GetDecimal(i++));
                LoadProperty(ReleaseDateProperty, sdr.GetValue(i++));
                LoadProperty(IsActiveIndProperty, sdr.GetBoolean(i++));
                LoadProperty(DeletedDateProperty, sdr.GetValue(i++));
                LoadProperty(DeletedByProperty, sdr.GetInt32(i++));
                LoadProperty(CreatedDateProperty, sdr.GetSmartDate(i++));
                LoadProperty(CreatedByProperty, sdr.GetInt32(i++));
                LoadProperty(ModifiedDateProperty, sdr.GetSmartDate(i++));
                LoadProperty(ModifiedByProperty, sdr.GetInt32(i++));
            }

            MarkAsChild();
            MarkOld();
            BusinessRules.CheckRules();
        }
Ejemplo n.º 27
0
 internal DonateBookInfo(SafeDataReader dr)
 {
     _id         = dr.GetInt32("id");
     _username   = dr.GetString("username");
     _total      = dr.GetDecimal("total");
     _donatename = dr.GetString("donatename");
     _regdate    = dr.GetSmartDate("regdate", _regdate.EmptyIsMin);
 }
Ejemplo n.º 28
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("BillRateOthers"));
     LoadProperty(_Percentage, dr.GetInt16("otherspercentage"));
     LoadProperty(_FixedAmount, dr.GetDecimal("othersfixedamount"));
     LoadProperty(_Description, dr.GetString("othersdescription"));
     LoadProperty(_RateType, dr.GetInt16("ratetype"));
 }
Ejemplo n.º 29
0
 internal DonateInfo(SafeDataReader dr)
 {
     _id         = dr.GetInt32("no");
     _amount     = dr.GetDecimal("amount");
     _donatetype = dr.GetString("donatetype");
     _donatedate = dr.GetSmartDate("donate_date", _donatedate.EmptyIsMin);
     _paidtype   = dr.GetByte("pay_code").Equals(0)? "Cash":"Check";
     _memo       = dr.GetString("memo");
 }
Ejemplo n.º 30
0
 private void Child_Fetch(SafeDataReader dr)
 {
     LoadProperty(_Id, dr.GetInt32("payment"));
     LoadProperty(_PaymentNo, dr.GetString("paymentno"));
     LoadProperty(_PaymentDate, dr.GetSmartDate("paymentdate"));
     LoadProperty(_Consignee, dr.GetString("consignee"));
     LoadProperty(_AmountPaid, dr.GetDecimal("amountpaid"));
     LoadProperty(_Status, dr.GetInt32("status"));
 }