void FindOrAddCxlfee(ICoreSys sys, FlextourEntities context, string code, int ntsPrior, decimal pctPenalty)
        {
            CXLFEE cxlFee = context.CXLFEE.FirstOrDefault(c => c.TYPE == "OPT" && c.CODE == code && c.CAT == null && c.START_DATE == null &&
                                                          c.END_DATE == null && c.AGENCY == sys.Settings.DefaultAgency);

            if (cxlFee == null)
            {
                cxlFee = new CXLFEE()
                {
                    TYPE       = "OPT",
                    CODE       = code,
                    CAT        = null,
                    START_DATE = null,
                    END_DATE   = null,
                    AGENCY     = sys.Settings.DefaultAgency,
                };
                context.CXLFEE.AddObject(cxlFee);
            }
            cxlFee.NTS_PRIOR     = (short)ntsPrior;
            cxlFee.Description   = null;
            cxlFee.NonRefundable = (ntsPrior == 999) || pctPenalty == 100;
            cxlFee.PCT_AMT       = (float)pctPenalty;
            cxlFee.FLAT_FEE      = null;
            cxlFee.NBR_NTS       = null;
            cxlFee.TimeBasis     = (short)Enumerations.FlexCancelFeeTimeBasis.flxCancelFeeTimeBasisBeforeArrival;
            cxlFee.TimeUnits     = (short)Enumerations.FlexTimeUnits.flxTimeUnitsDays;
            MediaHelper.SetCxlfeeChgDate(context, cxlFee, _update, _sys.User.Name);
        }
Exemple #2
0
        private void EntityInstantFeedbackSource_GetQueryable(object sender, DevExpress.Data.Linq.GetQueryableEventArgs e)
        {
            FlextourEntities context = new FlextourEntities(Connection.EFConnectionString);

            e.QueryableSource = context.REGION;
            e.Tag             = context;
        }
Exemple #3
0
 internal static void CheckAndAddResource(FlextourEntities context, List <RESOURCE> resources, MEDIAINFO section, string imagePath,
                                          string description, string resolution)
 {
     if (!string.IsNullOrEmpty(imagePath))
     {
         bool resourceExists = false;
         if (section.ID != 0)
         {
             string id = section.ID.ToString();
             resourceExists = context.RESOURCE.Any(r => r.LINK_TABLE == "MEDIAITEM" && r.RECTYPE == "IMAGE" &&
                                                   r.ITEM == imagePath && r.LINK_VALUE == id);
         }
         if (!resourceExists)
         {
             RESOURCE resource = new RESOURCE();
             resource.LINK_TABLE = "MEDIAITEM";
             resource.RECTYPE    = "IMAGE";
             resource.TAG        = resolution; //resolution
             resource.ITEM       = imagePath;
             if (description.Length <= 50)
             {
                 resource.DESCRIPTION = description;
             }
             else
             {
                 resource.DESCRIPTION = description.Substring(0, 50);
             }
             resources.Add(resource);
         }
     }
 }
Exemple #4
0
 public cruitItemForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     CruItItemBindingSource.DataSource = context.CRUITItem;
 }
        public MenuConfigForm(FlexCore.CoreSys _sys)
        {
            InitializeComponent();
            Connection.EFConnectionString = _sys.Settings.EFConnectionString;
            context  = new FlextourEntities(_sys.Settings.EFConnectionString);
            username = _sys.User.Name;
            //menuItemBindingSource.DataSource = context.MenuItem;
            _FlexSys = _sys;
            var results = context.MenuItem;
            var result  = results.OrderBy(c => c.ParentID);

            foreach (var ed in result)
            {
                if (ed.Name == "ribbonControl")
                {
                    createRibControl();
                }

                if (ed.Type == "XtraBars.Ribbon.RibbonPage")
                {
                    createRibPage(ed.Caption);
                }

                if (ed.Type == "XtraBars.Ribbon.RibbonPageGroup")
                {
                    createRibPageGroup(ed.Caption, ed.ID);
                }
            }

            ribbon1.Pages.Add(page1);
        }
Exemple #6
0
        internal static MEDIARPT CheckAndCreateNewMediaRpt(FlextourEntities context, string rptType, string type, string code, string language,
                                                           DateTime?resDate)
        {
            MEDIARPT rpt = null;

            rpt = context.MEDIARPT.FirstOrDefault(m => m.RPT_TYPE == rptType && m.TYPE == type && m.CODE == code && m.LANG == language &&
                                                  m.RESDATE_START == resDate);
            if (rpt == null)
            {
                rpt               = new MEDIARPT();
                rpt.CODE          = code;
                rpt.TYPE          = type;
                rpt.RPT_TYPE      = rptType;
                rpt.LANG          = language;
                rpt.AGENCY        = string.Empty;
                rpt.CAT           = string.Empty;
                rpt.DESC          = string.Empty;
                rpt.RPT_FILE      = string.Empty;
                rpt.Inactive      = false;  //no need for this to be inactive because all the infos in it will be inactive
                rpt.ChgDate       = DateTime.Now;
                rpt.RESDATE_START = resDate;
                rpt.Inhouse       = false;
            }
            return(rpt);
        }
Exemple #7
0
        internal static void CheckAndAddInfoToReports(FlextourEntities context, MEDIARPT[] addToReports, MEDIAINFO info, short?position)
        {
            foreach (var rpt in addToReports)
            {
                MediaRptItem rptItem = null;
                if (rpt.ID > 0 && info.ID > 0)
                {
                    continue;
                    //Checking each existing report and section to see if they are linked is too slow...

                    //If the report and media info section were previously saved, check if they were also linked
                    //together by MediaRptItem
                    //rptItem = context.MediaRptItem.FirstOrDefault(mri => mri.REPORT_ID == rpt.ID && mri.SECTION_ID == info.ID);
                }
                if (rptItem == null)
                {
                    rptItem                  = new MediaRptItem();
                    rptItem.MEDIARPT         = rpt;
                    rptItem.MEDIARPT.ChgDate = DateTime.Now;
                    rptItem.MEDIAINFO        = info;
                    rptItem.POSITION         = position;
                    rpt.MediaRptItem.Add(rptItem);
                }
            }
        }
Exemple #8
0
        public MainMenu(FlexCore.CoreSys sys)
        {
            InitializeComponent();
            InitSkinGallery();
            _FlexSys = sys;

            Connection.EFConnectionString = _FlexSys.Settings.EFConnectionString;
            context  = new FlextourEntities(_FlexSys.Settings.EFConnectionString);
            username = _FlexSys.User.Name;
            _menus   = context.MenuItem.Where(c => (c.Visible ?? false) && c.AppName == "FlexOffice").
                       OrderBy(c => c.ParentID).ThenBy(c => c.Position).ToList();
            _security = context.MenuItemSecurity.Where(c => c.UserID == username).ToList();
            var root = _menus.First(m => m.ParentID == null);

            createRibControl();
            foreach (var item in _menus.Where(m => m.ParentID == root.ID))
            {
                if (!_security.Any(s => s.MenuItem_ID == item.ID))
                {
                    createRibPage(item);
                }
            }

            ribbon1.Pages.Add(ribbonPageGallery);
        }
Exemple #9
0
 public ResListForm(string val, FlexCore.CoreSys _sys)
 {
     value = val;
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     ResHdrBindingSource.DataSource = from c in context.RESHDR where c.AGY_NO.Trim() == value && c.Inactive != true select c;
 }
Exemple #10
0
 public LookupForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     LookupBindingSource.DataSource = context.LOOKUP;
     advBandedGridView1.ExpandAllGroups();
 }
Exemple #11
0
 private void Connect(FlexInterfaces.Core.ICoreSys sys)
 {
     Connection.EFConnectionString = sys.Settings.EFConnectionString;
     _context = new FlextourEntities(sys.Settings.EFConnectionString);
     _context.CommandTimeout = 600;
     _context.ContextOptions.UseCSharpNullComparisonBehavior = true;
     importMappingBindingSource.DataSource = _context.ImportMapping.OrderBy(i => i.Code).ThenBy(i => i.WeekdaySurcharge);
 }
Exemple #12
0
 internal static void SetCxlfeeChgDate(FlextourEntities context, CXLFEE cxlFee, DateTime updated, string user)
 {
     if (cxlFee.IsModified(context))
     {
         cxlFee.LAST_UPD = updated;
         cxlFee.UPD_INIT = user;
     }
 }
Exemple #13
0
 /// <summary>
 /// Check whether any property in a COMP object has changed, and if so, set the ChgDate
 /// </summary>
 /// <remarks>
 /// The object must be attached to the context for this to work, otherwise an exception will be thrown
 /// </remarks>
 internal static void SetServiceChgDate(FlextourEntities context, COMP comp, DateTime updated, string user)
 {
     if (comp.IsModified(context))
     {
         comp.LAST_UPD = updated;
         comp.UPD_INIT = user;
     }
 }
Exemple #14
0
 private void Connect(FlexInterfaces.Core.ICoreSys sys)
 {
     Connection.EFConnectionString = sys.Settings.EFConnectionString;
     context = new FlextourEntities(sys.Settings.EFConnectionString);
     sys.Connect("");
     imagesRoot = sys.Settings.ImagesRoot;
     sys.Disconnect();
 }
Exemple #15
0
        private void Connect(FlexInterfaces.Core.ICoreSys sys)
        {
            Connection.EFConnectionString = sys.Settings.EFConnectionString;
            context        = new FlextourEntities(sys.Settings.EFConnectionString);
            username       = sys.User.Name;
            _accountingURL = sys.Settings.TourAccountingURL;

            ////////////////
        }
Exemple #16
0
        public UserFieldsForm(FlexCore.CoreSys _sys)
        {
            InitializeComponent();
            Connection.EFConnectionString = _sys.Settings.EFConnectionString;
            context = new FlextourEntities(_sys.Settings.EFConnectionString);
            UserFieldsBindingSource.DataSource = context.USERFIELDS;

            //  int maxlength = context.AGY.Max(x => x.USER_TXT1.Length);
        }
Exemple #17
0
 public BookSelForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     gsLoad.gridSearchLoad(codeSearch, "SelGroup", "SelGroup", "SelGroup", "SelGroup", "SelGroup");
     codeSearch.GridControl.DataSource  = (from c in context.BookSel select new { c.SelGroup }).Distinct();
     codeSearch.ButtonEdit.TextChanged += ButtonEdit_TextChanged;
 }
Exemple #18
0
 public ConsrtForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context  = new FlextourEntities(_sys.Settings.EFConnectionString);
     username = _sys.User.Name;
     //ConsrtBindingSource.DataSource = context.CONSRT;
     cODETextEdit.Properties.ReadOnly = true;
     GridViewConsrt.Columns.ColumnByName(colName).OptionsColumn.AllowEdit = false;
 }
Exemple #19
0
 /// <summary>
 /// Check whether any property in a MEDIAINFO section has changed, and if so, set the ChgDate
 /// </summary>
 /// <remarks>
 /// The object must be attached to the context for this to work, otherwise an exception will be thrown
 /// </remarks>
 internal static void SetMediaInfosChgDate(FlextourEntities context, List <MEDIAINFO> infos, DateTime updated)
 {
     //http://stackoverflow.com/a/7115649
     foreach (var info in infos)
     {
         if (info.IsModified(context))
         {
             info.ChgDate = updated;
         }
     }
 }
Exemple #20
0
        public VouchGenForm(FlexCore.CoreSys _sys)
        {
            InitializeComponent();
            Connection.EFConnectionString = _sys.Settings.EFConnectionString;
            context = new FlextourEntities(_sys.Settings.EFConnectionString);
            VoucherBindingSource.DataSource = context.VOUCHER;
            gsLoad.gridSearchLoad(codeSearch, "CODE", "NAME", "Code", "Name", "CODE", "CODE", "CODE", VoucherBindingSource, "Code");

            gsLoad.gridSearchLoad(catSearch, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE", VoucherBindingSource, "Cat");

            catSearch.GridControl.DataSource = context.ROOMCOD;
        }
Exemple #21
0
 public invtInq2Form(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     gsLoad.gridSearchLoad(catSearch, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(agencySearch, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     agencySearch.GridControl.DataSource = from c in context.AGY select new { c.NO, c.NAME };
     catSearch.GridControl.DataSource    = from c in context.ROOMCOD select new { c.CODE, c.DESC };
     gridControl1.DataSource             = from c in context.INVT where c.CODE == codeSearch.Text.TrimEnd() && c.CAT == "KJM" select c;
     //InvtBindingSource.DataSource = context.INVT.Take(100000);
 }
Exemple #22
0
 public AmenAssignForm(FlexInterfaces.Core.ICoreSys sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = sys.Settings.EFConnectionString;
     context = new FlextourEntities(sys.Settings.EFConnectionString);
     //treeList2.ParentFieldName = "PARENT_CODE";
     //treeList2.KeyFieldName = "CODE";
     //treeList1.KeyFieldName = "CODE";
     //treeList1.ParentFieldName = "PARENT_CODE";
     LoadLookups();
     modifiedRecs = new System.Collections.Generic.List <string>();
 }
Exemple #23
0
 public GroupForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     gsLoad.gridSearchLoad(pkgSearch, "CODE", "NAME", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(catSearch, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(agencySearch, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     pkgSearch.GridControl.DataSource    = from c in context.PACK select new { c.CODE, c.NAME };
     agencySearch.GridControl.DataSource = from c in context.AGY select new { c.NO, c.NAME };
     catSearch.GridControl.DataSource    = from c in context.ROOMCOD select new { c.CODE, c.DESC };
     cOMM_PCTTextEdit.Enabled            = false;
 }
Exemple #24
0
 public DigHdrForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context  = new FlextourEntities(_sys.Settings.EFConnectionString);
     modified = false;
     newRec   = false;
     agencySearch.ButtonEdit.Properties.ReadOnly = true;
     cOUP_RESTextEdit.Properties.ReadOnly        = true;
     gsLoad.gridSearchLoad(agencySearch, "NO", "NAME", "Code", "Description", "NO", "NO", "NAME", DigHdrBindingSource, "AGY_NO");
     agencySearch.GridControl.DataSource = context.AGY;
     DigHdrBindingSource.DataSource      = context.DIGHDR.Take(1000);
     username = _sys.User.Name;
 }
Exemple #25
0
 public InvtChgForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     gsLoad.gridSearchLoad(agencySearch, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     gsLoad.gridSearchLoad(relAgencySearch, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     agencySearch.GridControl.DataSource    = from c in context.AGY select new { c.NO, c.NAME };
     relAgencySearch.GridControl.DataSource = from c in context.AGY select new { c.NO, c.NAME };
     gsLoad.gridSearchLoad(catSearch, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(relCatSearch, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE");
     catSearch.GridControl.DataSource    = from c in context.ROOMCOD select new { c.CODE, c.DESC };
     relCatSearch.GridControl.DataSource = from c in context.ROOMCOD select new { c.CODE, c.DESC };
 }
Exemple #26
0
        public MediaInfoMatchForm(FlextourEntities cont, MEDIAINFO record)
        {
            InitializeComponent();
            context           = cont;
            rcd               = record;
            AddButton.Visible = true;

            List <MEDIARPT> resultList = loadGrid(record);

            if (resultList.Count > 0)
            {
                GridViewAddToReports.GridControl.DataSource = resultList;
            }
        }
Exemple #27
0
        public MediaInfoMatchForm(FlextourEntities cont, int ID)
        {
            InitializeComponent();
            mediaInfoSectID = ID;
            GridViewAddToReports.Columns.ColumnByFieldName("Selected").Visible = false;
            AddButton.Visible = false;
            context           = cont;
            GridViewAddToReports.GridControl.DataSource = from mediaRpt in context.MediaRptItem
                                                          from rpt in context.MEDIARPT
                                                          where mediaRpt.SECTION_ID == ID && rpt.ID == mediaRpt.REPORT_ID
                                                          select new { mediaRpt.POSITION, rpt.RPT_TYPE, rpt.LANG, rpt.TYPE, rpt.CODE, rpt.CAT, rpt.AGENCY,
                                                                       rpt.SVCDATE_START, rpt.SVCDATE_END, rpt.RESDATE_START, rpt.RESDATE_END };

            GridViewAddToReports.OptionsBehavior.Editable = false;
        }
Exemple #28
0
 public invtCopyForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context  = new FlextourEntities(_sys.Settings.EFConnectionString);
     username = _sys.User.Name;
     loadCodeSearch.ButtonEdit.TextChanged += ButtonEdit_TextChanged;
     copyCodeSearch.ButtonEdit.TextChanged += ButtonEdit_TextChanged1;
     gsLoad.gridSearchLoad(agencySearch, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     gsLoad.gridSearchLoad(gridSearchControl4, "CODE", "DESC", "Code", "Name", "CODE", "CODE", "CODE");
     agencySearch.GridControl.DataSource               = from c in context.AGY select new { c.NO, c.NAME };
     gridSearchControl4.GridControl.DataSource         = from c in context.ROOMCOD select new { c.CODE, c.DESC };
     agencySearch.ButtonEdit.Properties.ReadOnly       = true;
     gridSearchControl4.ButtonEdit.Properties.ReadOnly = true;
 }
 public insuranCopyForm(FlexCore.CoreSys _sys)
 {
     InitializeComponent();
     Connection.EFConnectionString = _sys.Settings.EFConnectionString;
     context = new FlextourEntities(_sys.Settings.EFConnectionString);
     gsLoad.gridSearchLoad(loadAgencySearch, "CODE", "NAME", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(copyAgencySearch, "CODE", "NAME", "Code", "Name", "CODE", "CODE", "CODE");
     gsLoad.gridSearchLoad(gridSearchControl3, "NO", "NAME", "Code", "Name", "NO", "NO", "NO");
     loadAgencySearch.GridControl.DataSource           = from c in context.AGY select new { c.NO, c.NAME };
     copyAgencySearch.GridControl.DataSource           = from c in context.AGY select new { c.NO, c.NAME };
     gridSearchControl3.GridControl.DataSource         = from c in context.AGY select new { c.NO, c.NAME };
     loadAgencySearch.ButtonEdit.TextChanged          += ButtonEdit_TextChanged;
     copyAgencySearch.ButtonEdit.TextChanged          += ButtonEdit_TextChanged1;
     gridSearchControl3.ButtonEdit.Properties.ReadOnly = true;
 }
Exemple #30
0
        public AmenityForm(FlexCore.CoreSys _sys)
        {
            InitializeComponent();

            Connection.EFConnectionString = _sys.Settings.EFConnectionString;
            context = new FlextourEntities(_sys.Settings.EFConnectionString);
            _sys.Connect("");
            imagesRoot = _sys.Settings.ImagesRoot;
            _sys.Disconnect();
            modified = false;
            newRec   = false;

            setreadonly(true);
            enableNavigator(false);
            sVCComboBoxEdit.Focus();
        }