// shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28
        public void ShowAsAdd(System.Guid bookingId, string serviceTypeRcd, System.Guid serviceSpecialServiceRequestId, string serviceRequestStatusRcd, System.Guid serviceHotelId, System.Guid serviceCarRentalId, System.Guid userId, System.Guid serviceFerryId)
        {
            try {
                _contract                = new CrudeBookingServiceRequestContract();
                _isNew                   = true;
                _contract.BookingId      = bookingId;
                _contract.ServiceTypeRcd = serviceTypeRcd;
                serviceTypeRefCombo.Text = _contract.ServiceTypeRcd != null ? _contract.ServiceTypeRcd : String.Empty;
                _contract.ServiceSpecialServiceRequestId         = serviceSpecialServiceRequestId;
                serviceSpecialServiceRequestPicker.SelectedValue = _contract.ServiceSpecialServiceRequestId;
                _contract.ServiceRequestStatusRcd    = serviceRequestStatusRcd;
                serviceRequestStatusRefCombo.Text    = _contract.ServiceRequestStatusRcd != null ? _contract.ServiceRequestStatusRcd : String.Empty;
                _contract.ServiceHotelId             = serviceHotelId;
                _contract.ServiceCarRentalId         = serviceCarRentalId;
                serviceCarRentalPicker.SelectedValue = _contract.ServiceCarRentalId;
                _contract.UserId            = userId;
                userPicker.SelectedValue    = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ServiceFerryId    = serviceFerryId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid bookingServiceRequestId)
        {
            var service = new CrudeBookingServiceRequestServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByBookingServiceRequestId(bookingServiceRequestId);
                serviceTypeRefCombo.Text = _contract.ServiceTypeRcd != null ? _contract.ServiceTypeRcd : String.Empty;
                serviceSpecialServiceRequestPicker.SelectedValue = _contract.ServiceSpecialServiceRequestId;
                serviceRequestStatusRefCombo.Text    = _contract.ServiceRequestStatusRcd != null ? _contract.ServiceRequestStatusRcd : String.Empty;
                serviceCarRentalPicker.SelectedValue = _contract.ServiceCarRentalId;
                userPicker.SelectedValue             = _contract.UserId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
Пример #3
0
        public ActionResult CrudeBookingServiceRequestCreate([Bind()] CrudeBookingServiceRequestContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeBookingServiceRequestServiceClient().Insert(contract);

                return(RedirectToAction("CrudeBookingServiceRequestIndex"));
            }

            return(View(
                       "~/Views/Crude/Booking/CrudeBookingServiceRequest/CrudeBookingServiceRequestCreate.cshtml",
                       contract
                       ));
        }
Пример #4
0
        public ActionResult CrudeBookingServiceRequestEdit([Bind()] CrudeBookingServiceRequestContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeBookingServiceRequestServiceClient().Update(contract);

                return(RedirectToAction("CrudeBookingServiceRequestIndex"));
            }

            return(View(
                       "~/Views/Crude/Booking/CrudeBookingServiceRequest/CrudeBookingServiceRequestEdit.cshtml",
                       contract
                       ));
        }
 // shows the form with default values for comboboxes and pickers
 // links:
 //  docLink: http://sql2x.org/documentationLink/e04d0806-55ef-41cc-8669-acf0ddd850c7
 public void ShowAsAdd()
 {
     try {
         _contract  = new CrudeBookingServiceRequestContract();
         _isNew     = true;
         this.Text += " - Not Savable (Booking Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByServiceFerry(System.Guid serviceFerryId)
        {
            try {
                _contract                   = new CrudeBookingServiceRequestContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ServiceFerryId    = serviceFerryId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByServiceType(string serviceTypeRcd)
        {
            try {
                _contract                   = new CrudeBookingServiceRequestContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ServiceTypeRcd    = serviceTypeRcd;
                serviceTypeRefCombo.Text    = _contract.ServiceTypeRcd != null ? _contract.ServiceTypeRcd : String.Empty;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Пример #8
0
        public ActionResult CrudeBookingServiceRequestCreate(System.Guid?bookingId, System.Guid?serviceSpecialServiceRequestId, System.Guid?serviceHotelId, System.Guid?serviceCarRentalId, System.Guid?userId, System.Guid?serviceFerryId)
        {
            var contract = new CrudeBookingServiceRequestContract();

            if (bookingId != null)
            {
                contract.BookingId = (System.Guid)bookingId;
            }
            if (serviceSpecialServiceRequestId != null)
            {
                contract.ServiceSpecialServiceRequestId = (System.Guid)serviceSpecialServiceRequestId;
            }
            if (serviceHotelId != null)
            {
                contract.ServiceHotelId = (System.Guid)serviceHotelId;
            }
            if (serviceCarRentalId != null)
            {
                contract.ServiceCarRentalId = (System.Guid)serviceCarRentalId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }
            if (serviceFerryId != null)
            {
                contract.ServiceFerryId = (System.Guid)serviceFerryId;
            }

            ViewBag.ServiceTypeRcd =
                new SelectList(new CrudeServiceTypeRefServiceClient().FetchAll(),
                               "ServiceTypeRcd",
                               "ServiceTypeName",
                               contract.ServiceTypeRcd
                               );

            ViewBag.ServiceSpecialServiceRequestId =
                new SelectList(new CrudeServiceSpecialServiceRequestServiceClient().FetchAll(),
                               "ServiceSpecialServiceRequestId",
                               "ServiceSpecialServiceRequestName",
                               contract.ServiceSpecialServiceRequestId
                               );

            ViewBag.ServiceRequestStatusRcd =
                new SelectList(new CrudeServiceRequestStatusRefServiceClient().FetchAll(),
                               "ServiceRequestStatusRcd",
                               "ServiceRequestStatusName",
                               contract.ServiceRequestStatusRcd
                               );

            ViewBag.ServiceHotelId =
                new SelectList(new CrudeServiceHotelServiceClient().FetchAll(),
                               "ServiceHotelId",
                               "HotelName",
                               contract.ServiceHotelId
                               );

            ViewBag.ServiceCarRentalId =
                new SelectList(new CrudeServiceCarRentalServiceClient().FetchAll(),
                               "ServiceCarRentalId",
                               "CarName",
                               contract.ServiceCarRentalId
                               );

            if (userId == null)
            {
                contract.UserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");
            }

            ViewBag.DefaultUserName =
                new CrudeDefaultUserServiceClient().FetchByDefaultUserId(contract.UserId).DefaultUserName;

            contract.DateTime = DateTime.UtcNow;


            return(View(
                       "~/Views/Crude/Booking/CrudeBookingServiceRequest/CrudeBookingServiceRequestCreate.cshtml",
                       contract
                       ));
        }