public HttpResponseMessage InsertBook(ReqInsertBooks books) { var proc = new ProcData(); RspBook result = proc.InsertBooks(books.data); var response = Request.CreateResponse(HttpStatusCode.OK, result); if (result.code == "1") { response = Request.CreateResponse(HttpStatusCode.Forbidden, result); } return(response); }
public HttpResponseMessage DelBook(string id) { var proc = new ProcData(); RspBook result = proc.DelBook(id); var response = Request.CreateResponse(HttpStatusCode.OK, result); if (result.code == "1") { response = Request.CreateResponse(HttpStatusCode.Forbidden, result); } return(response); }
private static MqErrorE ProcCall(IntPtr context, IntPtr data) { ProcData dataC = (ProcData)GCHandle.FromIntPtr(data).Target; // call the function try { if (dataC.callC != null) { dataC.callC(); } else { dataC.callI.Call(GetSelf(context)); } } catch (Exception ex) { return(MqErrorSet2(context, ex)); } // everything is OK return(MqErrorE.MQ_OK); }
public override async Task <bool> Execute(ObservableCollection <IGambitCondition> conditions) { if (SpellData == null) { return(false); } if (!Core.Me.HasTarget) { return(false); } var target = Core.Me.CurrentTarget; if (target == null) { return(false); } if (conditions.All(condition => condition.Check(target))) { if (!await ProcData.Cast(target)) { return(false); } Casting.CastingGambit = true; return(true); } if (!await SpellData.Cast(target)) { return(false); } Casting.CastingGambit = true; return(true); }
private bool processStart(ProcData ProcesToStart) { string errorMessage = ""; string outputMessage = ""; if (checkAppOpened(ProcesToStart.szappname) > 0) { TraceService("Process Start, Set infofilename = " + ProcesToStart.szappname + " Is Ready"); return(true); } try { using (Process myProcess = new Process()) { TraceService("Process Start, Set infofilename = " + ProcesToStart.szapppath); myProcess.StartInfo.FileName = ProcesToStart.szapppath; FileInfo FI = new FileInfo(ProcesToStart.szapppath); myProcess.StartInfo.WorkingDirectory = FI.Directory.ToString(); //if (ProcesToStart.szappname.Contains("_CON")) //{ // myProcess.StartInfo.RedirectStandardError = false; // myProcess.StartInfo.RedirectStandardOutput = false; // myProcess.StartInfo.UseShellExecute = true; //} //else //{ // myProcess.StartInfo.RedirectStandardError = true; // myProcess.StartInfo.RedirectStandardOutput = true; // myProcess.StartInfo.UseShellExecute = false; //} myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal; myProcess.StartInfo.Arguments = ProcesToStart.szargument; //myProcess.StartInfo.UserName = Properties.Settings.Default.User; //myProcess.StartInfo.Password. = Properties.Settings.Default.User_Password as System.Security.SecureString; counter = 0; myProcess.Start(); //errorMessage = myProcess.StandardError.ReadToEnd(); //myProcess.WaitForExit(); //outputMessage = myProcess.StandardOutput.ReadToEnd(); //myProcess.WaitForExit(); myProcess.Close(); TraceService("Process " + ProcesToStart.szappname + " Started by KeepAlive"); } } catch (InvalidOperationException inEx) { TraceService("Process Start InvalidOperationException : " + inEx.Message); return(false); } catch (Win32Exception winEx) { TraceService("Process Start Win32Exception : " + winEx.Message); return(false); } catch (Exception ex) { TraceService("Process Start Exception : " + ex.Message); return(false); } finally { //TraceService("Process Start, StandardError : " + errorMessage); //TraceService("Process Start, StandardOutput : " + outputMessage); } return(true); }//4212 edited