Beispiel #1
0
        public void SubmitOrderRegister()
        {
            //get Authorization header
            HttpContext httpContext = HttpContext.Current;
            string      authHeader  = httpContext.Request.Headers["Authorization"];

            //uploaded file
            var File = httpContext.Request.Files[0];

            //list
            string   List = httpContext.Request.Form.GetValues("List").First();
            Response auth = Controller.ControllerCheckIn.CheckLogIn_forProcess(authHeader);

            if (auth.Message != "")
            {
                Context.Response.Clear();
                Context.Response.ContentType = "application/json";
                Context.Response.Flush();
                Context.Response.Write(JsonConvert.SerializeObject(auth));
                Context.Response.End();
            }
            else
            {
                Controller.ControllerPurchaseOrder purchaseOrder = new Controller.ControllerPurchaseOrder(authHeader);
                MetaResponse response = purchaseOrder.SubmitOrderRegister(List, File);
                Context.Response.Clear();
                Context.Response.ContentType = "application/json";
                Context.Response.Flush();
                Context.Response.Write(JsonConvert.SerializeObject(response));
                Context.Response.End();
            }
        }
Beispiel #2
0
        public void Search(string COMPANY_NO_BOX, string REQ_SEQ)
        {
            //get Authorization header
            HttpContext httpContext = HttpContext.Current;
            string      authHeader  = httpContext.Request.Headers["Authorization"];

            Response auth = Controller.ControllerCheckIn.CheckLogIn_forProcess(authHeader);

            if (auth.Message != "")
            {
                Context.Response.Clear();
                Context.Response.ContentType = "application/json";
                Context.Response.Flush();
                Context.Response.Write(JsonConvert.SerializeObject(auth));
                Context.Response.End();
            }
            else
            {
                Controller.ControllerPurchaseOrder purchaseOrder = new Controller.ControllerPurchaseOrder();
                MetaResponse response = purchaseOrder.getInitialData(COMPANY_NO_BOX, REQ_SEQ);
                Context.Response.Clear();
                Context.Response.ContentType = "application/json";
                Context.Response.Flush();
                Context.Response.Write(JsonConvert.SerializeObject(response));
                Context.Response.End();
            }
        }