Example #1
0
        //[ResponseType(typeof(ReaderInfo))]
        public HttpResponseMessage Order()
        {
            string    JSONRequest = Request.Content.ReadAsStringAsync().Result;
            MakeOrder request;

            try
            {
                request = JsonConvert.DeserializeObject <MakeOrder>(JSONRequest, ALISSettings.ALISDateFormatJSONSettings);
            }
            catch
            {
                return(ALISErrorFactory.CreateError("G001", Request));
            }

            CirculationInfo Circulation = new CirculationInfo();


            try
            {
                Circulation.MakeOrder(request);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(Request));
        }
Example #2
0
        private void bCirculationMakeOrder_Click(object sender, EventArgs e)
        {
            CirculationInfo ci = new CirculationInfo();
            MakeOrder       mo = new MakeOrder();

            mo.BookId      = "BJACC_4381";
            mo.ReaderId    = 15;
            mo.OrderTypeId = 1;
            ci.MakeOrder(mo);


            //CirculationInfo ci = new CirculationInfo();
            //MakeOrder mo = new MakeOrder();
            ////mo.BookId = "BJVVV_1007658";
            ////mo.ReaderId = 100000;
            ////mo.OrderType = "Электронная выдача";
            ////ci.MakeOrder(mo);

            ////mo.BookId = "BJVVV_1310093";
            ////mo.ReaderId = 100000;
            ////mo.OrderType = "На дом";
            ////ci.MakeOrder(mo);

            //mo.BookId = "BJVVV_193768";
            //mo.ReaderId = 10000;
            //mo.OrderTypeId = 2;
            ////ci.MakeOrder(mo);

            //string jsonData = JsonConvert.SerializeObject(mo, ALISDateFormatJSONSettings);

            //using (HttpClient client = new HttpClient())
            //{
            //    var response = client.PostAsync(ALIS_ADDRESS + "Circulation/Order", new StringContent(jsonData, Encoding.UTF8, "application/json"));
            //    tbResponse.Text = response.Result.Content.ReadAsStringAsync().Result + " " + response.Result.StatusCode; ;
            //}
        }