Example #1
0
        // fetch all rows from the SOAP layer and populate the ComboBox with it
        // links:
        //  docLink: http://sql2x.org/documentationLink/4ccfdfd8-9986-4cfe-8743-e0bcde887284
        public void PopulateCombo()
        {
            if (!DesignMode && cboRef.DataSource == null)
            {
                CrudeDefaultErrorTypeRefServiceClient defaultErrorTypeRef = null;

                try {
                    defaultErrorTypeRef = new CrudeDefaultErrorTypeRefServiceClient();
                    List <CrudeDefaultErrorTypeRefContract> contracts = defaultErrorTypeRef.FetchAll();

                    cboRef.DataSource    = contracts;
                    cboRef.DisplayMember = "DefaultErrorTypeName";
                    cboRef.ValueMember   = "DefaultErrorTypeRcd";
                } catch (Exception ex) {
                    if (ex != null)
                    {
                    }
                } finally {
                    if (defaultErrorTypeRef != null)
                    {
                        defaultErrorTypeRef.Close();
                    }
                }
            }
        }
        // saves the form
        // links:
        //  docLink: http://sql2x.org/documentationLink/c9522930-91f8-4468-a936-8030bb2a6482
        private void buttonSave_Click(object sender, EventArgs e)
        {
            var service = new CrudeDefaultErrorTypeRefServiceClient();

            try {
                _contract.DefaultErrorTypeRcd  = textBoxDefaultErrorType.Text;
                _contract.DefaultErrorTypeName = textBoxDefaultErrorTypeName.Text;

                if (_isNew)
                {
                    service.Insert(_contract);
                }
                else
                {
                    service.Update(_contract);
                }
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }

            Close();
        }
Example #3
0
        // refresh the grid
        // links:
        //  docLink: http://sql2x.org/documentationLink/a90065e7-8ace-4de7-9367-d4653a7c637f
        public void RefreshCrudeDefaultErrorTypeRef()
        {
            var defaultErrorTypeRef = new CrudeDefaultErrorTypeRefServiceClient();

            try {
                var bindingSource = new BindingSource();
                bindingSource.DataSource = defaultErrorTypeRef.FetchWithFilter(
                    textBoxDefaultErrorType.Text
                    , textBoxDefaultErrorTypeName.Text
                    , Guid.Empty
                    , DateTime.MinValue
                    );
                dataGridViewCrudeDefaultErrorTypeRef.AutoGenerateColumns = false;
                dataGridViewCrudeDefaultErrorTypeRef.DataSource          = bindingSource;
                dataGridViewCrudeDefaultErrorTypeRef.AutoResizeColumns();
                dataGridViewCrudeDefaultErrorTypeRef.Refresh();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                defaultErrorTypeRef.Close();
            }
        }
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(string defaultErrorTypeRcd, System.Guid defaultUserId)
        {
            var service = new CrudeDefaultErrorTypeRefServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByDefaultErrorTypeRcd(defaultErrorTypeRcd);
                textBoxDefaultErrorType.Text     = _contract.DefaultErrorTypeRcd;
                textBoxDefaultErrorTypeName.Text = _contract.DefaultErrorTypeName;
                _contract.DefaultUserId          = defaultUserId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
        public ActionResult CrudeDefaultErrorTypeRefEdit(
            System.String defaultErrorTypeRcd
            )
        {
            CrudeDefaultErrorTypeRefContract contract = new CrudeDefaultErrorTypeRefServiceClient().FetchByDefaultErrorTypeRcd(defaultErrorTypeRcd);

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultErrorTypeRef/CrudeDefaultErrorTypeRefEdit.cshtml",
                       contract
                       ));
        }