Esempio n. 1
0
        public async Task <CheckOutOutput> Execute(CheckOutInput input)
        {
            CheckOutOutput output = new CheckOutOutput();

            foreach (var item in input.Items)
            {
                var partInstance = await this._partInstanceRepository.GetEntityAsync(e => e.Id == item.PartInstanceId);

                var location = await this._locationProvider.GetEntityAsync(e => e.Id == item.LocationId);

                if (partInstance != null && location != null)
                {
                    if (item.IsBubbler)
                    {
                        var data = await this.ExecuteBubbler(partInstance, location, item);

                        output.OutputList.Add(data);
                    }
                    else
                    {
                        var data = await this.ExecuteStandard(partInstance, location, item);

                        output.OutputList.Add(data);
                    }
                }
                else
                {
                    output.OutputList.Add(new CheckOutOutputData(null, false, "PartInstance or Location Not Found"));
                }
            }
            return(output);
        }
Esempio n. 2
0
        private void submitCheckOut_Click(object sender, EventArgs e)
        {
            string username     = User.UserName;
            string serialNumber = this.CheckOutInput.Text;

            if (command == true)
            {
                if (Data.CheckOut3002Stock(serialNumber, username))
                {
                    MessageBox.Show("Sucessful");
                }
                CheckOutInput.Text = "";
                CheckOutInput.Select();
            }
            else
            {
                if (serialNumber.IndexOf('%') >= 0)
                {
                    location            = serialNumber.Replace("%", "");
                    DirectionLabel.Text = "Please enter serial number:";
                    CheckOutInput.Text  = "";
                    CheckOutInput.Select();
                    Debug.WriteLine("Location Set");
                }
                else if (location == null && FilteredSerialNumber == null)
                {
                    Debug.WriteLine("Error Occured");
                    MessageBox.Show("Please enter a valid location.", "Critical Warning",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    CheckOutInput.Text = "";
                }
                else if (location != null && FilteredSerialNumber == null)
                {
                    Debug.WriteLine("Serial Number set");
                    FilteredSerialNumber = serialNumber;
                    CheckOutInput.Text   = "";
                    CheckOutInput.Select();
                    if (Data.CheckIn3002Stock(FilteredSerialNumber, location))
                    {
                        location             = null;
                        FilteredSerialNumber = null;
                        MessageBox.Show("Success");
                        this.Close();
                    }
                    else
                    {
                        location             = null;
                        FilteredSerialNumber = null;
                        MessageBox.Show("Try again");
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Nothing Happened");
                }
            }
        }
Esempio n. 3
0
        public ActionResult <CheckOutOutput> CheckOut([FromBody] CheckOutInput input)
        {
            CheckOutOutput rzlt    = new CheckOutOutput();
            BookRecords    bookEnt = _baseService.GetBook(input.ReservationNumber);

            if (bookEnt != null)
            {
                bookEnt.EndDate = input.CheakOutDate;
                var testDays = (bookEnt.EndDate - bookEnt.StartDate).TotalDays;
                rzlt.Price = (float)testDays * _baseService.GetBaseDayFee() * bookEnt.AType.Price;
            }
            else
            {
                rzlt = null;
            }

            return(rzlt);
        }