public void LookupData_SetsFilteredRecords() { Int32 actual = new LookupData().FilteredRecords; Int32 expected = 0; Assert.Equal(expected, actual); }
public void LookupData_CreatesEmpty() { LookupData actual = new LookupData(); Assert.Equal(0, actual.FilteredRows); Assert.Empty(actual.Columns); Assert.Empty(actual.Rows); }
public LookupData LoadMachineGroup() { MachineBIZ biz = new MachineBIZ(); DataTable dt = biz.LoadMachineGroup(); LookupData lookupData = new LookupData(dt, MachineDTO.eColumns.MACHINE_GROUP.ToString(), MachineDTO.eColumns.MACHINE_GROUP.ToString()); return(lookupData); }
/// <summary> /// /// </summary> /// <param name="ClassInfoCD"></param> /// <returns></returns> public LookupData LoadLookupLogTable() { InvTranLogDAO dao = new InvTranLogDAO(CommonLib.Common.CurrentDatabase); DataTable dt = dao.LoadLogTable(null); LookupData lookupData = new LookupData(dt, LogTableDTO.eColumns.TABLE_DESCRIPTION.ToString(), LogTableDTO.eColumns.TABLE_NAME.ToString()); return(lookupData); }
private void LookupData() { LookupDataBIZ biz = new LookupDataBIZ(); LookupData currencyData = biz.LoadLookupClassType(DataDefine.CURRENCY.ToNZString()); cboCurrency.LoadLookupData(currencyData); cboCurrency.SelectedIndex = -1; //LookupData lookupData2 = biz.LoadLookupClassType(DataDefine.MRP_LOCATION.ToNZString()); //cboMRPLocation.LoadLookupData(lookupData2); //cboMRPLocation.SelectedIndex = -1; }
private void InitialComboBox() { cboLocation.Format += Common.ComboBox_Format; LookupDataBIZ bizLookup = new LookupDataBIZ(); DealingDTO dto = new DealingDTO(); dto.LOC_CD = "All".ToNZString(); dto.LOC_DESC = "All Location".ToNZString(); LookupData lookupLocation = bizLookup.LoadLookupLocation_AddDummy(dto); cboLocation.LoadLookupData(lookupLocation); }
public IHttpActionResult PostLookupData(LookupData lookupData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LookupDatas.Add(lookupData); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = lookupData.ID }, lookupData)); }
private void InitializeLookupData() { LookupData lookupShiftCls = m_bizLookupData.LoadLookupClassType(DataDefine.SHIFT_CLS.ToNZString()); cboShiftCls.LoadLookupData(lookupShiftCls); cboShiftCls.SelectedIndex = -1; LookupData personInCharge = m_bizLookupData.LoadPersonInCharge(); evoComboBox1.LoadLookupData(personInCharge); evoComboBox1.SelectedIndex = -1; }
public LookupData LoadPersonInCharge() { SystemMaintenance.BIZ.UserBIZ biz = new SystemMaintenance.BIZ.UserBIZ(); List <SystemMaintenance.DTO.UserDTO> listUser = biz.LoadPersonInCharge(); DataTable dtUser = DTOUtility.ConvertListToDataTable(listUser); LookupData lookupData = new LookupData(dtUser, SystemMaintenance.DTO.UserDTO.eColumns.FULL_NAME.ToString(), SystemMaintenance.DTO.UserDTO.eColumns.USER_ACCOUNT.ToString()); return(lookupData); }
public object CreateLookupRowData(int lid, [FromBody] List <LookupData> model) { object result = null; //string message = ""; if (model == null) { return(BadRequest()); } using (_context) { using (var _ctxTransaction = _context.Database.BeginTransaction()) { try { int incrowid = 1; LookupData LastRowForLookup = _context.LookupData.Where(x => x.LookupId == lid).LastOrDefault(); if (LastRowForLookup != null) { incrowid = LastRowForLookup.RowId + 1; } foreach (LookupData ldata in model) { ldata.RowId = incrowid; _context.LookupData.Add(ldata); _context.SaveChanges(); } _ctxTransaction.Commit(); result = new { error = "0", msg = "Success" }; } catch (Exception e) { _ctxTransaction.Rollback(); e.ToString(); //message = "Saved Error"; result = new { error = "1", msg = "Error" }; } } } return(result); }
private void ProcessLookupLine(string line) { try { List <string> list = new List <string>(); foreach (Match match in csvSplit.Matches(line)) { list.Add(match.Value.TrimStart(',').Replace("\"", "")); } LookupData.Add(new LookupData(list.ToArray())); } catch (Exception) { } }
private void InitialSpread() { shtView.ActiveSkin = Common.ACTIVE_SKIN; LookupDataBIZ biz = new LookupDataBIZ(); LookupData shiftLookupData = biz.LoadLookupClassType(DataDefine.SHIFT_CLS.ToNZString()); shtView.Columns[(int)eColumns.SHIFT_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(shiftLookupData); LookupData workresultLookupData = biz.LoadLookupClassType(DataDefine.TRAN_SUB_CLS.ToNZString()); shtView.Columns[(int)eColumns.TRAN_SUB_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(workresultLookupData); shtView.Columns[(int)eColumns.TRANS_DATE].CellType = CtrlUtil.CreateDateTimeCellType(); }
public IHttpActionResult DeleteLookupData(long id) { LookupData lookupData = db.LookupDatas.Find(id); if (lookupData == null) { return(NotFound()); } db.LookupDatas.Remove(lookupData); db.SaveChanges(); return(Ok(lookupData)); }
private void LookupData() { // Lookup Lang LangBIZ bizLang = new LangBIZ(); LookupData lookupLangData = bizLang.LoadLookup(true); cboDefaultLang.LoadLookupData(lookupLangData); // Lookup Date Format ClassListBIZ bizClassDTL = new ClassListBIZ(); LookupData lookupDateFormat = bizClassDTL.LoadLookupClassType(DataDefine.DATE_FORMAT.ToNZString()); cboDefaultDateFormat.LoadLookupData(lookupDateFormat); }
public void Initialize(IList <IMemcacheNode> nodes) { _nodes = nodes; foreach (var node in nodes) { node.NodeDead += _ => Reinitialize(); node.NodeAlive += _ => Reinitialize(); } using (var hash = Hash) _lookupData = new LookupData(nodes, hash.Value); UpdateState(null); }
public ActionResult OnPageLoad() { EmpModelList mainObj = new EmpModelList(); BLLClass bllObj = new BLLClass(); mainObj.DesnList = new List <LookupData>(); mainObj.DeptList = new List <LookupData>(); mainObj.SupervisorList = new List <Employee>(); DtoList list = new DtoList(); list.DesnList = new List <LookupDTO>(); list.DeptList = new List <LookupDTO>(); list.SupervisorList = new List <DTOClass>(); list = bllObj.GetDtoData(); foreach (var data in list.DesnList) { LookupData desgObj = new LookupData() { Id = data.Id, Name = data.Name }; mainObj.DesnList.Add(desgObj); } foreach (var data in list.DeptList) { LookupData deptObj = new LookupData() { Id = data.Id, Name = data.Name }; mainObj.DeptList.Add(deptObj); } foreach (var data in list.SupervisorList) { Employee superObj = new Employee() { Id = data.Id, Supervisor = data.Supervisor }; mainObj.SupervisorList.Add(superObj); } return(View(mainObj)); }
private void InitializeLookupData() { LookupDataBIZ lookupDataBiz = new LookupDataBIZ(); LookupData adjustmentType = lookupDataBiz.LoadLookupClassType(DataDefine.IN_OUT_CLASS.ToNZString()); shtView.Columns[(int)eColView.IN_OUT_CLS].CellType = new ReadOnlyPairCellType(adjustmentType, Common.COMBOBOX_SEPERATOR_SYMBOL); LookupData reasonCode = lookupDataBiz.LoadLookupClassType(DataDefine.ADJ_SUBTYPE.ToNZString()); shtView.Columns[(int)eColView.TRAN_SUB_CLS].CellType = new ReadOnlyPairCellType(reasonCode, Common.COMBOBOX_SEPERATOR_SYMBOL); LookupData stockLocation = lookupDataBiz.LoadLookupLocation(); shtView.Columns[(int)eColView.LOC_CD].CellType = new ReadOnlyPairCellType(stockLocation, Common.COMBOBOX_SEPERATOR_SYMBOL); }
/// <summary> /// Load All Location /// </summary> /// <param name="dtoAddedLocation">Dummy Location to Added and Set to first Row</param> /// <returns></returns> public LookupData LoadLookupLocation_AddDummy(DealingDTO dtoAddedLocation) { DealingDAO dao = new DealingDAO(CommonLib.Common.CurrentDatabase); List <DealingDTO> dtoLocations = dao.LoadAll(null, true); //add Dummy Location and Set to first Row dtoLocations.Insert(0, dtoAddedLocation); DataTable dt = DTOUtility.ConvertListToDataTable(dtoLocations); LookupData lookupData = new LookupData(dt, DealingDTO.eColumns.LOC_DESC.ToString(), DealingDTO.eColumns.LOC_CD.ToString()); return(lookupData); }
/// <summary> /// Load lookup for lot number by item and location code /// If these lot no has no onhand qty will be supressed. /// </summary> /// <param name="ItemCD"></param> /// <param name="LocationCD"></param> /// <returns></returns> public LookupData LoadLookupLotNo(NZString ItemCD, NZString LocationCD, NZString YearMonth) { InventoryOnhandDAO dao = new InventoryOnhandDAO(CommonLib.Common.CurrentDatabase); InventoryPeriodBIZ inventoryPeriodBIZ = new InventoryPeriodBIZ(); InventoryPeriodDTO inventoryPeriodDTO = inventoryPeriodBIZ.LoadCurrentPeriod(); List <InventoryOnhandDTO> listOnhand = dao.LoadLotNoWithHasOnhandQty(null, YearMonth, inventoryPeriodDTO.YEAR_MONTH, ItemCD, LocationCD); DataTable dt = DTOUtility.ConvertListToDataTable(listOnhand); LookupData lookupData = new LookupData(dt, InventoryOnhandDTO.eColumns.LOT_NO.ToString(), InventoryOnhandDTO.eColumns.LOT_NO.ToString()); return(lookupData); }
public LookupData GetAllookupID() { string sSQL = @"select distinct lookupid as K from app_lookup where flagdelete=0 order by lookupid"; LookupData result = new LookupData() { LookupID = "AllLookupID" }; var _Items = DataProvider.LoadData <LookupDataItem>(sSQL); result.Items.AddRange(_Items); return(result); }
private void InitialComboBox() { LookupDataBIZ bizLookup = new LookupDataBIZ(); // Lookup Lot Control LookupData lookupTransType = bizLookup.LoadLookupClassType(new NZString(null, "TRANS_TYPE")); //ReadOnlyPairCellType TransTypecellType = new ReadOnlyPairCellType(lookupTransType, CommonLib.Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.SHIP_TYPE].CellType = TransTypecellType; //// Lookup OrderLoc //LookupData lookupStoreLoc = bizLookup.LoadLookupLocation(); //ReadOnlyPairCellType StoreLoc = new ReadOnlyPairCellType(lookupStoreLoc, CommonLib.Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.STORED_LOC].CellType = StoreLoc; }
private void InitialSpread() { shtView.ActiveSkin = Common.ACTIVE_SKIN; CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColView)); LookupDataBIZ biz = new LookupDataBIZ(); LookupData lookupItemClass = biz.LoadLookupClassType(DataDefine.ITEM_CLS.ToNZString()); LookupData lookupLotControlClass = biz.LoadLookupClassType(DataDefine.LOT_CONTROL_CLS.ToNZString()); LookupData lookupConsumptionClass = biz.LoadLookupClassType(DataDefine.CONSUMPTION_CLS.ToNZString()); shtView.Columns[(int)eColView.ITEM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(lookupItemClass); shtView.Columns[(int)eColView.LOT_CONTROL_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(lookupLotControlClass); shtView.Columns[(int)eColView.CONSUMTION_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(lookupConsumptionClass); }
public LookupData LoadLookupMachine(DataTable dt) { //DealingDAO dao = new DealingDAO(CommonLib.Common.CurrentDatabase); //DataTable dt = dao.LoadByLocationType(null, LocationType, null, false); DataTable dtSource = new DataTable(); foreach (DataColumn dc in dt.Columns) { DataColumn dcSource = new DataColumn(dc.ColumnName); dtSource.Columns.Add(dcSource); } //DataColumn dc0 = new DataColumn(ItemViewProcessDTO.eColumns.PROCESS_NAME.ToString()); //DataColumn dc1 = new DataColumn(ItemViewProcessDTO.eColumns.PROCESS_CD.ToString()); //dtSource.Columns.Add(dc0); //dtSource.Columns.Add(dc1); Hashtable hash = new Hashtable(); foreach (DataRow dr in dt.Rows) { if (dr.RowState != DataRowState.Deleted && (dr[(int)ItemViewProcessDTO.eColumns.PROCESS_CD] != (object)DBNull.Value || dr[(int)ItemViewProcessDTO.eColumns.PROCESS_NAME] != (object)DBNull.Value) ) { string ProcessCD = dr[(int)ItemViewProcessDTO.eColumns.PROCESS_CD].ToString(); string ProcessName = dr[(int)ItemViewProcessDTO.eColumns.PROCESS_NAME].ToString(); if (hash.ContainsKey(ProcessCD)) { continue; } DataRow drSource = dtSource.NewRow(); drSource[ItemViewProcessDTO.eColumns.PROCESS_NAME.ToString()] = ProcessName; drSource[ItemViewProcessDTO.eColumns.PROCESS_CD.ToString()] = ProcessCD; dtSource.Rows.Add(drSource); hash.Add(ProcessCD, ProcessCD); } } LookupData lookupData = new LookupData(dtSource, ItemViewProcessDTO.eColumns.PROCESS_NAME.ToString(), ItemViewProcessDTO.eColumns.PROCESS_CD.ToString()); return(lookupData); }
private void ProcessMCOLine(string line) { try { List <string> list = new List <string>(); foreach (Match match in csvSplit.Matches(line)) { list.Add(match.Value.TrimStart(',').Replace("\"", "")); } MCOData mco = new MCOData(list.ToArray()); mco.Ticket = LookupData.First(p => p.NoFiche == mco.NoFiche); mco.Traitement = SuiviData.FirstOrDefault(p => p.NoFiche == mco.NoFiche) ?? new SuiviData(); MCOData.Add(mco); } catch (Exception) { } }
private void InitialComboBox() { LookupDataBIZ bizLookup = new LookupDataBIZ(); //LookupData lookupOPERATION_TYPE = bizLookup.LoadLookupClassType(new NZString(null, DataDefine.OPERATION_TYPE)); //ReadOnlyPairCellType OPERATION_TYPE = new ReadOnlyPairCellType(lookupOPERATION_TYPE, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.OPERATION_TYPE].CellType = OPERATION_TYPE; //LookupData lookupTRANS_CLS = bizLookup.LoadLookupClassType(new NZString(null, DataDefine.TRANS_TYPE)); //ReadOnlyPairCellType TRANS_CLS = new ReadOnlyPairCellType(lookupTRANS_CLS, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.TRANS_CLS].CellType = TRANS_CLS; //LookupData lookupIN_OUT_CLS = bizLookup.LoadLookupClassType(new NZString(null, DataDefine.IN_OUT_CLASS)); //ReadOnlyPairCellType IN_OUT_CLS = new ReadOnlyPairCellType(lookupIN_OUT_CLS, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.IN_OUT_CLS].CellType = IN_OUT_CLS; //// Lookup StoreLoc //LookupData lookupStoreLoc = bizLookup.LoadLookupLocation(); //ReadOnlyPairCellType StoreLoc = new ReadOnlyPairCellType(lookupStoreLoc, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.LOC_CD].CellType = StoreLoc; //// Lookup CustomerLoc //LookupData lookupCustomerLoc = bizLookup.LoadLookupLocation(); //ReadOnlyPairCellType CustomerLoc = new ReadOnlyPairCellType(lookupCustomerLoc, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.FOR_CUSTOMER].CellType = CustomerLoc; //// Lookup SubType //LookupData lookupSubType = bizLookup.LoadLookupClassType(DataDefine.ISSUE_SUBTYPE.ToNZString()); //ReadOnlyPairCellType SubType = new ReadOnlyPairCellType(lookupSubType, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.TRAN_SUB_CLS].CellType = SubType; //LookupData lookupSHIFT_CLS = bizLookup.LoadLookupClassType(DataDefine.SHIFT_CLS.ToNZString()); //ReadOnlyPairCellType SHIFT_CLS = new ReadOnlyPairCellType(lookupSHIFT_CLS, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.SHIFT_CLS].CellType = SHIFT_CLS; //LookupData lookupSCREEN_TYPE = bizLookup.LoadLookupClassType(DataDefine.SCREEN_TYPE.ToNZString()); //ReadOnlyPairCellType SCREEN_TYPE = new ReadOnlyPairCellType(lookupSCREEN_TYPE, Common.COMBOBOX_SEPERATOR_SYMBOL); //shtView.Columns[(int)eColView.SCREEN_TYPE].CellType = SCREEN_TYPE; LookupData lookupLogTable = bizLookup.LoadLookupLogTable(); cboDataType.LoadLookupData(lookupLogTable); }
private void InitializeSpread() { shtReturnProductList.ActiveSkin = Common.ACTIVE_SKIN; //LookupDataBIZ biz = new LookupDataBIZ(); //NZString[] classInfos = { // (NZString) DataDefine.Convert2ClassCode(DataDefine.eTRANS_TYPE.Receiving), // (NZString) DataDefine.Convert2ClassCode(DataDefine.eTRANS_TYPE.Receive_Return) // }; //LookupData receiveTypeLookupData = biz.LoadLookupClassType(DataDefine.TRANS_TYPE.ToNZString(), classInfos); //shtView.Columns[(int)eColView.TRANS_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(receiveTypeLookupData); //LookupData locationLookupData = biz.LoadLookupLocation(); //shtView.Columns[(int)eColView.LOC_CD].CellType = CtrlUtil.CreateReadOnlyPairCellType(locationLookupData); //shtView.Columns[(int)eColView.DEALING_NO].CellType = CtrlUtil.CreateReadOnlyPairCellType(locationLookupData); //LookupData umClassLookupData = biz.LoadLookupClassType(DataDefine.UM_CLS.ToNZString()); //shtView.Columns[(int)eColView.ORDER_UM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(umClassLookupData); //shtView.Columns[(int)eColView.INV_UM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(umClassLookupData); //LookupData refTypeLookupData = biz.LoadLookupClassType(DataDefine.REF_SLIP_CLS.ToNZString()); //shtView.Columns[(int)eColView.REF_SLIP_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(refTypeLookupData); //shtView.Columns[(int)eColView.TRANS_DATE].CellType = CtrlUtil.CreateDateTimeCellType(); shtReturnProductList.Columns[(int)eColView.SLIP_NO].StyleName = DataDefine.NO_EXPORT.ToString(); shtReturnProductList.Columns[(int)eColView.RETURN_TRANS_ID].StyleName = DataDefine.EXPORT_LAST.ToString(); shtReturnProductList.Columns[(int)eColView.TRANS_ID].StyleName = DataDefine.EXPORT_LAST.ToString(); shtReturnProductList.Columns[(int)eColView.DELIVERY_TRANS_ID].StyleName = DataDefine.EXPORT_LAST.ToString(); shtReturnProductList.Columns[(int)eColView.SLIP_NO].Visible = false; shtReturnProductList.Columns[(int)eColView.RETURN_TRANS_ID].Visible = false; shtReturnProductList.Columns[(int)eColView.TRANS_ID].Visible = false; shtReturnProductList.Columns[(int)eColView.DELIVERY_TRANS_ID].Visible = false; shtReturnProductList.Columns[(int)eColView.LOC_DESC].Visible = false; CtrlUtil.MappingDataFieldWithEnum(shtReturnProductList, typeof(eColView)); LookupDataBIZ m_bizLookupData = new LookupDataBIZ(); LookupData locData = m_bizLookupData.LoadLookupLocation(); shtReturnProductList.Columns[(int)eColView.DEALING_NO].CellType = CtrlUtil.CreateReadOnlyPairCellType(locData); }
private void InitializeLookupData() { LookupDataBIZ biz = new LookupDataBIZ(); LookupData locationLookup = biz.LoadLookupLocation(); NZString[] SupplierType = new NZString[] { (NZString)DataDefine.Convert2ClassCode(DataDefine.eLOCATION_CLS.CustomerVendor), (NZString)DataDefine.Convert2ClassCode(DataDefine.eLOCATION_CLS.Vendor) }; LookupData SupplierLookup = biz.LoadLookupLocation(SupplierType); cboStoredLoc.LoadLookupData(locationLookup); cboSupplierCode.LoadLookupData(SupplierLookup); LookupData umClsData = biz.LoadLookupClassType(DataDefine.UM_CLS.ToNZString()); shtView.Columns[(int)eColView.ORDER_UM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(umClsData); shtView.Columns[(int)eColView.INV_UM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(umClsData); }
private void LoadLookups() { this.module.Model.Priorite = LookupData.OrderBy(p => p.Priorite).Select(p => p.Priorite).Distinct().ToList(); this.module.Model.Gravite = LookupData.OrderBy(p => p.Gravite).Select(p => p.Gravite).Distinct().ToList(); this.module.Model.Statut = LookupData.OrderBy(p => p.Statut).Select(p => p.Statut).Distinct().ToList(); this.module.Model.Createur = LookupData.OrderBy(p => p.CreateurDeLaFiche).Select(p => p.CreateurDeLaFiche).Distinct().ToList(); this.module.Model.Diagnostiqueur = LookupData.OrderBy(p => p.Diagnostiqueur).Select(p => p.Diagnostiqueur).Distinct().ToList(); this.module.Model.Correcteur = LookupData.OrderBy(p => p.Correcteur).Select(p => p.Correcteur).Distinct().ToList(); this.module.Model.Site = LookupData.OrderBy(p => p.Site).Select(p => p.Site).Distinct().ToList(); this.module.Model.Responsable = new List <string>() { "", "André MACHADO", "Catherine BARRAULT", "Christophe BODA", "Hugo OLIVEIRA", "João SILVA", "Tomaz SILVA", "Wallace DAMIÃO" }; this.module.Model.BlocsAplicatifsACorriger = AllMCOData.OrderBy(p => p.BlocsAplicatifsACorriger).Select(p => p.BlocsAplicatifsACorriger).Distinct().ToList(); this.module.Model.NatureDeLaMaintenance = AllMCOData.OrderBy(p => p.NatureDeLaMaintenance).Select(p => p.NatureDeLaMaintenance).Distinct().ToList(); this.module.Model.NatureDeLaFiche = AllMCOData.OrderBy(p => p.NatureDeLaFiche).Select(p => p.NatureDeLaFiche).Distinct().ToList(); this.module.Model.Version = AllMCOData.OrderBy(p => p.Version).Select(p => p.Version).Distinct().ToList(); this.module.Model.TypeMaintenance = LookupData.OrderBy(p => p.TypeMaintenance).Select(p => p.TypeMaintenance).Distinct().ToList(); this.module.Model.DirectionResponsable = AllMCOData.OrderBy(p => p.DirectionResponsable).Select(p => p.DirectionResponsable).Distinct().ToList(); this.module.Model.SecteurDeRecette = AllMCOData.OrderBy(p => p.SecteurDeRecette).Select(p => p.SecteurDeRecette).Distinct().ToList(); this.module.Model.DomaineDeDetection = AllMCOData.OrderBy(p => p.DomaineDeDetection).Select(p => p.DomaineDeDetection).Distinct().ToList(); this.module.Model.DomaineCorrection = LookupData.OrderBy(p => p.DomaineCorrection).Select(p => p.DomaineCorrection).Distinct().ToList(); this.module.Model.SecteurCorrection = LookupData.OrderBy(p => p.SecteurCorrection).Select(p => p.SecteurCorrection).Distinct().ToList(); this.module.Model.SousSecteur = AllMCOData.OrderBy(p => p.SousSecteur).Select(p => p.SousSecteur).Distinct().ToList(); this.module.Model.Gamme = AllMCOData.OrderBy(p => p.Gamme).Select(p => p.Gamme).Distinct().ToList(); this.module.Model.Report = new List <string>() { "", "M19B", "M20A", "M20B", "M21A", "M21B", "M22A", "M22B" }; this.module.Model.SelectedResponsable = "João SILVA"; }
private IEnumerable <LookupData> DepartmentLookup(bool includeWildcard = false) { IEntityService <Department> departmentService = new DepartmentService(new UnitOfWorkWrapper()); var departments = new List <LookupData>(); if (includeWildcard) { departments.Add(LookupData.Create("All", Guid.Empty.ToString())); } foreach (var department in _service.FilterActive()) { departments.Add(LookupData.Create(department.Name, department.DepartmentId.ToString())); } return(departments); }
public void GetData_FiltersById() { lookup.Filter.Id = "9I"; lookup.Filter.Search = "Term"; lookup.Filter.AdditionalFilters.Add("Value", "5V"); LookupData actual = lookup.GetData(); Assert.Equal(new DateTime(2014, 12, 19).ToShortDateString(), actual.Rows[0]["Date"]); Assert.Equal("9V", actual.Rows[0][MvcLookup.AcKey]); Assert.Equal("9I", actual.Rows[0][MvcLookup.IdKey]); Assert.Equal("9V", actual.Rows[0]["Value"]); Assert.Equal("19", actual.Rows[0]["Count"]); Assert.Equal(lookup.Columns, actual.Columns); Assert.Equal(1, actual.FilteredRows); Assert.Single(actual.Rows); }
/// <summary> /// Saves the current selection of the combobox into /// a new answer object. /// </summary> public override void RegisterSave() { ArrayList ans; LookupData selectedData = (LookupData)_control.SelectedItem; selectedData.Selected = true; ans = ((LookupAnswer)Answer).AnswerData; if (ans.Count > 0) { ans[0] = selectedData; } else { ans.Add(selectedData); } }
private void cboItemType_SelectedIndexChanged(object sender, EventArgs e) { if (cboItemType.SelectedValue != null && cboItemType.SelectedValue != DBNull.Value) { if (cboItemType.SelectedValue.ToString() == Rubik.DataDefine.Convert2ClassCode(Rubik.DataDefine.eITEM_CLS.RawMaterial)) { CtrlUtil.EnabledControl(true, cboItemClassMinor04); LookupDataBIZ biz = new LookupDataBIZ(); LookupData data = biz.LoadLookupClassType((NZString)Rubik.DataDefine.ITEM_CLS_MINOR04); cboItemClassMinor04.LoadLookupData(data); cboItemClassMinor04.SelectedIndex = -1; return; } } cboItemClassMinor04.DataSource = null; CtrlUtil.EnabledControl(false, cboItemClassMinor04); }
void IMemcachedNodeLocator.Initialize(IList<IMemcachedNode> nodes) { // quit if we've been initialized because we can handle dead nodes, // so there is no need to recalculate everything if (this.lookupData != null) return; // sizeof(uint) const int KeyLength = 4; var hashAlgo = this.factory(); int PartCount = hashAlgo.HashSize / 8 / KeyLength; // HashSize is in bits, uint is 4 bytes long if (PartCount < 1) throw new ArgumentOutOfRangeException("The hash algorithm must provide at least 32 bits long hashes"); var keys = new List<uint>(nodes.Count * KetamaNodeLocator.ServerAddressMutations); var keyToServer = new Dictionary<uint, IMemcachedNode>(keys.Count, new UIntEqualityComparer()); for (int nodeIndex = 0; nodeIndex < nodes.Count; nodeIndex++) { var currentNode = nodes[nodeIndex]; // every server is registered numberOfKeys times // using UInt32s generated from the different parts of the hash // i.e. hash is 64 bit: // 01 02 03 04 05 06 07 // server will be stored with keys 0x07060504 & 0x03020100 string address = currentNode.EndPoint.ToString(); for (int mutation = 0; mutation < ServerAddressMutations / PartCount; mutation++) { byte[] data = hashAlgo.ComputeHash(Encoding.ASCII.GetBytes(address + "-" + mutation)); for (int p = 0; p < PartCount; p++) { var tmp = p * 4; var key = ((uint)data[tmp + 3] << 24) | ((uint)data[tmp + 2] << 16) | ((uint)data[tmp + 1] << 8) | ((uint)data[tmp]); keys.Add(key); keyToServer[key] = currentNode; } } } keys.Sort(); var lookupData = new LookupData { keys = keys.ToArray(), KeyToServer = keyToServer, Servers = nodes.ToArray() }; Interlocked.Exchange(ref this.lookupData, lookupData); }
private static IMemcachedNode LocateNode(LookupData ld, uint itemKeyHash) { // get the index of the server assigned to this hash int foundIndex = Array.BinarySearch<uint>(ld.keys, itemKeyHash); // no exact match if (foundIndex < 0) { // this is the nearest server in the list foundIndex = ~foundIndex; if (foundIndex == 0) { // it's smaller than everything, so use the last server (with the highest key) foundIndex = ld.keys.Length - 1; } else if (foundIndex >= ld.keys.Length) { // the key was larger than all server keys, so return the first server foundIndex = 0; } } if (foundIndex < 0 || foundIndex > ld.keys.Length) return null; return ld.KeyToServer[ld.keys[foundIndex]]; }
void SetLookupData(String name, LookupData data, DextopSessionVariableSharing sharing) { SetVariable(GetLookupDataKey(name), data, sharing); }
bool TryGetLookupData(String name, out LookupData data) { data = GetLookupData(name); return data != null; }
internal List<ClientLookupData> PrepareLookupData(params String[] names) { var res = new List<ClientLookupData>(); LookupData d; foreach (var name in names) { var clientVersion = GetLookupDataClientVersion(name); if (!TryGetLookupData(name, out d) || d.ServerVersion != clientVersion) { if (d == null) { int version = DextopApplication.GetNextSharedLookupVersionNumber(); DextopSessionVariableSharing sharing; var data = BuildLookupData(name, out sharing); d = new LookupData { Data = data, ServerVersion = version }; SetLookupData(name, d, sharing); } res.Add(new ClientLookupData { name = name, data = d.Data, version = d.ServerVersion }); } else res.Add(new ClientLookupData { name = name, version = d.ServerVersion }); } return res; }