// GET api/<controller>/5 public IHttpActionResult Get(string enumType) { IRequestContext rc = new RequestContext("gdeleon", "!password!", 92749, "solismammotest", null, "", ""); GlobalContext.Add(rc); IAccountService accSer = ServiceFactory <IAccountService> .CreateNew(); var hcpcsEnums = accSer.GetAccountEnumsByType(enumType); return(Ok(hcpcsEnums)); }
// POST api/<controller> public void Post([FromBody] AccountEnumDto accountEnumDto) { IRequestContext rc = new RequestContext("gdeleon", "!password!", 92749, "solismammotest", null, "", ""); GlobalContext.Add(rc); IAccountService accSer = ServiceFactory <IAccountService> .CreateNew(); AccountEnumsDto accEnums = new AccountEnumsDto() { AccountEnums = new List <AccountEnumDto>() }; accEnums.AccountEnums.Add(accountEnumDto); accSer.InsertUpdateAccountEnum(accEnums); }
public void Configuration(IAppBuilder app) { String cs = @"Server=172.31.25.70;uid=sa;pwd=stagingsa;Trusted_Connection=False;Application Name=MachinesLocalDebuggingApplication;"; //Set initial configuration for application. //Set all the application settings here. IApplicationSetting appSet = new ApplicationSetting(100, 4, cs, cs); GlobalContext.Add(appSet); var httpConfiguration = new HttpConfiguration(); // Configure Web API Routes: // - Enable Attribute Mapping // - Enable Default routes at /api. httpConfiguration.MapHttpAttributeRoutes(); httpConfiguration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); //#if DEBUG //Allow cros just for debug mode. app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); //#endif app.UseWebApi(httpConfiguration); //app. // Make ./public the default root of the static files in our Web Application. app.UseFileServer(new FileServerOptions { RequestPath = new PathString(string.Empty), FileSystem = new PhysicalFileSystem("./public"), EnableDirectoryBrowsing = true, }); app.UseStageMarker(PipelineStage.MapHandler); }
static void Main(string[] args) { IRequestContext rc = new RequestContext("gdeleon", "!password!", 92749, "solismammotest", null, "", ""); IApplicationSetting appSet = new ApplicationSetting(100, 4, cs); GlobalContext.Add(rc); GlobalContext.Add(appSet); IAccountService accSer = ServiceFactory <IAccountService> .CreateNew(); var hcpcsEnums = accSer.GetAccountEnumsByType("HCPCS"); //ITransactionFactory tFactory = new TransactionFactory(cs); ////Need to have request context to call this method //using (ITransactionManager manager = tFactory.CreateManager()) //{ // var res = manager.ExecuteReadOnlyCommand<IAccountRepository>(Handler); // //var accounts = res.FindAllAccounts(); //} }