コード例 #1
0
        //// ////////////////////////////////////////////////////////////////////////
        //// PRIVATE METHODS
        ////
        /// <summary>
        /// Save all bondingCompanies to database (direct)
        /// </summary>
        /// <param name="companyId">companyId</param>        
        public void Save(int companyId)
        {
            HotelsAddTDS hotelsChanges = (HotelsAddTDS)Data.GetChanges();

            if (hotelsChanges.Hotels.Rows.Count > 0)
            {
                HotelsAddHotelsGateway hotelsAddHotelsGateway = new HotelsAddHotelsGateway(hotelsChanges);

                foreach (HotelsAddTDS.HotelsRow row in (HotelsAddTDS.HotelsDataTable)hotelsChanges.Hotels)
                {
                    //Insert companies
                    Hotels hotels = new Hotels(null);
                    hotels.InsertDirect(row.COMPANIES_ID, row.Date, row.Name,  row.Deleted, row.COMPANY_ID);
                }
            }
        }
コード例 #2
0
        private bool StepHotelNext()
        {
            int selectedCompaniesIdForHotels = Int32.Parse(ddlCompaniesForHotels.SelectedValue);
            int companyIdForHotels = Int32.Parse(hdfCompanyIdForHotels.Value);

            HotelsAddHotelsGateway hotelsAddHotelsGateway = new HotelsAddHotelsGateway();

            if (hotelsAddHotelsGateway.IsInLfs(selectedCompaniesIdForHotels, companyIdForHotels))
            {
                lblUserErrorMessageForHotels.Visible = true;
            }
            else
            {
                lblUserErrorMessageForHotels.Visible = false;

                // Get name
                int companiesIdForHotels = Int32.Parse(ddlCompaniesForHotels.SelectedValue);
                DateTime dateForHotels = DateTime.Now;

                // Insert subcontractor
                hdfNameForHotels.Value = GetCompanyName(companiesIdForHotels, companyIdForHotels);

                HotelsAddHotels model = new HotelsAddHotels(hotelsAddTDS);
                model.Insert(companiesIdForHotels, dateForHotels, hdfNameForHotels.Value, false, companyIdForHotels);

                // ... Store tables
                Session["hotelsAddTDS"] = hotelsAddTDS;
            }
            return true;
        }
コード例 #3
0
        private bool StepBeginNext()
        {
            int selectedCompaniesId = Int32.Parse(ddlCompanies.SelectedValue);
            int companyId = Int32.Parse(hdfCompanyId.Value);

            HotelsAddHotelsGateway hotelsAddHotelsGateway = new HotelsAddHotelsGateway();

            if (hotelsAddHotelsGateway.IsInLfs(selectedCompaniesId, companyId))
            {
                lblUserErrorMessage.Visible = true;
                return false;
            }
            else
            {
                lblUserErrorMessage.Visible = false;

                // Get name
                int companiesId = Int32.Parse(ddlCompanies.SelectedValue);
                DateTime date = DateTime.Now;

                // Insert subcontractor
                CompaniesGatewayRAF companiesGatewayRAF = new CompaniesGatewayRAF();
                companiesGatewayRAF.LoadByCompaniesId(companiesId, companyId);

                hdfName.Value = companiesGatewayRAF.GetName(companiesId);

                HotelsAddHotels model = new HotelsAddHotels(hotelsAddTDS);
                model.Insert(companiesId, date, hdfName.Value, false, companyId);

                // ... Store tables
                Session["hotelsAddTDS"] = hotelsAddTDS;
            }
            return true;
        }