public dynamic SetLogOnOff(int appId, string appName, int debug = 1, int info = 1, int warn = 1, int error = 1) { LogOnOff on_off = new LogOnOff(); on_off.AppId = appId; on_off.Debug = (byte)debug; on_off.Info = (byte)info; on_off.Warn = (byte)warn; on_off.Error = (byte)error; on_off.AppName = appName; LogOnOffManager.SetLogOnOff(on_off); return(0); }
public void SetLogOnOff(LogOnOff on_off) { var collection = MongoDataBase.GetCollection <LogOnOff>(); var old_on_off = collection.Find(a => a.AppId == on_off.AppId).Limit(1).FirstOrDefaultAsync().Result; if (old_on_off == null) { collection.InsertOneAsync(on_off); } else { on_off._id = old_on_off._id; collection.ReplaceOneAsync(a => a.AppId == on_off.AppId, on_off); } }
public void ProcessRequest(HttpContext context) { int appId = Convert.ToInt32(context.Request["appId"]); string appName = context.Request["appName"]; int debug = Convert.ToInt32(context.Request["debug"]); int info = Convert.ToInt32(context.Request["info"]); int warn = Convert.ToInt32(context.Request["warn"]); int error = Convert.ToInt32(context.Request["error"]); LogOnOff on_off = new LogOnOff(); on_off.AppId = appId; on_off.Debug = (byte)debug; on_off.Info = (byte)info; on_off.Warn = (byte)warn; on_off.Error = (byte)error; on_off.AppName = appName; LogOnOffManager.SetLogOnOff(on_off); context.Response.ContentType = "text/plain"; context.Response.Write("Hello World"); }
public void SetLogOnOff(LogOnOff on_off) { throw new NotImplementedException(); }