public void LoadFromDataRow(DataRow dr)
        {
            this.ExpenseMileageItemID = Convert.ToInt64(dr["ExpenseMileageItemID"]);
            if (!string.IsNullOrEmpty(dr["ExpenseMileageID"].ToString()))
            {
                this.ExpenseMileage = new FnExpenseMileage(Convert.ToInt64(dr["ExpenseMileageID"]));
            }

            if (!string.IsNullOrEmpty(dr["TravelDate"].ToString()) && !Convert.ToDateTime(dr["TravelDate"]).Equals(DateTime.MinValue))
            {
                this.TravelDate = Convert.ToDateTime(dr["TravelDate"]);
            }

            this.LocationFrom = dr["LocationFrom"].ToString();
            this.LocationTo   = dr["LocationTo"].ToString();

            if (!string.IsNullOrEmpty(dr["CarMeterStart"].ToString()))
            {
                this.CarMeterStart = Convert.ToDouble(dr["CarMeterStart"]);
            }

            if (!string.IsNullOrEmpty(dr["CarMeterEnd"].ToString()))
            {
                this.CarMeterEnd = Convert.ToDouble(dr["CarMeterEnd"]);
            }

            if (!string.IsNullOrEmpty(dr["DistanceTotal"].ToString()))
            {
                this.DistanceTotal = Convert.ToDouble(dr["DistanceTotal"]);
            }

            if (!string.IsNullOrEmpty(dr["DistanceFirst100Km"].ToString()))
            {
                this.DistanceFirst100Km = Convert.ToDouble(dr["DistanceFirst100Km"]);
            }

            if (!string.IsNullOrEmpty(dr["DistanceExceed100Km"].ToString()))
            {
                this.DistanceExceed100Km = Convert.ToDouble(dr["DistanceExceed100Km"]);
            }

            if (!string.IsNullOrEmpty(dr["DistanceAdjust"].ToString()))
            {
                this.DistanceAdjust = Convert.ToDouble(dr["DistanceAdjust"]);
            }

            if (!string.IsNullOrEmpty(dr["DistanceNet"].ToString()))
            {
                this.DistanceNet = Convert.ToDouble(dr["DistanceNet"]);
            }

            this.Active  = (bool)dr["Active"];
            this.CreBy   = Convert.ToInt64(dr["CreBy"].ToString());
            this.CreDate = Convert.ToDateTime(dr["CreDate"]);
            this.UpdBy   = Convert.ToInt64(dr["UpdBy"].ToString());
            this.UpdDate = Convert.ToDateTime(dr["UpdDate"]);
            this.UpdPgm  = dr["UpdPgm"].ToString();
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the FnExpenseMileageInvoice class
 /// </summary>
 /// <param name="active">Initial <see cref="FnExpenseMileageInvoice.Active" /> value</param>
 /// <param name="creBy">Initial <see cref="FnExpenseMileageInvoice.CreBy" /> value</param>
 /// <param name="creDate">Initial <see cref="FnExpenseMileageInvoice.CreDate" /> value</param>
 /// <param name="updBy">Initial <see cref="FnExpenseMileageInvoice.UpdBy" /> value</param>
 /// <param name="updDate">Initial <see cref="FnExpenseMileageInvoice.UpdDate" /> value</param>
 /// <param name="updPgm">Initial <see cref="FnExpenseMileageInvoice.UpdPgm" /> value</param>
 /// <param name="rowVersion">Initial <see cref="FnExpenseMileageInvoice.RowVersion" /> value</param>
 /// <param name="expenseMileage">Initial <see cref="FnExpenseMileageInvoice.ExpenseMileage" /> value</param>
 /// <param name="invoice">Initial <see cref="FnExpenseMileageInvoice.Invoice" /> value</param>
 public FnExpenseMileageInvoice(bool active, long creBy, DateTime creDate, long updBy, DateTime updDate, string updPgm, Byte[] rowVersion, SCG.eAccounting.DTO.FnExpenseMileage expenseMileage, SCG.eAccounting.DTO.FnExpenseInvoice invoice)
 {
     this.active         = active;
     this.creBy          = creBy;
     this.creDate        = creDate;
     this.updBy          = updBy;
     this.updDate        = updDate;
     this.updPgm         = updPgm;
     this.rowVersion     = rowVersion;
     this.expenseMileage = expenseMileage;
     this.invoice        = invoice;
 }
 /// <summary>
 /// Initializes a new instance of the FnExpenseMileageItem class
 /// </summary>
 /// <param name="travelDate">Initial <see cref="FnExpenseMileageItem.TravelDate" /> value</param>
 /// <param name="locationFrom">Initial <see cref="FnExpenseMileageItem.LocationFrom" /> value</param>
 /// <param name="locationTo">Initial <see cref="FnExpenseMileageItem.LocationTo" /> value</param>
 /// <param name="carMeterStart">Initial <see cref="FnExpenseMileageItem.CarMeterStart" /> value</param>
 /// <param name="carMeterEnd">Initial <see cref="FnExpenseMileageItem.CarMeterEnd" /> value</param>
 /// <param name="distanceTotal">Initial <see cref="FnExpenseMileageItem.DistanceTotal" /> value</param>
 /// <param name="distanceFirst100Km">Initial <see cref="FnExpenseMileageItem.DistanceFirst100Km" /> value</param>
 /// <param name="distanceExceed100Km">Initial <see cref="FnExpenseMileageItem.DistanceExceed100Km" /> value</param>
 /// <param name="active">Initial <see cref="FnExpenseMileageItem.Active" /> value</param>
 /// <param name="creBy">Initial <see cref="FnExpenseMileageItem.CreBy" /> value</param>
 /// <param name="creDate">Initial <see cref="FnExpenseMileageItem.CreDate" /> value</param>
 /// <param name="updBy">Initial <see cref="FnExpenseMileageItem.UpdBy" /> value</param>
 /// <param name="updDate">Initial <see cref="FnExpenseMileageItem.UpdDate" /> value</param>
 /// <param name="updPgm">Initial <see cref="FnExpenseMileageItem.UpdPgm" /> value</param>
 /// <param name="rowVersion">Initial <see cref="FnExpenseMileageItem.RowVersion" /> value</param>
 /// <param name="expenseMileage">Initial <see cref="FnExpenseMileageItem.ExpenseMileage" /> value</param>
 public FnExpenseMileageItem(DateTime?travelDate, string locationFrom, string locationTo, double?carMeterStart, double?carMeterEnd, double distanceTotal, double distanceFirst100Km, double distanceExceed100Km, double distanceAdjust, double distanceNet, bool active, long creBy, DateTime creDate, long updBy, DateTime updDate, string updPgm, Byte[] rowVersion, SCG.eAccounting.DTO.FnExpenseMileage expenseMileage)
 {
     this.travelDate          = travelDate;
     this.locationFrom        = locationFrom;
     this.locationTo          = locationTo;
     this.carMeterStart       = carMeterStart;
     this.carMeterEnd         = carMeterEnd;
     this.distanceTotal       = distanceTotal;
     this.distanceFirst100Km  = distanceFirst100Km;
     this.distanceExceed100Km = distanceExceed100Km;
     this.distanceAdjust      = distanceAdjust;
     this.active         = active;
     this.creBy          = creBy;
     this.creDate        = creDate;
     this.updBy          = updBy;
     this.updDate        = updDate;
     this.updPgm         = updPgm;
     this.rowVersion     = rowVersion;
     this.expenseMileage = expenseMileage;
 }