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); }
private void EntityInstantFeedbackSource_GetQueryable(object sender, DevExpress.Data.Linq.GetQueryableEventArgs e) { FlextourEntities context = new FlextourEntities(Connection.EFConnectionString); e.QueryableSource = context.REGION; e.Tag = context; }
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); } } }
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); }
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); }
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); } } }
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); }
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; }
public LookupForm(FlexCore.CoreSys _sys) { InitializeComponent(); Connection.EFConnectionString = _sys.Settings.EFConnectionString; context = new FlextourEntities(_sys.Settings.EFConnectionString); LookupBindingSource.DataSource = context.LOOKUP; advBandedGridView1.ExpandAllGroups(); }
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); }
internal static void SetCxlfeeChgDate(FlextourEntities context, CXLFEE cxlFee, DateTime updated, string user) { if (cxlFee.IsModified(context)) { cxlFee.LAST_UPD = updated; cxlFee.UPD_INIT = user; } }
/// <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; } }
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(); }
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; //////////////// }
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); }
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; }
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; }
/// <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; } } }
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; }
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); }
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>(); }
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; }
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; }
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 }; }
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; } }
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; }
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; }
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(); }