public void Add(string mastername, string stencilname) { var item = new MasterRef(mastername, stencilname); string key = getkey(mastername, stencilname); this._master_ref_dic[key] = item; }
public void Decode(String Id, String TKMsgIn, out uint TKResult, out String TKMsgOut) { lock (Lock) { //Cancel any pending operations tk.Cancel(); TKResult = (uint)TicketingKernel.Result.GENERAL_ERROR; TKMsgOut = ""; if (JobId != Id) { return; } Console.Write(string.Format("########## TKCommand IN:\n{0}\n", TKMsgIn)); bool ok = tk.Command(TKMsgIn, out TKMsgOut, TKCallback); Console.Write(string.Format("########## TKCommand OUT: {0}\n{1}\n", (ok ? "OK" : "ERROR!"), TKMsgOut)); if (ok) { TKResult = (uint)TicketingKernel.Result.OK; } if (MasterRef != null) { MasterRef.JobFinished(Id); } Working = false; } }
private DbSet GetMasterRefDBSet(MasterRef mref) { DbSet returnvalue = null; switch (mref) { case MasterRef.config_type_ref: { returnvalue = db.Config_Types; break; } case MasterRef.scope_ref: { returnvalue = db.Scopes; break; } case MasterRef.status_ref: { returnvalue = db.Statuses; break; } } return(returnvalue); }
private object GetMasterRef_TableObject(MasterRef mref) { object returnvalue = null; switch (mref) { case MasterRef.config_type_ref: { returnvalue = new config_type_ref(); break; } case MasterRef.scope_ref: { returnvalue = new scope_ref(); break; } case MasterRef.status_ref: { returnvalue = new status_ref(); break; } } return(returnvalue); }
public Array GetMasterRef(MasterRef mref) { //DbSet dbset = GetMasterRefDBSet(mref); var entryPoint = (from data in db.Config_Types select data).ToList(); return(entryPoint.ToArray()); }
public void RunCommand( String Id, String TKMsgIn, out uint TKStatus, out uint TKResult, out String TKMsgOut, out IList <CTSWriteOperation> CardOperations, Card Card = null, ExAPDU RdrCallback = null) { lock (Lock) { //Cancel any pending operations tk.Cancel(); bool ok = false; Operations = CardOperations = new List <CTSWriteOperation>(); TKMsgOut = ""; TKResult = (uint)TicketingKernel.Result.GENERAL_ERROR; TKStatus = (uint)TicketingKernel.Status.DETECTION; if (JobId != Id || (Card == null && RdrCallback == null)) { return; } //Call TK Working = true; if (Card != null) { this.ActualCard = new RemoteCardData(Card); } this.RdrCallback = RdrCallback; Console.Write(string.Format("########## TKCommand IN:\n{0}\n", TKMsgIn)); ok = tk.Command(TKMsgIn, out TKMsgOut, TKCallback); Console.Write(string.Format("########## TKCommand OUT: {0}\n{1}\n", (ok ? "OK" : "ERROR!"), TKMsgOut)); if (!ok) { return; } tk.Activity(); TKMsgOut = this.TKMsgOut; TKResult = this.TKResult; TKStatus = this.TKStatus; if (this.TKResult != (uint)TicketingKernel.Result.OK) { CardOperations.Clear(); } this.RdrCallback = null; this.ActualCard = null; if (MasterRef != null) { MasterRef.JobFinished(Id); } Working = false; } }
private void WasJobDone(String Id) { lock (Lock) { if (JobId == Id && Working != true) { if (MasterRef != null) { MasterRef.JobFinished(Id); } JobId = null; Working = false; } } }
public object GetMasterRefUI(MasterRef mref) { object table = GetMasterRef_TableObject(mref); Type tabletype = table.GetType(); IList <PropertyInfo> props = new List <PropertyInfo>(tabletype.GetProperties()); // PropertyInfo[] properties = tabletype.GetProperties(); //foreach (PropertyInfo property in properties) //{ // //property.SetValue(record, value); //} return(table); }
public object GetMasterRef(int id, MasterRef mref) { if (id == 0) { return(GetEmptyMasterRef(mref)); //Used to create empty structure for configuration_ref for ADD-NEW-Record } DbSet item = GetMasterRefDBSet(mref); item.Find(id); if (item == null) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return(item); }
public void Add(string mastername, string stencilname) { var item = new MasterRef(mastername,stencilname); string key = getkey(mastername, stencilname); this.master_ref_dic[key] = item; }
// GET api/ConfigurationAPI/0 private object GetEmptyMasterRef(MasterRef mref) { return(GetMasterRef_TableObject(mref)); }