Пример #1
0
        public void TestLostProperty()
        {
            var test = new LostProperty(PropertyOwner)
            {
                Relinquishment = new Act(PropertyOwner)
                {
                    IsVoluntary = lp => true
                },
                IsPropertyLocationKnown = lp => false,
                SubjectProperty         = _property
            };

            var testResult = test.IsValid(_propertyOwner);

            Assert.IsFalse(testResult);
            Console.Write(test.ToString());
        }
        private void DisplayJobLostProperty(long jobId, Booking objBook)
        {
            try
            {
                btnNew.Enabled        = false;
                btnSaveAndNew.Enabled = false;

                grdLister.Enabled            = false;
                txtCustomerName.ReadOnly     = true;
                txtCustomerMobileNo.ReadOnly = false;


                LostProperty objLost = General.GetQueryable <LostProperty>(c => c.JobId == jobId).OrderByDescending(c => c.LostDate).FirstOrDefault();

                if (objLost != null)
                {
                    objMaster.GetByPrimaryKey(objLost.Id);
                    DisplayRecord();
                }
                else
                {
                    grdLister.RowCount = 1;

                    if (objBook != null)
                    {
                        txtCustomerName.Text     = objBook.CustomerName.ToStr();
                        txtCustomerMobileNo.Text = objBook.CustomerMobileNo != string.Empty ? objBook.CustomerMobileNo.ToStr() : objBook.CustomerPhoneNo.ToStr();

                        txtAddressDetail.Text = objBook.Customer.DefaultIfEmpty().Address1.ToStr();

                        grdLister.Rows[0].Cells[COLS.BookingId].Value  = jobId;
                        grdLister.Rows[0].Cells[COLS.PickupDate].Value = objBook.PickupDateTime;
                        grdLister.Rows[0].Cells[COLS.OrderNo].Value    = objBook.OrderNo;
                        grdLister.Rows[0].Cells[COLS.PupilNo].Value    = objBook.PupilNo;

                        grdLister.Rows[0].Cells[COLS.BookedBy].Value = objBook.Gen_Company_Department.DefaultIfEmpty().DepartmentName.ToStr();

                        grdLister.Rows[0].Cells[COLS.Vehicle].Value = objBook.Fleet_VehicleType.VehicleType;

                        grdLister.Rows[0].Cells[COLS.VehicleID].Value = objBook.VehicleTypeId;
                        grdLister.Rows[0].Cells[COLS.RefNumber].Value = objBook.BookingNo;
                        grdLister.Rows[0].Cells[COLS.Charges].Value   = objBook.CompanyPrice.ToDecimal();

                        grdLister.Rows[0].Cells[COLS.Fares].Value = objBook.FareRate.ToDecimal();

                        grdLister.Rows[0].Cells[COLS.Parking].Value        = objBook.ParkingCharges.ToDecimal();
                        grdLister.Rows[0].Cells[COLS.PickupPoint].Value    = !string.IsNullOrEmpty(objBook.FromDoorNo) ? objBook.FromDoorNo + " - " + objBook.FromAddress.ToStr() : objBook.FromAddress.ToStr();
                        grdLister.Rows[0].Cells[COLS.Destination].Value    = !string.IsNullOrEmpty(objBook.ToDoorNo) ? objBook.ToDoorNo + " - " + objBook.ToAddress.ToStr() : objBook.ToAddress.ToStr();
                        grdLister.Rows[0].Cells[COLS.Waiting].Value        = objBook.WaitingCharges.ToDecimal();
                        grdLister.Rows[0].Cells[COLS.ExtraDrop].Value      = objBook.ExtraDropCharges.ToDecimal();
                        grdLister.Rows[0].Cells[COLS.MeetAndGreet].Value   = objBook.MeetAndGreetCharges.ToDecimal();
                        grdLister.Rows[0].Cells[COLS.CongtionCharge].Value = objBook.CongtionCharges.ToDecimal();
                        grdLister.Rows[0].Cells[COLS.Total].Value          = objBook.TotalCharges.ToDecimal();


                        grdLister.Rows[0].Cells[COLS.Passenger].Value  = objBook.CustomerName.ToStr().Trim();
                        grdLister.Rows[0].Cells[COLS.Payment_ID].Value = objBook.InvoicePaymentTypeId.ToIntorNull();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }