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

            _isNew = false;
            try {
                _contract = service.FetchByFerryIdentifierId(ferryIdentifierId);
                ferryIdentifierTypeRefCombo.Text = _contract.FerryIdentifierTypeRcd != null ? _contract.FerryIdentifierTypeRcd : String.Empty;
                textBoxFerryIdentifierCode.Text  = _contract.FerryIdentifierCode;
                textBoxState.Text           = _contract.StateRcd;
                userPicker.SelectedValue    = _contract.UserId;
                _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 ferryId, string ferryIdentifierTypeRcd, string ferryIdentifierCode, string stateRcd, System.Guid userId)
        {
            try {
                _contract         = new CrudeFerryIdentifierContract();
                _isNew            = true;
                _contract.FerryId = ferryId;
                _contract.FerryIdentifierTypeRcd = ferryIdentifierTypeRcd;
                ferryIdentifierTypeRefCombo.Text = _contract.FerryIdentifierTypeRcd != null ? _contract.FerryIdentifierTypeRcd : String.Empty;
                _contract.FerryIdentifierCode    = ferryIdentifierCode;
                textBoxFerryIdentifierCode.Text  = _contract.FerryIdentifierCode;
                _contract.StateRcd          = stateRcd;
                textBoxState.Text           = _contract.StateRcd;
                _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();
                }
            }
        }
示例#3
0
        public ActionResult CrudeFerryIdentifierCreate([Bind()] CrudeFerryIdentifierContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeFerryIdentifierServiceClient().Insert(contract);

                return(RedirectToAction("CrudeFerryIdentifierIndex"));
            }

            return(View(
                       "~/Views/Crude/Ferry/CrudeFerryIdentifier/CrudeFerryIdentifierCreate.cshtml",
                       contract
                       ));
        }
示例#4
0
        public ActionResult CrudeFerryIdentifierEdit([Bind()] CrudeFerryIdentifierContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeFerryIdentifierServiceClient().Update(contract);

                return(RedirectToAction("CrudeFerryIdentifierIndex"));
            }

            return(View(
                       "~/Views/Crude/Ferry/CrudeFerryIdentifier/CrudeFerryIdentifierEdit.cshtml",
                       contract
                       ));
        }
 // 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 CrudeFerryIdentifierContract();
         _isNew     = true;
         this.Text += " - Not Savable (Ferry Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
示例#6
0
        public ActionResult CrudeFerryIdentifierCreate(System.Guid?ferryId, System.Guid?userId)
        {
            var contract = new CrudeFerryIdentifierContract();

            if (ferryId != null)
            {
                contract.FerryId = (System.Guid)ferryId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

            ViewBag.FerryId =
                new SelectList(new CrudeFerryServiceClient().FetchAll(),
                               "FerryId",
                               "FerryName",
                               contract.FerryId
                               );

            ViewBag.FerryIdentifierTypeRcd =
                new SelectList(new CrudeFerryIdentifierTypeRefServiceClient().FetchAll(),
                               "FerryIdentifierTypeRcd",
                               "FerryIdentifierTypeName",
                               contract.FerryIdentifierTypeRcd
                               );

            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/Ferry/CrudeFerryIdentifier/CrudeFerryIdentifierCreate.cshtml",
                       contract
                       ));
        }
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFerry(System.Guid ferryId)
        {
            try {
                _contract                   = new CrudeFerryIdentifierContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.FerryId           = ferryId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFerryAndFerryIdentifierType(System.Guid ferryId, string ferryIdentifierTypeRcd)
        {
            try {
                _contract                        = new CrudeFerryIdentifierContract();
                _isNew                           = true;
                _contract.DateTime               = DateTime.UtcNow;
                dateTimePickerDateTime.Text      = _contract.DateTime.ToString();
                _contract.FerryId                = ferryId;
                _contract.FerryIdentifierTypeRcd = ferryIdentifierTypeRcd;
                ferryIdentifierTypeRefCombo.Text = _contract.FerryIdentifierTypeRcd != null ? _contract.FerryIdentifierTypeRcd : String.Empty;

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