private BookingDetailInfo ConvertToInfo(DfmxModel model) { if (model == null) { return(null); } BookingDetailInfo info = AutoMapper.Mapper.Map <DfmxModel, BookingDetailInfo>(model); return(info); }
private DfmxModel ConvertToModel(BookingDetailInfo info) { if (info == null) { return(null); } DfmxModel model = AutoMapper.Mapper.Map <BookingDetailInfo, DfmxModel>(info); return(model); }
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); } } }
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); }
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; } }
public Task <bool> AddNewOrUpdateBookingDetailAsync(string token, BookingDetailInfo info, IUnitOfWork uow = null) { DfmxModel model = ConvertToModel(info); return(SaveOrUpdateBookingDetailAsync(token, model, uow)); }
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); } }