Exemplo n.º 1
0
        public static Guid ErrorLog(
            string controller,
            string action,
            string message,
            string stackTrace
            )
        {
            var contract = new CrudeDefaultErrorContract();

            try {
                contract.DefaultErrorId       = Guid.NewGuid();
                contract.DefaultErrorTypeRcd  = DefaultErrorTypeRef.UserInitiated;
                contract.DefaultErrorLayerRcd = DefaultErrorLayerRef.ASPModelViewController;
                contract.DomainName           = "General";
                contract.ClassName            = controller;
                contract.MethodName           = action;
                contract.StackTrace           = stackTrace;
                contract.ErrorMessage         = message;
                contract.DefaultUserId        = new Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");
                contract.DateTime             = DateTime.UtcNow;

                var activity = new CrudeDefaultErrorServiceClient();
                activity.Insert(contract);
                activity.Close();
            } catch {
            };

            return(contract.DefaultErrorId);
        }
Exemplo n.º 2
0
        // 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 CrudeDefaultErrorServiceClient();

            try {
                _contract.DefaultErrorLayerRcd = defaultErrorLayerRefCombo.Text;
                _contract.DefaultErrorTypeRcd  = defaultErrorTypeRefCombo.Text;
                _contract.LayerAddress         = textBoxLayerAddress.Text;
                _contract.ErrorMessage         = textBoxErrorMessage.Text;
                _contract.StackTrace           = textBoxStackTrace.Text;
                _contract.MethodName           = textBoxMethodName.Text;
                _contract.DomainName           = textBoxDomainName.Text;
                _contract.ClassName            = textBoxClassName.Text;
                _contract.DateTime             = dateTimePickerDateTime.Checked ? Convert.ToDateTime(dateTimePickerDateTime.Value): DateTime.MinValue;

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

            Close();
        }