Ejemplo n.º 1
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 aircraftId, string aircraftDocumentTypeRcd, string documentName, System.DateTime documentDateTime, System.DateTime expiryDateTime, System.Guid userId)
        {
            try {
                _contract            = new CrudeAircraftDocumentContract();
                _isNew               = true;
                _contract.AircraftId = aircraftId;
                _contract.AircraftDocumentTypeRcd      = aircraftDocumentTypeRcd;
                aircraftDocumentTypeRefCombo.Text      = _contract.AircraftDocumentTypeRcd != null ? _contract.AircraftDocumentTypeRcd : String.Empty;
                _contract.DocumentName                 = documentName;
                textBoxDocumentName.Text               = _contract.DocumentName;
                _contract.DocumentDateTime             = documentDateTime;
                dateTimePickerDocumentDateTime.Value   = _contract.DocumentDateTime != DateTime.MinValue ? _contract.DocumentDateTime : dateTimePickerDocumentDateTime.MinDate;
                dateTimePickerDocumentDateTime.Checked = _contract.DocumentDateTime != DateTime.MinValue;
                _contract.ExpiryDateTime               = expiryDateTime;
                dateTimePickerExpiryDateTime.Value     = _contract.ExpiryDateTime != DateTime.MinValue ? _contract.ExpiryDateTime : dateTimePickerExpiryDateTime.MinDate;
                dateTimePickerExpiryDateTime.Checked   = _contract.ExpiryDateTime != DateTime.MinValue;
                _contract.UserId            = userId;
                userPicker.SelectedValue    = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Ejemplo n.º 2
0
        // bring up edit form for AircraftDocument
        // links:
        //  docLink: http://sql2x.org/documentationLink/d7ff032d-3bcf-438f-9850-900ca0ebca98
        public void ShowAsEdit(System.Guid aircraftDocumentId)
        {
            var service = new CrudeAircraftDocumentServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByAircraftDocumentId(aircraftDocumentId);
                aircraftDocumentTypeRefCombo.Text      = _contract.AircraftDocumentTypeRcd != null ? _contract.AircraftDocumentTypeRcd : String.Empty;
                textBoxDocumentName.Text               = _contract.DocumentName;
                dateTimePickerDocumentDateTime.Value   = _contract.DocumentDateTime != DateTime.MinValue ? _contract.DocumentDateTime : dateTimePickerDocumentDateTime.MinDate;
                dateTimePickerDocumentDateTime.Checked = _contract.DocumentDateTime != DateTime.MinValue;
                dateTimePickerExpiryDateTime.Value     = _contract.ExpiryDateTime != DateTime.MinValue ? _contract.ExpiryDateTime : dateTimePickerExpiryDateTime.MinDate;
                dateTimePickerExpiryDateTime.Checked   = _contract.ExpiryDateTime != DateTime.MinValue;
                userPicker.SelectedValue               = _contract.UserId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                RefreshAircraftDocument();
                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
        }
Ejemplo n.º 3
0
 // bring up add form for AircraftDocument
 // links:
 //  docLink: http://sql2x.org/documentationLink/c0944961-8179-40a2-a561-c8873b691f2c
 public void ShowAsAdd()
 {
     _contract  = new CrudeAircraftDocumentContract();
     _isNew     = true;
     this.Text += " - Not Savable (Aircraft Missing)";
     RefreshAircraftDocument();
     Show();
 }
Ejemplo n.º 4
0
        // bring up add form for AircraftDocument by foreign key Aircraft
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByAircraft(System.Guid aircraftId)
        {
            _contract                   = new CrudeAircraftDocumentContract();
            _isNew                      = true;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();
            _contract.AircraftId        = aircraftId;

            RefreshAircraftDocument();
            Show();
        }
Ejemplo n.º 5
0
        // bring up add form for AircraftDocument by foreign key AircraftDocumentType
        // links:
        //  docLink: http://sql2x.org/documentationLink/2461e69c-dd05-47db-8f32-27ac1641a8d9
        public void ShowAsAddByAircraftDocumentType(string aircraftDocumentTypeRcd)
        {
            _contract                         = new CrudeAircraftDocumentContract();
            _isNew                            = true;
            _contract.DateTime                = DateTime.UtcNow;
            dateTimePickerDateTime.Text       = _contract.DateTime.ToString();
            _contract.AircraftDocumentTypeRcd = aircraftDocumentTypeRcd;
            aircraftDocumentTypeRefCombo.Text = _contract.AircraftDocumentTypeRcd != null ? _contract.AircraftDocumentTypeRcd : String.Empty;

            RefreshAircraftDocument();
            Show();
        }
Ejemplo n.º 6
0
        // bring up add form for AircraftDocument with rules
        // links:
        //  docLink: http://sql2x.org/documentationLink/6018e96e-28a1-4df4-879b-01a6bda81cc7
        public void ShowAsAddByRules(System.Guid userId)
        {
            _contract                   = new CrudeAircraftDocumentContract();
            _isNew                      = true;
            _contract.UserId            = userId;
            userPicker.SelectedValue    = _contract.UserId;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();

            RefreshAircraftDocument();
            Show();
        }
        public ActionResult CrudeAircraftDocumentCreate([Bind()] CrudeAircraftDocumentContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeAircraftDocumentServiceClient().Insert(contract);

                return(RedirectToAction("CrudeAircraftDocumentIndex"));
            }

            return(View(
                       "~/Views/Crude/Aircraft/CrudeAircraftDocument/CrudeAircraftDocumentCreate.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeAircraftDocumentEdit([Bind()] CrudeAircraftDocumentContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeAircraftDocumentServiceClient().Update(contract);

                return(RedirectToAction("CrudeAircraftDocumentIndex"));
            }

            return(View(
                       "~/Views/Crude/Aircraft/CrudeAircraftDocument/CrudeAircraftDocumentEdit.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeAircraftDocumentCreate(System.Guid?aircraftId, System.Guid?userId)
        {
            var contract = new CrudeAircraftDocumentContract();

            if (aircraftId != null)
            {
                contract.AircraftId = (System.Guid)aircraftId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

            ViewBag.AircraftId =
                new SelectList(new CrudeAircraftServiceClient().FetchAll(),
                               "AircraftId",
                               "AircraftName",
                               contract.AircraftId
                               );

            ViewBag.AircraftDocumentTypeRcd =
                new SelectList(new CrudeAircraftDocumentTypeRefServiceClient().FetchAll(),
                               "AircraftDocumentTypeRcd",
                               "AircraftDocumentTypeName",
                               contract.AircraftDocumentTypeRcd
                               );

            contract.DocumentDateTime = DateTime.UtcNow;

            contract.ExpiryDateTime = DateTime.UtcNow;

            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/Aircraft/CrudeAircraftDocument/CrudeAircraftDocumentCreate.cshtml",
                       contract
                       ));
        }
Ejemplo n.º 10
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 CrudeAircraftDocumentContract();
         _isNew     = true;
         this.Text += " - Not Savable (Aircraft Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Ejemplo n.º 11
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByAircraft(System.Guid aircraftId)
        {
            try {
                _contract                   = new CrudeAircraftDocumentContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.AircraftId        = aircraftId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Ejemplo n.º 12
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByAircraftDocumentType(string aircraftDocumentTypeRcd)
        {
            try {
                _contract                         = new CrudeAircraftDocumentContract();
                _isNew                            = true;
                _contract.DateTime                = DateTime.UtcNow;
                dateTimePickerDateTime.Text       = _contract.DateTime.ToString();
                _contract.AircraftDocumentTypeRcd = aircraftDocumentTypeRcd;
                aircraftDocumentTypeRefCombo.Text = _contract.AircraftDocumentTypeRcd != null ? _contract.AircraftDocumentTypeRcd : String.Empty;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Ejemplo n.º 13
0
        // bring up add form for AircraftDocument
        // links:
        //  docLink: http://sql2x.org/documentationLink/8568fd9a-b807-4aad-ac74-7826975e3241
        public void ShowAsAdd(System.Guid aircraftId, string aircraftDocumentTypeRcd, string documentName, System.DateTime documentDateTime, System.DateTime expiryDateTime, System.Guid userId)
        {
            _contract            = new CrudeAircraftDocumentContract();
            _isNew               = true;
            _contract.AircraftId = aircraftId;
            _contract.AircraftDocumentTypeRcd      = aircraftDocumentTypeRcd;
            aircraftDocumentTypeRefCombo.Text      = _contract.AircraftDocumentTypeRcd != null ? _contract.AircraftDocumentTypeRcd : String.Empty;
            _contract.DocumentName                 = documentName;
            textBoxDocumentName.Text               = _contract.DocumentName;
            _contract.DocumentDateTime             = documentDateTime;
            dateTimePickerDocumentDateTime.Value   = _contract.DocumentDateTime != DateTime.MinValue ? _contract.DocumentDateTime : dateTimePickerDocumentDateTime.MinDate;
            dateTimePickerDocumentDateTime.Checked = _contract.DocumentDateTime != DateTime.MinValue;
            _contract.ExpiryDateTime               = expiryDateTime;
            dateTimePickerExpiryDateTime.Value     = _contract.ExpiryDateTime != DateTime.MinValue ? _contract.ExpiryDateTime : dateTimePickerExpiryDateTime.MinDate;
            dateTimePickerExpiryDateTime.Checked   = _contract.ExpiryDateTime != DateTime.MinValue;
            _contract.UserId            = userId;
            userPicker.SelectedValue    = userId;
            _contract.DateTime          = DateTime.UtcNow;
            dateTimePickerDateTime.Text = _contract.DateTime.ToString();

            RefreshAircraftDocument();
            Show();
        }