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

            _isNew = false;
            try {
                _contract = service.FetchByProductInfoId(productInfoId);
                productInfoRefCombo.Text     = _contract.ProductInfoRcd != null ? _contract.ProductInfoRcd : String.Empty;
                textBoxProductInfoValue.Text = _contract.ProductInfoValue;
                _contract.DateTime           = DateTime.UtcNow;
                dateTimePickerDateTime.Text  = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
Exemplo n.º 2
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 productId, string productInfoRcd, string productInfoValue, System.Guid userId)
        {
            try {
                _contract                    = new CrudeProductInfoContract();
                _isNew                       = true;
                _contract.ProductId          = productId;
                _contract.ProductInfoRcd     = productInfoRcd;
                productInfoRefCombo.Text     = _contract.ProductInfoRcd != null ? _contract.ProductInfoRcd : String.Empty;
                _contract.ProductInfoValue   = productInfoValue;
                textBoxProductInfoValue.Text = _contract.ProductInfoValue;
                _contract.UserId             = userId;
                _contract.DateTime           = DateTime.UtcNow;
                dateTimePickerDateTime.Text  = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Exemplo n.º 3
0
 // bring up add form for ProductInfo
 // links:
 //  docLink: http://sql2x.org/documentationLink/c0944961-8179-40a2-a561-c8873b691f2c
 public void ShowAsAdd()
 {
     _contract  = new CrudeProductInfoContract();
     _isNew     = true;
     this.Text += " - Not Savable (Product,User Missing)";
     RefreshProductInfo();
     Show();
 }
Exemplo n.º 4
0
        // bring up add form for ProductInfo by foreign key Product
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByProduct(System.Guid productId)
        {
            _contract                   = new CrudeProductInfoContract();
            _isNew                      = true;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();
            _contract.ProductId         = productId;

            RefreshProductInfo();
            Show();
        }
Exemplo n.º 5
0
        // bring up add form for ProductInfo by foreign key ProductInfo
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByProductInfo(string productInfoRcd)
        {
            _contract                   = new CrudeProductInfoContract();
            _isNew                      = true;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();
            _contract.ProductInfoRcd    = productInfoRcd;
            productInfoRefCombo.Text    = _contract.ProductInfoRcd != null ? _contract.ProductInfoRcd : String.Empty;

            RefreshProductInfo();
            Show();
        }
        public ActionResult CrudeProductInfoCreate([Bind()] CrudeProductInfoContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeProductInfoServiceClient().Insert(contract);

                return(RedirectToAction("CrudeProductInfoIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductInfo/CrudeProductInfoCreate.cshtml",
                       contract
                       ));
        }
Exemplo n.º 7
0
        // bring up add form for ProductInfo
        // links:
        //  docLink: http://sql2x.org/documentationLink/8568fd9a-b807-4aad-ac74-7826975e3241
        public void ShowAsAdd(System.Guid productId, string productInfoRcd, string productInfoValue, System.Guid userId)
        {
            _contract                    = new CrudeProductInfoContract();
            _isNew                       = true;
            _contract.ProductId          = productId;
            _contract.ProductInfoRcd     = productInfoRcd;
            productInfoRefCombo.Text     = _contract.ProductInfoRcd != null ? _contract.ProductInfoRcd : String.Empty;
            _contract.ProductInfoValue   = productInfoValue;
            textBoxProductInfoValue.Text = _contract.ProductInfoValue;
            _contract.UserId             = userId;
            _contract.DateTime           = DateTime.UtcNow;
            dateTimePickerDateTime.Text  = _contract.DateTime.ToString();

            RefreshProductInfo();
            Show();
        }
        public ActionResult CrudeProductInfoEdit([Bind()] CrudeProductInfoContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeProductInfoServiceClient().Update(contract);

                return(RedirectToAction("CrudeProductInfoIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductInfo/CrudeProductInfoEdit.cshtml",
                       contract
                       ));
        }
Exemplo n.º 9
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 CrudeProductInfoContract();
         _isNew     = true;
         this.Text += " - Not Savable (Product,User Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeProductInfoCreate(System.Guid?productId, System.Guid?userId)
        {
            var contract = new CrudeProductInfoContract();

            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.ProductInfoRcd =
                new SelectList(new CrudeProductInfoRefServiceClient().FetchAll(),
                               "ProductInfoRcd",
                               "ProductInfoName",
                               contract.ProductInfoRcd
                               );

            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/CrudeProductInfo/CrudeProductInfoCreate.cshtml",
                       contract
                       ));
        }
Exemplo n.º 11
0
        // bring up edit form for ProductInfo
        // links:
        //  docLink: http://sql2x.org/documentationLink/d7ff032d-3bcf-438f-9850-900ca0ebca98
        public void ShowAsEdit(System.Guid productInfoId)
        {
            var service = new CrudeProductInfoServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByProductInfoId(productInfoId);
                productInfoRefCombo.Text     = _contract.ProductInfoRcd != null ? _contract.ProductInfoRcd : String.Empty;
                textBoxProductInfoValue.Text = _contract.ProductInfoValue;
                _contract.DateTime           = DateTime.UtcNow;
                dateTimePickerDateTime.Text  = _contract.DateTime.ToString();

                RefreshProductInfo();
                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
        }
Exemplo n.º 12
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByProduct(System.Guid productId)
        {
            try {
                _contract                   = new CrudeProductInfoContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ProductId         = productId;

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