コード例 #1
0
        private BookingDetailInfo ConvertToInfo(DfmxModel model)
        {
            if (model == null)
            {
                return(null);
            }

            BookingDetailInfo info = AutoMapper.Mapper.Map <DfmxModel, BookingDetailInfo>(model);

            return(info);
        }
コード例 #2
0
        private DfmxModel ConvertToModel(BookingDetailInfo info)
        {
            if (info == null)
            {
                return(null);
            }

            DfmxModel model = AutoMapper.Mapper.Map <BookingDetailInfo, DfmxModel>(info);

            return(model);
        }
コード例 #3
0
 private void UpdateSeatPlan()
 {
     if (this.NewEditExit.btnNew.Text == "&Update")
     {
         if (this.QuickSearch.txtNo.Text != null)
         {
             BookingController bookingController = new BookingController();
             BookingDetailInfo bookingDetailInfo = new BookingDetailInfo();
             GetBookingDetailInfo(bookingDetailInfo);
             bookingController.TripDetailUpdate(bookingDetailInfo);
         }
     }
 }
コード例 #4
0
        private List <BookingDetailInfo> ConvertToInfoList(IEnumerable <DfmxModel> sourceList)
        {
            if (sourceList == null)
            {
                return(null);
            }

            List <BookingDetailInfo> list = new List <BookingDetailInfo>();

            foreach (var item in sourceList)
            {
                BookingDetailInfo info = ConvertToInfo(item);
                list.Add(info);
            }
            return(list);
        }
コード例 #5
0
 private void GetBookingDetailInfo(BookingDetailInfo bookingDetailInfo)
 {
     if (NewEditExit.BtnNewText == "&Save")
     {
         bookingDetailInfo.BookingDetailID = string.Empty;
         bookingDetailInfo.BookingID       = string.Empty;
         bookingDetailInfo.TripID          = this.lblTripID.Text;
         bookingDetailInfo.SeatNo          = this.txtSeatNo.Text;
     }
     else if (NewEditExit.btnNew.Text == "&Update")
     {
         bookingDetailInfo.BookingDetailID = this.lblDetailID.Text;
         bookingDetailInfo.BookingID       = this.lblID.Text;
         bookingDetailInfo.TripID          = this.lblTripID.Text;
         bookingDetailInfo.SeatNo          = this.txtSeatNo.Text;
     }
 }
コード例 #6
0
        public Task <bool> AddNewOrUpdateBookingDetailAsync(string token, BookingDetailInfo info, IUnitOfWork uow = null)
        {
            DfmxModel model = ConvertToModel(info);

            return(SaveOrUpdateBookingDetailAsync(token, model, uow));
        }
コード例 #7
0
        private void NewEditExit_NewClick(object sender, EventArgs e)
        {
            try
            {
                switch (NewEditExit.BtnNewText)
                {
                case "&New":
                    this.NewControl();
                    break;

                case "&Save":
                    if (this.CheckRequiredFields())
                    {
                        BookingController bookingController = new BookingController();
                        BookingInfo       bookingInfo       = new BookingInfo();
                        CustomerInfo      custInfo          = new CustomerInfo();
                        BookingDetailInfo bookingDetailInfo = new BookingDetailInfo();


                        GetCustomerInfo(custInfo);
                        GetBookingInfo(bookingInfo);
                        GetBookingDetailInfo(bookingDetailInfo);

                        bookingController.Insert(bookingInfo, custInfo, bookingDetailInfo);

                        string log = "Form-BookingEntry;Item-BookingNo:" + this.txtBookingNo.Text + ";action-Save";
                        userAction.Log(log);

                        this.InitializeControls();
                        Globalizer.ShowMessage(MessageType.Information, "Saved Successfully");
                        this.ResetControl();
                    }
                    break;

                case "&Update":
                    if (this.CheckRequiredFields())
                    {
                        BookingController bookingController = new BookingController();
                        BookingInfo       bookingInfo       = new BookingInfo();
                        CustomerInfo      custInfo          = new CustomerInfo();
                        BookingDetailInfo bookingDetailInfo = new BookingDetailInfo();

                        GetCustomerInfo(custInfo);
                        GetBookingInfo(bookingInfo);
                        GetBookingDetailInfo(bookingDetailInfo);

                        bookingController.Update(bookingInfo, custInfo, bookingDetailInfo);

                        string log = "Form-BookingEntry;Item-BookingNo:" + this.txtBookingNo.Text + ";action-Update";
                        userAction.Log(log);

                        this.InitializeControls();
                        Globalizer.ShowMessage(MessageType.Information, "Updated Successfully");
                        this.ResetControl();
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Globalizer.ShowMessage(MessageType.Critical, ex.Message);
            }
        }