コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("Thanks!");
            CirculationInfo  ci   = new CirculationInfo();
            List <OrderInfo> list = ci.GetOrders(CirculationStatuses.ForReturnToBookStorage.Value);

            foreach (OrderInfo o in list)
            {
                BJExemplarInfo exemplar = BJExemplarInfo.GetExemplarByIdData(o.ExemplarId, o.Fund);

                if (o.IssueDate == null)
                {
                    List <OrderFlowInfo> ofi = ci.GetOrdersFlowByOrderId(o.OrderId);
                    OrderFlowInfo        f   = ofi.Find(x => x.StatusName.Contains("ыдано"));
                    if (f != null)
                    {
                    }
                }



                if (exemplar.Fields["921$c"].ToString() == "ДП")
                {
                    //ci.ChangeOrderStatusReturn()
                }
            }
        }
コード例 #2
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));
        }
コード例 #3
0
        public HttpResponseMessage DeleteFromBasket()
        {
            CirculationInfo Circulation = new CirculationInfo();
            BasketDelete    request;
            string          JSONRequest = Request.Content.ReadAsStringAsync().Result;

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

            try
            {
                Circulation.DeleteFromBasket(request);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError("G001", Request));
            }
            return(ALISResponseFactory.CreateResponse(Request));
        }
コード例 #4
0
        private void bRefuseSelected_Click(object sender, EventArgs e)
        {
            if (dgwReaders.SelectedRows.Count == 0)
            {
                MessageBox.Show("Не выбрана ни одна строка!");
                return;
            }
            if (dgwReaders.SelectedRows[0].Cells["status"].Value.ToString() != CirculationStatuses.EmployeeLookingForBook.Value)
            {
                MessageBox.Show("Вы не можете дать отказ только на заказ со статусом \"Сотрудник подбирает книгу\"!");
                return;
            }
            Refusal rf = new Refusal(dgwReaders.SelectedRows[0].Cells["orderid"].Value.ToString());

            rf.ShowDialog();
            if (rf.Cause == "")
            {
                return;
            }
            CirculationInfo circulation = new CirculationInfo();

            circulation.RefuseOrder(Convert.ToInt32(dgwReaders.SelectedRows[0].Cells["orderid"].Value), rf.Cause, bjUser);
            //db.RefusualReader(rf.Cause, dgwRHis.SelectedRows[0].Cells["oid"].Value.ToString());
            //FormReadersHisTable();
            //FormReaderHisTable_Interface();
            ShowReaderOrders();
        }
コード例 #5
0
        private void bShowHistory_Click(object sender, EventArgs e)
        {
            dgOrderFlow.Rows.Clear();
            lbOrders.Items.Clear();

            //GetBookInfoByInventoryNumber - это полный шлак а не метод... переписать, чтобы сам искал по всех фондах!
            BJBookInfo book = BJBookInfo.GetBookInfoByInventoryNumber(tbInvNumber.Text, "BJVVV");

            if (book == null)
            {
                book = BJBookInfo.GetBookInfoByInventoryNumber(tbInvNumber.Text, "REDKOSTJ");
            }
            if (book == null)
            {
                book = BJBookInfo.GetBookInfoByInventoryNumber(tbInvNumber.Text, "BJACC");
            }
            if (book == null)
            {
                book = BJBookInfo.GetBookInfoByInventoryNumber(tbInvNumber.Text, "BJFCC");
            }
            if (book == null)
            {
                book = BJBookInfo.GetBookInfoByInventoryNumber(tbInvNumber.Text, "BJSCC");
            }
            if (book == null)
            {
                label3.Text = "Не найдено";
                lbOrders.Items.Clear();
                dgOrderFlow.Rows.Clear();
                MessageBox.Show("Инвентарный номер не найден ни в одной базе!");
                return;
            }

            BJExemplarInfo exemplar = (BJExemplarInfo)book.Exemplars.Find(x => ((BJExemplarInfo)x).Fields["899$p"].ToString() == tbInvNumber.Text);

            if (exemplar == null)
            {
                label3.Text = "Не найдено";
                lbOrders.Items.Clear();
                dgOrderFlow.Rows.Clear();
                MessageBox.Show("Инвентарный номер не найден ни в одной базе!");
                return;
            }
            else
            {
                label3.Text = book.Fields["200$a"].ToString();
                CirculationInfo  ci     = new CirculationInfo();
                List <OrderInfo> orders = ci.GetOrders(exemplar.IdData, exemplar.Fund);
                lbOrders.Items.Clear();
                foreach (OrderInfo order in orders)
                {
                    lbOrders.Items.Add(order.OrderId);
                }
                if (lbOrders.Items.Count != 0)
                {
                    lbOrders.SelectedIndex = 0;
                }
            }
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: infra-hdc/LIBFL
        private void bCirculationGetOrders_Click(object sender, EventArgs e)
        {
            CirculationInfo  ci   = new CirculationInfo();
            List <OrderInfo> list = ci.GetOrders(333);
            string           json = JsonConvert.SerializeObject(list);

            tbResponse.Text = json;
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: infra-hdc/LIBFL
        private void bInsertIntoBasket_Click(object sender, EventArgs e)
        {
            CirculationInfo  circulation = new CirculationInfo();
            ImpersonalBasket basket      = new ImpersonalBasket();

            basket.BookIdArray = new List <string>();
            basket.BookIdArray.AddRange(new string[] { "BJVVV_1299121", "BJVVV_1304618", "REDKOSTJ_31866", "REDKOSTJ_43090" });
            basket.ReaderId = 189245;
            circulation.InsertIntoUserBasket(basket);
        }
コード例 #8
0
        public HttpResponseMessage ProlongOrder(int OrderId)
        {
            CirculationInfo Circulation = new CirculationInfo();

            try
            {
                Circulation.ProlongOrder(OrderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(Request));
        }
コード例 #9
0
ファイル: LitresController.cs プロジェクト: infra-hdc/LIBFL
        public HttpResponseMessage AssignLitresAccount(int ReaderId)
        {
            CirculationInfo Circulation = new CirculationInfo();
            LitresInfo      result;

            try
            {
                result = Circulation.AssignLitresAccount(ReaderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(result, Request));
        }
コード例 #10
0
ファイル: LitresController.cs プロジェクト: infra-hdc/LIBFL
        public HttpResponseMessage LitresAccount([Description("Номер чит билета")] int ReaderId)
        {
            CirculationInfo Circulation = new CirculationInfo();
            LitresInfo      result;

            try
            {
                result = Circulation.GetLitresAccount(ReaderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(result, Request));
        }
コード例 #11
0
        public HttpResponseMessage Orders([Description("Номер чит билета")] int ReaderId)
        {
            CirculationInfo  Circulation = new CirculationInfo();
            List <OrderInfo> result      = new List <OrderInfo>();

            try
            {
                result = Circulation.GetOrders(ReaderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(result, Request));
        }
コード例 #12
0
        public HttpResponseMessage Basket([Description("Номер чит билета")] int ReaderId)
        {
            CirculationInfo   Circulation = new CirculationInfo();
            List <BasketInfo> basket;

            try
            {
                basket = Circulation.GetBasket(ReaderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError("G001", Request));
            }
            return(ALISResponseFactory.CreateResponse(basket, Request));
        }
コード例 #13
0
        public HttpResponseMessage OrdersById(int OrderId)
        {
            CirculationInfo Circulation = new CirculationInfo();
            OrderInfo       result      = new OrderInfo();

            try
            {
                result = Circulation.GetOrder(OrderId);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            return(ALISResponseFactory.CreateResponse(result, Request));
        }
コード例 #14
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            CirculationInfo      ci            = new CirculationInfo();
            OrderInfo            selectedOrder = ci.GetOrder(Convert.ToInt32(lbOrders.SelectedItem));
            List <OrderFlowInfo> flow          = ci.GetOrdersFlowByOrderId(selectedOrder.OrderId);

            KeyValuePair <string, string>[] columns =
            {
                new KeyValuePair <string, string> ("date",     "Дата"),
                new KeyValuePair <string, string> ("status",   "Действие"),
                new KeyValuePair <string, string> ("employee", "Сотрудник"),
                new KeyValuePair <string, string> ("dep",      "Отдел"),
                new KeyValuePair <string, string> ("reader",   "Читатель"),
            };
            dgOrderFlow.Columns.Clear();
            foreach (var c in columns)
            {
                dgOrderFlow.Columns.Add(c.Key, c.Value);
            }

            dgOrderFlow.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            dgOrderFlow.RowTemplate.DefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;

            dgOrderFlow.Columns["date"].DefaultCellStyle.Format = "dd.MM.yyyy HH:mm";
            dgOrderFlow.Columns["status"].Width   = 180;
            dgOrderFlow.Columns["employee"].Width = 100;
            dgOrderFlow.Columns["dep"].Width      = 200;
            dgOrderFlow.Columns["reader"].Width   = 80;

            foreach (OrderFlowInfo fi in flow)
            {
                dgOrderFlow.Rows.Add();
                var row = dgOrderFlow.Rows[dgOrderFlow.Rows.Count - 1];
                row.Cells["date"].Value   = fi.Changed;
                row.Cells["status"].Value = fi.StatusName;
                BJUserInfo user = BJUserInfo.GetUserById(fi.Changer);
                string     emp  = (user == null) ? "неизвестно" : user.FIO;
                row.Cells["employee"].Value = emp;
                row.Cells["dep"].Value      = KeyValueMapping.LocationCodeToName[fi.DepartmentId];
                row.Cells["reader"].Value   = selectedOrder.ReaderId;
            }
        }
コード例 #15
0
ファイル: Form1.cs プロジェクト: infra-hdc/LIBFL
        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; ;
            //}
        }
コード例 #16
0
ファイル: PrintBlankReaders.cs プロジェクト: infra-hdc/LIBFL
        void pd_PrintPage(object sender, PrintPageEventArgs e)
        {
            Rectangle    rectangle;
            StringFormat format;
            Font         printFont = new Font("Arial Unicode MS", 11f, FontStyle.Bold);

            format = new StringFormat(StringFormatFlags.NoClip);
            format.LineAlignment = StringAlignment.Near;
            format.Alignment     = StringAlignment.Near;

            F1.SqlDA.SelectCommand             = new SqlCommand();
            F1.SqlDA.SelectCommand.Connection  = F1.SqlCon;
            F1.SqlDA.SelectCommand.CommandText = "select * from Readers..ReaderRight where IDReaderRight = 3 and IDReader = " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
            DataSet DS = new DataSet();
            int     t  = 0;
            int     cc = F1.SqlDA.Fill(DS, "t");

            if (cc != 0)
            {
                #region читатель-сотрудник
                string str = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                //string inv = DS.Tables["t"].Rows[0][1].ToString();
                string dep       = GetDepartment(DS.Tables["t"].Rows[0]["IDOrganization"].ToString());
                string abonement = GetAbonement(dg.SelectedRows[0].Cells["readerid"].Value.ToString());
                int    CurrentY  = 0;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = "НА ДОМ\n до:";
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                rectangle = new Rectangle(70, CurrentY, 245, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = DateTime.Now.AddDays(30).ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 10f);
                str       = F1.user.SelectedUserStatus.DepName.Substring(F1.user.SelectedUserStatus.DepName.IndexOf("-") + 2);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 13f);
                str       = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                CurrentY += 25;
                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select FamilyName+' ' +substring([Name],1,1)+'. ' + substring(ISNULL(FatherName,' '),1,1)+case when FatherName is null then '' else '.' end " +
                                                     " from  Readers..Main where NumberReader =" + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                DS        = new DataSet();
                t         = F1.SqlDA.Fill(DS, "t");
                printFont = new Font("Arial Unicode MS", 10f);
                str       = "Фамилия: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 10f);
                e.Graphics.DrawString("Сотрудник отдела: " + dep, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Шифр: " + dg.SelectedRows[0].Cells["cipher"].Value.ToString();;
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;
                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                if (dg.SelectedRows[0].Cells["note"].Value.ToString() == string.Empty)
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString();
                }
                else
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString() + "; метка: " + dg.SelectedRows[0].Cells["note"].Value.ToString();
                }
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                /*rectangle = new Rectangle(158, 175, 315, 25);
                 * str = dg.SelectedRows[0].Cells["note"].Value.ToString();
                 * printFont = new Font("Arial Unicode MS", 10f);
                 * e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);*/
                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Автор: " + dg.SelectedRows[0].Cells["author"].Value.ToString();
                printFont = new Font("Arial Unicode MS", 10f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 75);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = "Заглавие: " + dg.SelectedRows[0].Cells["title"].Value.ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                CurrentY += 75;
                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select Plng.PLAIN " +
                                                     "from BJVVV..DATAEXT A  " +
                                                     "left join BJVVV..DATAEXT lng on A.IDMAIN = lng.IDMAIN and lng.MNFIELD = 101 and lng.MSFIELD = '$a' " +
                                                     "left join BJVVV..DATAEXTPLAIN Plng on Plng.IDDATAEXT = lng.ID " +
                                                     "where A.IDMAIN = " + dg.SelectedRows[0].Cells["pin"].Value.ToString();
                DS  = new DataSet();
                t   = F1.SqlDA.Fill(DS, "t");
                str = "Язык: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select (case when Plng.PLAIN is null then '<нет>' else Plng.PLAIN end) as first," +
                                                     " (case when Ptom.PLAIN is null then '<нет>' else Ptom.PLAIN end) as second, Pmesto.PLAIN mesto " +
                                                     "from BJVVV..DATAEXT A  " +
                                                     "left join BJVVV..DATAEXT lng on A.IDMAIN = lng.IDMAIN and lng.MNFIELD = 2100 and lng.MSFIELD = '$d' " +
                                                     "left join BJVVV..DATAEXTPLAIN Plng on Plng.IDDATAEXT = lng.ID " +
                                                     "left join BJVVV..DATAEXT mesto on A.IDMAIN = mesto.IDMAIN and mesto.MNFIELD = 210 and mesto.MSFIELD = '$a' " +
                                                     "left join BJVVV..DATAEXTPLAIN Pmesto on Pmesto.IDDATAEXT = mesto.ID " +
                                                     "left join BJVVV..DATAEXT tom on A.IDMAIN = tom.IDMAIN and tom.MNFIELD = 225 and tom.MSFIELD = '$h' " +
                                                     "left join BJVVV..DATAEXTPLAIN Ptom on Ptom.IDDATAEXT = tom.ID " +
                                                     "where A.IDMAIN = " + dg.SelectedRows[0].Cells["pin"].Value.ToString();
                DS  = new DataSet();
                t   = F1.SqlDA.Fill(DS, "t");
                str = "Год: " + DS.Tables["t"].Rows[0][0].ToString() + "   Том: " + DS.Tables["t"].Rows[0][1].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = "Место издания: " + DS.Tables["t"].Rows[0]["mesto"].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                //rectangle = new Rectangle(0, 325, 315, 25);
                //e.Graphics.DrawRectangle(Pens.Black, rectangle);
                //str = "Подпись читателя";
                //e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = DateTime.Now.Date.ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 75);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);


                //========вторая часть требования
                DS        = new DataSet();
                t         = 0;// Conn.SQLDA.Fill(DS, "t");
                str       = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                CurrentY += 75;
                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);

                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select ISNULL(FamilyName+' ' +substring([Name],1,1)+'. ',' ') + substring(ISNULL(FatherName,' '),1,1)+ " +
                                                     " case when FatherName is null then '' else '.' end  from  Readers..Main where NumberReader =" + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                DS        = new DataSet();
                t         = F1.SqlDA.Fill(DS, "t");
                printFont = new Font("Arial Unicode MS", 10f);
                str       = "Фамилия: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 10f);
                e.Graphics.DrawString("Сотрудник отдела: " + dep, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;


                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "НА ДОМ";
                printFont = new Font("Arial Unicode MS", 11f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Шифр: " + dg.SelectedRows[0].Cells["cipher"].Value.ToString();;
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                if (dg.SelectedRows[0].Cells["note"].Value.ToString() == string.Empty)
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString();
                }
                else
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString() + "; метка: " + dg.SelectedRows[0].Cells["note"].Value.ToString();
                }
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                CurrentY += 25;
                printFont = new Font("Arial Unicode MS", 10f);
                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = DateTime.Now.Date.ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                #endregion
            }
            else
            {
                #region обычный читатель
                //BJBookInfo Book = BJBookInfo.GetBookInfoByInventoryNumber(dg.SelectedRows[0].Cells["inv"].Value.ToString(), "BJVVV");
                //BJExemplarInfo Exemplar = BJExemplarInfo.GetExemplarByInventoryNumber(dg.SelectedRows[0].Cells["inv"].Value.ToString(), "BJVVV");
                CirculationInfo ci = new CirculationInfo();

                OrderInfo order = ci.GetOrder(Convert.ToInt32(dg.SelectedRows[0].Cells["orderid"].Value));

                BJExemplarInfo Exemplar = BJExemplarInfo.GetExemplarByIdData(order.ExemplarId, order.Fund);
                //BJBookInfo Book = BJBookInfo.GetBookInfoByPIN(order.BookId);
                if (Exemplar == null)
                {
                    throw new Exception("Ошибка при печати заказа. Обработайте этот заказ вручную, пока мы не устраним ошибку с печатью этого заказа.");
                    //MessageBox.Show("Ошибка при печати заказа. Обработайте этот заказ вручную, пока мы не устраним ошибку с печатью этого заказа.");
                    //return;
                }
                string abonement = GetAbonement(dg.SelectedRows[0].Cells["readerid"].Value.ToString());
                string str       = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                //string inv = DS.Tables["t"].Rows[0][1].ToString();
                int CurrentY = 0;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);

                str = (Exemplar.ExemplarAccess.Access == 1000) ? "НА ДОМ\n до:" : "ЧЗ\nдо:"; //1000 - на дом
                if (abonement.Contains("Платный"))
                {
                    str = "НА ДОМ\n до:";
                }
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                rectangle = new Rectangle(70, CurrentY, 245, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = (Exemplar.ExemplarAccess.Access == 1000) ? DateTime.Now.AddDays(30).ToString("dd.MM.yyyy") : DateTime.Now.AddDays(3).ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 10f);
                str       = F1.user.SelectedUserStatus.DepName.Substring(F1.user.SelectedUserStatus.DepName.IndexOf("-") + 2);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 13f);
                str       = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select FamilyName+' ' +substring([Name],1,1)+'. ' + substring(ISNULL(FatherName, ' '),1,1)+ " +
                                                     " case when FatherName is null then '' else '.' end  from  Readers..Main where NumberReader =" + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                DS        = new DataSet();
                t         = F1.SqlDA.Fill(DS, "t");
                printFont = new Font("Arial Unicode MS", 10f);
                str       = "Фамилия: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 11f);
                e.Graphics.DrawString(abonement, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Шифр: " + dg.SelectedRows[0].Cells["cipher"].Value.ToString();;
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                if (dg.SelectedRows[0].Cells["note"].Value.ToString() == string.Empty)
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString();
                }
                else
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString() + "; метка: " + dg.SelectedRows[0].Cells["note"].Value.ToString();
                }
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);

                /*rectangle = new Rectangle(158, 175, 315, 25);
                 * str = dg.SelectedRows[0].Cells["note"].Value.ToString();
                 * printFont = new Font("Arial Unicode MS", 10f);
                 * e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);*/
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Автор: " + dg.SelectedRows[0].Cells["author"].Value.ToString();
                printFont = new Font("Arial Unicode MS", 10f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 75);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = "Заглавие: " + dg.SelectedRows[0].Cells["title"].Value.ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 75;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select Plng.PLAIN " +
                                                     "from BJVVV..DATAEXT A  " +
                                                     "left join BJVVV..DATAEXT lng on A.IDMAIN = lng.IDMAIN and lng.MNFIELD = 101 and lng.MSFIELD = '$a' " +
                                                     "left join BJVVV..DATAEXTPLAIN Plng on Plng.IDDATAEXT = lng.ID " +
                                                     "where A.IDMAIN = " + dg.SelectedRows[0].Cells["pin"].Value.ToString();
                DS  = new DataSet();
                t   = F1.SqlDA.Fill(DS, "t");
                str = "Язык: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select (case when Plng.PLAIN is null then '<нет>' else Plng.PLAIN end) as first," +
                                                     " (case when Ptom.PLAIN is null then '<нет>' else Ptom.PLAIN end) as second, Pmesto.PLAIN mesto " +
                                                     "from BJVVV..DATAEXT A  " +
                                                     "left join BJVVV..DATAEXT lng on A.IDMAIN = lng.IDMAIN and lng.MNFIELD = 2100 and lng.MSFIELD = '$d' " +
                                                     "left join BJVVV..DATAEXTPLAIN Plng on Plng.IDDATAEXT = lng.ID " +
                                                     "left join BJVVV..DATAEXT mesto on A.IDMAIN = mesto.IDMAIN and mesto.MNFIELD = 210 and mesto.MSFIELD = '$a' " +
                                                     "left join BJVVV..DATAEXTPLAIN Pmesto on Pmesto.IDDATAEXT = mesto.ID " +
                                                     "left join BJVVV..DATAEXT tom on A.IDMAIN = tom.IDMAIN and tom.MNFIELD = 225 and tom.MSFIELD = '$h' " +
                                                     "left join BJVVV..DATAEXTPLAIN Ptom on Ptom.IDDATAEXT = tom.ID " +
                                                     "where A.IDMAIN = " + dg.SelectedRows[0].Cells["pin"].Value.ToString();
                DS  = new DataSet();
                t   = F1.SqlDA.Fill(DS, "t");
                str = "Год: " + DS.Tables["t"].Rows[0][0].ToString() + "   Том: " + DS.Tables["t"].Rows[0][1].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = "Место издания: " + DS.Tables["t"].Rows[0]["mesto"].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = DateTime.Now.Date.ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                rectangle = new Rectangle(0, CurrentY, 315, 75);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);


                //========вторая часть требования
                DS        = new DataSet();
                t         = 0;// Conn.SQLDA.Fill(DS, "t");
                str       = "Билет № " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                CurrentY += 75;
                rectangle = new Rectangle(0, CurrentY, 70, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);

                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                rectangle = new Rectangle(70, CurrentY, 245, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                F1.SqlDA.SelectCommand.CommandText = "select ISNULL(FamilyName+' ' +substring([Name],1,1)+'. ',' ') + substring(ISNULL(FatherName, ' '),1,1)+ " +
                                                     " case when FatherName is null then '' else '.' end  from  Readers..Main where NumberReader =" + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
                DS        = new DataSet();
                t         = F1.SqlDA.Fill(DS, "t");
                printFont = new Font("Arial Unicode MS", 10f);
                str       = "Фамилия: " + DS.Tables["t"].Rows[0][0].ToString();
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;
                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = (Exemplar.ExemplarAccess.Access == 1000) ? "НА ДОМ:" : "ЧЗ"; //1000 - на дом
                if (abonement.Contains("Платный"))
                {
                    str = "НА ДОМ\n до:";
                }
                printFont = new Font("Arial Unicode MS", 11f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str       = "Шифр: " + dg.SelectedRows[0].Cells["cipher"].Value.ToString();;
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 50;

                rectangle = new Rectangle(0, CurrentY, 315, 25);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                if (dg.SelectedRows[0].Cells["note"].Value.ToString() == string.Empty)
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString();
                }
                else
                {
                    str = "Инв. № " + dg.SelectedRows[0].Cells["inv"].Value.ToString() + "; метка: " + dg.SelectedRows[0].Cells["note"].Value.ToString();
                }
                printFont = new Font("Arial Unicode MS", 13f);
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                printFont = new Font("Arial Unicode MS", 10f);
                rectangle = new Rectangle(0, CurrentY, 315, 50);
                e.Graphics.DrawRectangle(Pens.Black, rectangle);
                str = DateTime.Now.Date.ToString("dd.MM.yyyy");
                e.Graphics.DrawString(str, printFont, Brushes.Black, rectangle, format);
                CurrentY += 25;

                #endregion
            }
        }
コード例 #17
0
        public void ShowReaderOrders()
        {
            dgwReaders.Rows.Clear();
            dgwReaders.Columns.Clear();
            KeyValuePair <string, string>[] columns =
            {
                new KeyValuePair <string, string> ("pin",       "ПИН"),
                new KeyValuePair <string, string> ("author",    "Автор"),
                new KeyValuePair <string, string> ("title",     "Заглавие"),
                new KeyValuePair <string, string> ("inv",       "Инв. номер"),
                new KeyValuePair <string, string> ("cipher",    "Расст. шифр"),
                new KeyValuePair <string, string> ("readerid",  "Номер читателя"),
                new KeyValuePair <string, string> ("fio",       "ФИО читателя"),
                new KeyValuePair <string, string> ("startdate", "Дата формирования заказа"),
                new KeyValuePair <string, string> ("orderid",   "orderid"),
                new KeyValuePair <string, string> ("status",    "Статус заказа"),
                new KeyValuePair <string, string> ("note",      "Инв. метка"),
                new KeyValuePair <string, string> ("pubdate",   "Дата издания"),
                new KeyValuePair <string, string> ("refusual",  "Причина отказа"),
                new KeyValuePair <string, string> ("iddata",    "iddata")
            };
            foreach (var c in columns)
            {
                dgwReaders.Columns.Add(c.Key, c.Value);
            }

            dgwReaders.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            dgwReaders.RowTemplate.DefaultCellStyle.WrapMode        = System.Windows.Forms.DataGridViewTriState.True;
            dgwReaders.Columns["startdate"].DefaultCellStyle.Format = "dd.MM.yyyy HH:mm";
            dgwReaders.Columns["pin"].Width       = 74;
            dgwReaders.Columns["author"].Width    = 125;
            dgwReaders.Columns["title"].Width     = 265;
            dgwReaders.Columns["inv"].Width       = 80;
            dgwReaders.Columns["cipher"].Width    = 100;
            dgwReaders.Columns["readerid"].Width  = 80;
            dgwReaders.Columns["fio"].Width       = 120;
            dgwReaders.Columns["startdate"].Width = 80;
            dgwReaders.Columns["orderid"].Visible = false;
            dgwReaders.Columns["status"].Width    = 100;
            dgwReaders.Columns["note"].Width      = 60;
            dgwReaders.Columns["pubdate"].Visible = false;
            dgwReaders.Columns["iddata"].Visible  = false;
            CirculationInfo  circulation = new CirculationInfo();
            List <OrderInfo> orders      = circulation.GetOrdersForStorage(bjUser.SelectedUserStatus.DepId, bjUser.SelectedUserStatus.DepName, CirculationStatuses.EmployeeLookingForBook.Value);

            if (bjUser.SelectedUserStatus.DepId == 8)//0 и 4 этаж должны получать заказы в одну точку
            {
                List <OrderInfo> orders1 = circulation.GetOrdersForStorage(15, "…Хран… Сектор книгохранения - 0 этаж");
                foreach (OrderInfo o in orders1)
                {
                    orders.Add(o);
                }
            }
            if (bjUser.SelectedUserStatus.DepId == 15)
            {
                List <OrderInfo> orders1 = circulation.GetOrdersForStorage(8, "…Хран… Сектор книгохранения - 4 этаж");
                foreach (OrderInfo o in orders1)
                {
                    orders.Add(o);
                }
            }
            foreach (var order in orders)
            {
                BJExemplarInfo exemplar = BJExemplarInfo.GetExemplarByIdData(order.ExemplarId, order.Fund);
                ReaderInfo     reader   = ReaderInfo.GetReader(order.ReaderId);
                dgwReaders.Rows.Add();
                var row = dgwReaders.Rows[dgwReaders.Rows.Count - 1];

                row.Cells["startdate"].Value = order.StartDate;
                row.Cells["pin"].Value       = order.BookId.Substring(order.BookId.IndexOf("_") + 1);
                row.Cells["author"].Value    = order.Book.Author;
                row.Cells["title"].Value     = order.Book.Title;
                row.Cells["inv"].Value       = exemplar.Fields["899$p"].ToString();
                row.Cells["cipher"].Value    = exemplar.Cipher;
                row.Cells["readerid"].Value  = order.ReaderId;

                row.Cells["fio"].Value = (string.IsNullOrEmpty(reader.FatherName)) ? $"{reader.FamilyName} {reader.Name.Substring(0, 1)}." :
                                         $"{reader.FamilyName} {reader.Name.Substring(0, 1)}. { reader.FatherName.Substring(0, 1)}.";
                row.Cells["orderid"].Value  = order.OrderId;
                row.Cells["status"].Value   = order.StatusName;
                row.Cells["note"].Value     = exemplar.Fields["899$x"].ToString();
                row.Cells["pubdate"].Value  = order.Book.PublishDate;
                row.Cells["iddata"].Value   = order.ExemplarId;
                row.Cells["refusual"].Value = string.IsNullOrEmpty(order.Refusual) ? "<нет>" : order.Refusual;
            }
        }
コード例 #18
0
        public static void Register(HttpConfiguration config)
        {
            //// Uncomment the following to use the documentation from XML documentation file.
            config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/Documentation/documentation.xml")));

            //// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
            //// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type
            //// formats by the available formatters.
            //config.SetSampleObjects(new Dictionary<Type, object>
            //{
            //    {typeof(string), "sample string"},
            //    {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
            //});

            // Extend the following to provide factories for types not handled automatically (those lacking parameterless
            // constructors) or for which you prefer to use non-default property values. Line below provides a fallback
            // since automatic handling will fail and GeneratePageResult handles only a single type.
#if Handle_PageResultOfT
            config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
#endif

            // Extend the following to use a preset object directly as the sample for all actions that support a media
            // type, regardless of the body parameter or return type. The lines below avoid display of binary content.
            // The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
            config.SetSampleForMediaType(
                new TextSample("Binary JSON content. See http://bsonspec.org for details."),
                new MediaTypeHeaderValue("application/bson"));

            //// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
            //// and have IEnumerable<string> as the body parameter or return type.
            //config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));

            //// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
            //// and action named "Put".
            //config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");

            //// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
            //// on the controller named "Values" and action named "Get" with parameter "id".
            //config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");

            //// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
            //// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter.
            //config.SetActualRequestType(typeof(string), "Values", "Get");

            //// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
            //// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
            //config.SetActualResponseType(typeof(string), "Values", "Post");


            ReaderInfo reader = ReaderInfo.GetReader(189245);
            //Readers.Get
            ReaderSimpleView rsv  = ReaderViewFactory.GetReaderSimpleView(reader);
            string           json = JsonConvert.SerializeObject(rsv, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "Get");


            //Readers.GetByOauthToken
            AccessToken token = new AccessToken();
            token.TokenValue = "jhgfjfg*%&$*FKGfkfKfI^(*&^5&^TGVfjtgfdtre$E65r86T87t)(*7goYGV986T98^&Go8yg";
            json             = JsonConvert.SerializeObject(token, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "GetByOauthToken");

            json = JsonConvert.SerializeObject(rsv, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "GetByOauthToken");

            ////Readers.ChangePasswordLocalReader
            //ChangePasswordLocalReader password = new ChangePasswordLocalReader();
            //password.DateBirth = "1984-02-14";// new DateTime(1984, 2, 14);
            //password.NewPassword = "******";
            //password.NumberReader = 189245;
            //json = JsonConvert.SerializeObject(password, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            //config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "ChangePasswordLocalReader");

            //Readers.GetLoginType
            LoginType ltype = new LoginType();
            ltype.LoginTypeValue = "Email";
            json = JsonConvert.SerializeObject(ltype, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "GetLoginType");
            UserLogin ul = new UserLogin();
            ul.Login = "******";
            json     = JsonConvert.SerializeObject(ul, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "GetLoginType");


            //Readers.ByEmail
            UserEmail ue = new UserEmail();
            ue.Email = "*****@*****.**";
            json     = JsonConvert.SerializeObject(ue, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "ByEmail");
            json = JsonConvert.SerializeObject(rsv, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "ByEmail");



            //Readers.Authorize
            AuthorizeInfo aut = new AuthorizeInfo();
            aut.login    = "******";
            aut.password = "******";
            json         = JsonConvert.SerializeObject(aut, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "Authorize");
            config.SetSampleForType(aut, new MediaTypeHeaderValue("application/json"), typeof(AuthorizeInfo));
            config.SetActualRequestType(typeof(AuthorizeInfo), "Readers", "Authorize");
            json = JsonConvert.SerializeObject(rsv, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "Authorize");

            //Readers / IsBirthDateMatchReaderId
            BirthDateMatchReaderId match = new BirthDateMatchReaderId();
            match.DateBirth = "1984-02-14";
            match.ReaderId  = 189245;
            BooleanResponse br = new BooleanResponse();
            br.Result = true;
            json      = JsonConvert.SerializeObject(match, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "IsBirthDateMatchReaderId");
            json = JsonConvert.SerializeObject(br, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Readers", "IsBirthDateMatchReaderId");

            //Readers/SetPasswordLocalReader
            SetPasswordLocalReader spwd = new SetPasswordLocalReader();
            spwd.NewPassword = "******";
            spwd.ReaderId    = 189245;
            json             = JsonConvert.SerializeObject(spwd, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "SetPasswordLocalReader");


            //Books.Get
            BookSimpleView book;
            book = ViewFactory.GetBookSimpleView("BJVVV_1411951");
            json = JsonConvert.SerializeObject(book, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Books", "Get");

            //Circulation.InsertIntoUserBasket
            ImpersonalBasket basket = new ImpersonalBasket();
            basket.BookIdArray = new List <string>();
            basket.BookIdArray.AddRange(new string[] { "BJVVV_1299121", "BJVVV_1304618", "REDKOSTJ_31866", "REDKOSTJ_43090" });
            basket.ReaderId = 189245;
            json            = JsonConvert.SerializeObject(basket, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Circulation", "InsertIntoUserBasket");

            //Circulation.Basket
            CirculationInfo   circ       = new CirculationInfo();
            List <BasketInfo> UserBasket = circ.GetBasket(888);
            json = JsonConvert.SerializeObject(UserBasket, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Circulation", "Basket");

            //Circulation.Order
            circ = new CirculationInfo();
            MakeOrder mo = new MakeOrder();
            mo.BookId      = "BJVVV_1078762";
            mo.ReaderId    = 100000;
            mo.OrderTypeId = 2;
            json           = JsonConvert.SerializeObject(mo, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Circulation", "Order");


            //Circulation.Orders
            List <OrderInfo> UserOrders = circ.GetOrders(155);
            json = JsonConvert.SerializeObject(UserOrders, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Circulation", "Orders");
            //Circulation.Basket    Delete
            BasketDelete bd = new BasketDelete();
            bd.BooksToDelete.Add("BJVVV_1299121");
            bd.BooksToDelete.Add("BJVVV_1491232");
            bd.ReaderId = 200500;
            json        = JsonConvert.SerializeObject(bd, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Circulation", "DeleteFromBasket");

            //Circulation.OrdersHistory
            List <OrderHistoryInfo> UserOrdersHistory = circ.GetOrdersHistory(100000);
            json = JsonConvert.SerializeObject(UserOrdersHistory, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Circulation", "OrdersHistory");


            //Readers.PreRegisterRemoteReader
            PreRegisterRemoteReader re = new PreRegisterRemoteReader();
            re.BirthDate   = "1975-05-05";//new DateTime(1975, 05, 05);
            re.CountryId   = 137;
            re.Email       = "*****@*****.**";
            re.FamilyName  = "Иванов";
            re.FatherName  = "Иванович";
            re.MobilePhone = "89551234567";
            re.Name        = "Иван";
            re.Password    = "******";
            json           = JsonConvert.SerializeObject(re, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "PreRegisterRemoteReader");

            //Readers.ConfirmRegistrationRemoteReader
            ConfirmRegistrationRemoteReader c = new ConfirmRegistrationRemoteReader();
            c.Url = "https://oauth.libfl.ru/activate/<activation code>";
            json  = JsonConvert.SerializeObject(c, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "ConfirmRegistrationRemoteReader");

            //Readers.ChangePasswordByEmail
            ChangePasswordByEmail em = new ChangePasswordByEmail();
            em.Email = "*****@*****.**";
            json     = JsonConvert.SerializeObject(em, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "ChangePasswordByEmail");

            //Readers.SetPasswordRemoteReader
            SetPasswordRemoteReader set = new SetPasswordRemoteReader();
            set.Url      = "https://oauth.libfl.ru/recovery/<recovery code>";
            set.Password = "******";
            json         = JsonConvert.SerializeObject(set, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "SetPasswordRemoteReader");

            //Readers.CheckPasswordUrl
            CheckPasswordUrl check = new CheckPasswordUrl();
            check.Url = "https://oauth.libfl.ru/recovery/<recovery code>";
            json      = JsonConvert.SerializeObject(check, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleRequest(json, new MediaTypeHeaderValue("application/json"), "Readers", "CheckPasswordUrl");

            //GET Litres/Account/{ReaderId}
            LitresInfo li = new LitresInfo();
            li.Login    = "******";
            li.Password = "******";
            json        = JsonConvert.SerializeObject(li, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Litres", "LitresAccount");
            //POST Litres/AssignAccount/{ReaderId}
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Litres", "AssignLitresAccount");


            //Circulation / Orders / ById /{ OrderId}
            OrderInfo oi = circ.GetOrder(22);
            json = JsonConvert.SerializeObject(oi, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Circulation", "OrdersById");

            //Books/ElectronicCopy/{id}
            ElectronicCopyFullView ec = ViewFactory.GetElectronicCopyFullView("BJVVV_138023");
            json = JsonConvert.SerializeObject(ec, Formatting.Indented, ALISSettings.ALISDateFormatJSONSettings);
            config.SetSampleResponse(json, new MediaTypeHeaderValue("application/json"), "Books", "GetElectronicCopyFullView");
        }