예제 #1
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByServiceImageTypeAndImage(string serviceImageTypeRcd, byte[] image)
        {
            try {
                _contract                     = new CrudeServiceHotelImageContract();
                _isNew                        = true;
                _contract.DateTime            = DateTime.UtcNow;
                dateTimePickerDateTime.Text   = _contract.DateTime.ToString();
                _contract.ServiceImageTypeRcd = serviceImageTypeRcd;
                serviceImageTypeRefCombo.Text = _contract.ServiceImageTypeRcd != null ? _contract.ServiceImageTypeRcd : String.Empty;
                _contract.Image               = image;
                if (_contract.Image != null)
                {
                    pictureBoxImage.Image = ByteToImage(_contract.Image);
                }

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

            _isNew = false;
            try {
                _contract = service.FetchByServiceHotelImageId(serviceHotelImageId);
                serviceImageTypeRefCombo.Text = _contract.ServiceImageTypeRcd != null ? _contract.ServiceImageTypeRcd : String.Empty;
                textBoxImageFileName.Text     = _contract.ImageFileName;
                if (_contract.Image != null)
                {
                    pictureBoxImage.Image = ByteToImage(_contract.Image);
                }
                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
        // 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 serviceHotelId, string serviceImageTypeRcd, string imageFileName, byte[] image, System.Guid userId)
        {
            try {
                _contract = new CrudeServiceHotelImageContract();
                _isNew    = true;
                _contract.ServiceHotelId      = serviceHotelId;
                _contract.ServiceImageTypeRcd = serviceImageTypeRcd;
                serviceImageTypeRefCombo.Text = _contract.ServiceImageTypeRcd != null ? _contract.ServiceImageTypeRcd : String.Empty;
                _contract.ImageFileName       = imageFileName;
                textBoxImageFileName.Text     = _contract.ImageFileName;
                _contract.Image = image;
                if (_contract.Image != null)
                {
                    pictureBoxImage.Image = ByteToImage(_contract.Image);
                }
                _contract.UserId            = userId;
                userPicker.SelectedValue    = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
        public ActionResult CrudeServiceHotelImageCreate([Bind()] CrudeServiceHotelImageContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeServiceHotelImageServiceClient().Insert(contract);

                return(RedirectToAction("CrudeServiceHotelImageIndex"));
            }

            return(View(
                       "~/Views/Crude/Service/CrudeServiceHotelImage/CrudeServiceHotelImageCreate.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeServiceHotelImageEdit([Bind()] CrudeServiceHotelImageContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeServiceHotelImageServiceClient().Update(contract);

                return(RedirectToAction("CrudeServiceHotelImageIndex"));
            }

            return(View(
                       "~/Views/Crude/Service/CrudeServiceHotelImage/CrudeServiceHotelImageEdit.cshtml",
                       contract
                       ));
        }
예제 #6
0
 // 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 CrudeServiceHotelImageContract();
         _isNew     = true;
         this.Text += " - Not Savable (ServiceHotel Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeServiceHotelImageCreate(System.Guid?serviceHotelId, System.Guid?userId)
        {
            var contract = new CrudeServiceHotelImageContract();

            if (serviceHotelId != null)
            {
                contract.ServiceHotelId = (System.Guid)serviceHotelId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

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

            ViewBag.ServiceImageTypeRcd =
                new SelectList(new CrudeServiceImageTypeRefServiceClient().FetchAll(),
                               "ServiceImageTypeRcd",
                               "ServiceImageTypeName",
                               contract.ServiceImageTypeRcd
                               );

            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/Service/CrudeServiceHotelImage/CrudeServiceHotelImageCreate.cshtml",
                       contract
                       ));
        }
예제 #8
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByServiceHotel(System.Guid serviceHotelId)
        {
            try {
                _contract                   = new CrudeServiceHotelImageContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ServiceHotelId    = serviceHotelId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }