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

            _isNew = false;
            try {
                _contract = service.FetchByProductDocumentationId(productDocumentationId);
                productDocumentationTypeRefCombo.Text = _contract.ProductDocumentationTypeRcd != null ? _contract.ProductDocumentationTypeRcd : String.Empty;
                textBoxDocumentation.Text             = _contract.Documentation;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
        // 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 productDocumentationTypeRcd, string documentation, System.Guid userId)
        {
            try {
                _contract           = new CrudeProductDocumentationContract();
                _isNew              = true;
                _contract.ProductId = productId;
                _contract.ProductDocumentationTypeRcd = productDocumentationTypeRcd;
                productDocumentationTypeRefCombo.Text = _contract.ProductDocumentationTypeRcd != null ? _contract.ProductDocumentationTypeRcd : String.Empty;
                _contract.Documentation     = documentation;
                textBoxDocumentation.Text   = _contract.Documentation;
                _contract.UserId            = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

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

            RefreshProductDocumentation();
            Show();
        }
        public ActionResult CrudeProductDocumentationCreate([Bind()] CrudeProductDocumentationContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeProductDocumentationServiceClient().Insert(contract);

                return(RedirectToAction("CrudeProductDocumentationIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductDocumentation/CrudeProductDocumentationCreate.cshtml",
                       contract
                       ));
        }
        // bring up add form for ProductDocumentation by foreign key ProductDocumentationTypeAndDocumentation
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByProductDocumentationTypeAndDocumentation(string productDocumentationTypeRcd, string documentation)
        {
            _contract                             = new CrudeProductDocumentationContract();
            _isNew                                = true;
            _contract.DateTime                    = DateTime.UtcNow;
            dateTimePickerDateTime.Text           = _contract.DateTime.ToString();
            _contract.ProductDocumentationTypeRcd = productDocumentationTypeRcd;
            productDocumentationTypeRefCombo.Text = _contract.ProductDocumentationTypeRcd != null ? _contract.ProductDocumentationTypeRcd : String.Empty;
            _contract.Documentation               = documentation;
            textBoxDocumentation.Text             = _contract.Documentation;

            RefreshProductDocumentation();
            Show();
        }
        public ActionResult CrudeProductDocumentationEdit([Bind()] CrudeProductDocumentationContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeProductDocumentationServiceClient().Update(contract);

                return(RedirectToAction("CrudeProductDocumentationIndex"));
            }

            return(View(
                       "~/Views/Crude/Product/CrudeProductDocumentation/CrudeProductDocumentationEdit.cshtml",
                       contract
                       ));
        }
        // bring up add form for ProductDocumentation
        // links:
        //  docLink: http://sql2x.org/documentationLink/8568fd9a-b807-4aad-ac74-7826975e3241
        public void ShowAsAdd(System.Guid productId, string productDocumentationTypeRcd, string documentation, System.Guid userId)
        {
            _contract           = new CrudeProductDocumentationContract();
            _isNew              = true;
            _contract.ProductId = productId;
            _contract.ProductDocumentationTypeRcd = productDocumentationTypeRcd;
            productDocumentationTypeRefCombo.Text = _contract.ProductDocumentationTypeRcd != null ? _contract.ProductDocumentationTypeRcd : String.Empty;
            _contract.Documentation     = documentation;
            textBoxDocumentation.Text   = _contract.Documentation;
            _contract.UserId            = userId;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();

            RefreshProductDocumentation();
            Show();
        }
 // 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 CrudeProductDocumentationContract();
         _isNew     = true;
         this.Text += " - Not Savable (Product,User Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeProductDocumentationCreate(System.Guid?productId, System.Guid?userId)
        {
            var contract = new CrudeProductDocumentationContract();

            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.ProductDocumentationTypeRcd =
                new SelectList(new CrudeProductDocumentationTypeRefServiceClient().FetchAll(),
                               "ProductDocumentationTypeRcd",
                               "ProductDocumentationTypeName",
                               contract.ProductDocumentationTypeRcd
                               );

            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/CrudeProductDocumentation/CrudeProductDocumentationCreate.cshtml",
                       contract
                       ));
        }
        // 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 CrudeProductDocumentationContract();
                _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();
                }
            }
        }
예제 #12
0
        // bring up edit form for ProductDocumentation
        // links:
        //  docLink: http://sql2x.org/documentationLink/d7ff032d-3bcf-438f-9850-900ca0ebca98
        public void ShowAsEdit(System.Guid productDocumentationId)
        {
            var service = new CrudeProductDocumentationServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByProductDocumentationId(productDocumentationId);
                productDocumentationTypeRefCombo.Text = _contract.ProductDocumentationTypeRcd != null ? _contract.ProductDocumentationTypeRcd : String.Empty;
                textBoxDocumentation.Text             = _contract.Documentation;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                RefreshProductDocumentation();
                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
        }