コード例 #1
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid bookingId)
        {
            var service = new CrudeBookingServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByBookingId(bookingId);
                textBoxReceivedFrom.Text                = _contract.ReceivedFrom;
                bookingSourceRefCombo.Text              = _contract.BookingSourceRcd != null ? _contract.BookingSourceRcd : String.Empty;
                externalSystemPicker.SelectedValue      = _contract.ExternalSystemId;
                agencyPicker.SelectedValue              = _contract.AgencyId;
                financialCurrencyPicker.SelectedValue   = _contract.FinancialCurrencyId;
                financialCostcentrePicker.SelectedValue = _contract.FinancialCostcentreId;
                textBoxComment.Text         = _contract.Comment;
                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();
            }
        }
コード例 #2
0
        public ActionResult CrudeBookingCreate([Bind()] CrudeBookingContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeBookingServiceClient().Insert(contract);

                return(RedirectToAction("CrudeBookingIndex"));
            }

            return(View(
                       "~/Views/Crude/Booking/CrudeBooking/CrudeBookingCreate.cshtml",
                       contract
                       ));
        }
コード例 #3
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
 // 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 CrudeBookingContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
コード例 #4
0
        public ActionResult CrudeBookingEdit([Bind()] CrudeBookingContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeBookingServiceClient().Update(contract);

                return(RedirectToAction("CrudeBookingIndex"));
            }

            return(View(
                       "~/Views/Crude/Booking/CrudeBooking/CrudeBookingEdit.cshtml",
                       contract
                       ));
        }
コード例 #5
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByAddress(System.Guid addressId)
        {
            try {
                _contract                   = new CrudeBookingContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.AddressId         = addressId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
コード例 #6
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // 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 CrudeBookingContract();
                _isNew                      = true;
                _contract.UserId            = userId;
                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();
                }
            }
        }
コード例 #7
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFinancialCostcentre(System.Guid financialCostcentreId)
        {
            try {
                _contract                               = new CrudeBookingContract();
                _isNew                                  = true;
                _contract.DateTime                      = DateTime.UtcNow;
                dateTimePickerDateTime.Text             = _contract.DateTime.ToString();
                _contract.FinancialCostcentreId         = financialCostcentreId;
                financialCostcentrePicker.SelectedValue = _contract.FinancialCostcentreId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
コード例 #8
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByBookingSource(string bookingSourceRcd)
        {
            try {
                _contract                   = new CrudeBookingContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.BookingSourceRcd  = bookingSourceRcd;
                bookingSourceRefCombo.Text  = _contract.BookingSourceRcd != null ? _contract.BookingSourceRcd : String.Empty;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
コード例 #9
0
ファイル: CrudeBookingEdit.cs プロジェクト: jacov/nor-port
        // shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28
        public void ShowAsAdd(string receivedFrom, System.Guid addressId, string bookingSourceRcd, System.Guid externalSystemId, System.Guid agencyId, System.Guid financialCurrencyId, System.Guid financialCostcentreId, string comment, System.Guid userId)
        {
            try {
                _contract = new CrudeBookingContract();
                _isNew    = true;
                _contract.ReceivedFrom             = receivedFrom;
                textBoxReceivedFrom.Text           = _contract.ReceivedFrom;
                _contract.AddressId                = addressId;
                _contract.BookingSourceRcd         = bookingSourceRcd;
                bookingSourceRefCombo.Text         = _contract.BookingSourceRcd != null ? _contract.BookingSourceRcd : String.Empty;
                _contract.ExternalSystemId         = externalSystemId;
                externalSystemPicker.SelectedValue = _contract.ExternalSystemId;
                _contract.AgencyId                      = agencyId;
                agencyPicker.SelectedValue              = _contract.AgencyId;
                _contract.FinancialCurrencyId           = financialCurrencyId;
                financialCurrencyPicker.SelectedValue   = _contract.FinancialCurrencyId;
                _contract.FinancialCostcentreId         = financialCostcentreId;
                financialCostcentrePicker.SelectedValue = _contract.FinancialCostcentreId;
                _contract.Comment           = comment;
                textBoxComment.Text         = _contract.Comment;
                _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();
                }
            }
        }
コード例 #10
0
        public ActionResult CrudeBookingCreate(System.Guid?addressId, System.Guid?externalSystemId, System.Guid?agencyId, System.Guid?financialCurrencyId, System.Guid?financialCostcentreId, System.Guid?userId)
        {
            var contract = new CrudeBookingContract();

            if (addressId != null)
            {
                contract.AddressId = (System.Guid)addressId;
            }
            if (externalSystemId != null)
            {
                contract.ExternalSystemId = (System.Guid)externalSystemId;
            }
            if (agencyId != null)
            {
                contract.AgencyId = (System.Guid)agencyId;
            }
            if (financialCurrencyId != null)
            {
                contract.FinancialCurrencyId = (System.Guid)financialCurrencyId;
            }
            if (financialCostcentreId != null)
            {
                contract.FinancialCostcentreId = (System.Guid)financialCostcentreId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

            ViewBag.BookingSourceRcd =
                new SelectList(new CrudeBookingSourceRefServiceClient().FetchAll(),
                               "BookingSourceRcd",
                               "BookingSourceName",
                               contract.BookingSourceRcd
                               );

            ViewBag.ExternalSystemId =
                new SelectList(new CrudeExternalSystemServiceClient().FetchAll(),
                               "ExternalSystemId",
                               "ExternalSystemName",
                               contract.ExternalSystemId
                               );

            ViewBag.AgencyId =
                new SelectList(new CrudeAgencyServiceClient().FetchAll(),
                               "AgencyId",
                               "AgencyName",
                               contract.AgencyId
                               );

            ViewBag.FinancialCurrencyId =
                new SelectList(new CrudeFinancialCurrencyServiceClient().FetchAll(),
                               "FinancialCurrencyId",
                               "FinancialCurrencyTypeName",
                               contract.FinancialCurrencyId
                               );

            ViewBag.FinancialCostcentreId =
                new SelectList(new CrudeFinancialCostcentreServiceClient().FetchAll(),
                               "FinancialCostcentreId",
                               "FinancialCostcentreName",
                               contract.FinancialCostcentreId
                               );

            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/Booking/CrudeBooking/CrudeBookingCreate.cshtml",
                       contract
                       ));
        }