예제 #1
0
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid productImageId)
        {
            var service = new CrudeProductImageServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByProductImageId(productImageId);
                productImageTypeRefCombo.Text = _contract.ProductImageTypeRcd != null ? _contract.ProductImageTypeRcd : String.Empty;
                textBoxImageFileName.Text     = _contract.ImageFileName;
                if (_contract.Image != null)
                {
                    pictureBoxImage.Image = ByteToImage(_contract.Image);
                }
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
예제 #2
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByProductImageTypeAndImage(string productImageTypeRcd, byte[] image)
        {
            try {
                _contract                     = new CrudeProductImageContract();
                _isNew                        = true;
                _contract.DateTime            = DateTime.UtcNow;
                dateTimePickerDateTime.Text   = _contract.DateTime.ToString();
                _contract.ProductImageTypeRcd = productImageTypeRcd;
                productImageTypeRefCombo.Text = _contract.ProductImageTypeRcd != null ? _contract.ProductImageTypeRcd : 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();
                }
            }
        }
예제 #3
0
 // bring up add form for ProductImage
 // links:
 //  docLink: http://sql2x.org/documentationLink/c0944961-8179-40a2-a561-c8873b691f2c
 public void ShowAsAdd()
 {
     _contract  = new CrudeProductImageContract();
     _isNew     = true;
     this.Text += " - Not Savable (Product,User Missing)";
     RefreshProductImage();
     Show();
 }
예제 #4
0
        // bring up add form for ProductImage by foreign key Product
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByProduct(System.Guid productId)
        {
            _contract                   = new CrudeProductImageContract();
            _isNew                      = true;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();
            _contract.ProductId         = productId;

            RefreshProductImage();
            Show();
        }
예제 #5
0
        public ActionResult CrudeProductImageCreate([Bind()] CrudeProductImageContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeProductImageServiceClient().Insert(contract);

                return(RedirectToAction("CrudeProductImageIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductImage/CrudeProductImageCreate.cshtml",
                       contract
                       ));
        }
예제 #6
0
        public ActionResult CrudeProductImageEdit([Bind()] CrudeProductImageContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeProductImageServiceClient().Update(contract);

                return(RedirectToAction("CrudeProductImageIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductImage/CrudeProductImageEdit.cshtml",
                       contract
                       ));
        }
예제 #7
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 CrudeProductImageContract();
         _isNew     = true;
         this.Text += " - Not Savable (Product,User Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
예제 #8
0
        // bring up add form for ProductImage by foreign key ProductImageTypeAndImage
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByProductImageTypeAndImage(string productImageTypeRcd, byte[] image)
        {
            _contract                     = new CrudeProductImageContract();
            _isNew                        = true;
            _contract.DateTime            = DateTime.UtcNow;
            dateTimePickerDateTime.Text   = _contract.DateTime.ToString();
            _contract.ProductImageTypeRcd = productImageTypeRcd;
            productImageTypeRefCombo.Text = _contract.ProductImageTypeRcd != null ? _contract.ProductImageTypeRcd : String.Empty;
            _contract.Image               = image;
            if (_contract.Image != null)
            {
                pictureBoxImage.Image = ByteToImage(_contract.Image);
            }

            RefreshProductImage();
            Show();
        }
예제 #9
0
        public ActionResult CrudeProductImageCreate(System.Guid?productId, System.Guid?userId)
        {
            var contract = new CrudeProductImageContract();

            if (productId != null)
            {
                contract.ProductId = (System.Guid)productId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

            ViewBag.ProductId =
                new SelectList(new CrudeProductServiceClient().FetchAll(),
                               "ProductId",
                               "ProductName",
                               contract.ProductId
                               );

            ViewBag.ProductImageTypeRcd =
                new SelectList(new CrudeProductImageTypeRefServiceClient().FetchAll(),
                               "ProductImageTypeRcd",
                               "ProductImageTypeName",
                               contract.ProductImageTypeRcd
                               );

            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/Product/CrudeProductImage/CrudeProductImageCreate.cshtml",
                       contract
                       ));
        }
예제 #10
0
        // shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/599dcb45-f71b-4672-bb18-46975a4fe9b3
        public void ShowAsAddByRules(System.Guid userId)
        {
            try {
                _contract                   = new CrudeProductImageContract();
                _isNew                      = true;
                _contract.UserId            = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
예제 #11
0
        // bring up add form for ProductImage
        // links:
        //  docLink: http://sql2x.org/documentationLink/8568fd9a-b807-4aad-ac74-7826975e3241
        public void ShowAsAdd(System.Guid productId, string productImageTypeRcd, string imageFileName, byte[] image, System.Guid userId)
        {
            _contract                     = new CrudeProductImageContract();
            _isNew                        = true;
            _contract.ProductId           = productId;
            _contract.ProductImageTypeRcd = productImageTypeRcd;
            productImageTypeRefCombo.Text = _contract.ProductImageTypeRcd != null ? _contract.ProductImageTypeRcd : String.Empty;
            _contract.ImageFileName       = imageFileName;
            textBoxImageFileName.Text     = _contract.ImageFileName;
            _contract.Image               = image;
            if (_contract.Image != null)
            {
                pictureBoxImage.Image = ByteToImage(_contract.Image);
            }
            _contract.UserId            = userId;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();

            RefreshProductImage();
            Show();
        }