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

            _isNew = false;
            try {
                _contract = service.FetchByProductCategoryImageId(productCategoryImageId);
                productCategoryImageTypeRefCombo.Text = _contract.ProductCategoryImageTypeRcd != null ? _contract.ProductCategoryImageTypeRcd : String.Empty;
                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();
            }
        }
Exemple #2
0
        private void PopulateProductCategoryImage(List <CrudeProductCategoryImageContract> ImageContract)
        {
            var service = new CrudeProductCategoryImageServiceClient();

            try {
                var contract = service.FetchByProductCategoryImageId(ImageContract [0].ProductCategoryImageId);
                pictureBoxImage.Image = ByteToImage(contract.Image);
            } catch (Exception ex) {
                Error(ex);
                pictureBoxImage.Image = null;
            } finally {
                service.Close();
            }
        }