예제 #1
0
        private void button_YH69EER_Click(object sender, EventArgs e)
        {
            // Запрос наличия счета
            if (CheckSession(false))
            {
                string        API      = "YH69EER";
                StringBuilder sb_input = new StringBuilder(0);
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces(textBox_YH69EER_HZEAN.Text, 20)); //
                sb_input = sb_input.Append(" ");                                                    // Код внешней системы А(1)
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 11));                         // Зарезервировано А(11)

                if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                {
                    ShowErrorsWarnings(true); // Ошибки/Предупреждения
                    return;
                }
                //
                textBox_Session_Info.ForeColor = Color.FromName("Green");
                textBox_Session_Info.Text      = "Готово";


                int ListCount = 1;
                FillListView(listView_YH69EER, ListCount, API, WorkPath + API + ".txt", false);
            }
        }
예제 #2
0
        private void button_YH68EER_Click(object sender, EventArgs e)
        {
            // Запрос текущего остатка по счету
            if (CheckSession(false))
            {
                listView_AccountsInfo.Items.Clear();
                listView_AccountsInfo.Columns.Clear();
                groupBox_AccountsInfo.Text = groupBox_YH68EER.Text;
                string        API      = "YH68EER";
                StringBuilder sb_input = new StringBuilder(0);
                sb_input = sb_input.Append(textBox_HZEAN.Text);             // Номер лицевого счета А(20)
                sb_input = sb_input.Append(" ");                            // Код внешней системы А(1)
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 29)); // Зарезервировано А(29) "                             "

                if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                {
                    ShowErrorsWarnings(true); // Ошибки/Предупреждения
                    return;
                }
                //
                textBox_Session_Info.ForeColor = Color.FromName("Green");
                textBox_Session_Info.Text      = "Готово";
                //textBox_AccountInfo.Text = EQGateDLL.RequestOutput;
                //textBox_HZCABL.Text = textBox_AccountInfo.Text.Substring(0, 16);
                //textBox_HZODL.Text = textBox_AccountInfo.Text.Substring(16, 16);
                int ListCount = 1;
                //ListCount = EQGateDLL.mcs_RecordsReturned;
                FillListView(listView_AccountsInfo, ListCount, API, WorkPath + API + ".txt", false);
            }
        }
예제 #3
0
        private void button_AccountInfo_Click(object sender, EventArgs e)
        {
            // Запрос текущего остатка по списку счетов
            if (CheckSession(false))
            {
                listView_AccountsInfo.Items.Clear();
                listView_AccountsInfo.Columns.Clear();
                groupBox_AccountsInfo.Text = groupBox_AccountsList.Text;
                string API = "YH68EER";
                AccFile = WorkPath + AccountFile[AccountIndex] + AccountsFileExt;
                if (!File.Exists(AccFile))
                {
                    Logger.Log.SaveLog("RUN_5", "Файл со счетами «" + AccFile + "» не найден!", "err");
                }
                if (File.Exists(AccFile))
                {
                    FileInfo fi = new FileInfo(AccFile);
                    using (StreamReader sr = new StreamReader(AccFile))
                    {
                        while (sr.Peek() >= 0)
                        {
                            StringBuilder sb_input = new StringBuilder(0);
                            sb_input = sb_input.Append(sr.ReadLine().Trim());           // Номер лицевого счета А(20)
                            sb_input = sb_input.Append(" ");                            // Код внешней системы А(1)
                            sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 29)); // Зарезервировано А(29) "                             "

                            if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                            {
                                ShowErrorsWarnings(true); // Ошибки/Предупреждения
                                return;
                            }
                            //
                            textBox_Session_Info.ForeColor = Color.FromName("Green");
                            textBox_Session_Info.Text      = "Готово";
                            //textBox_AccountInfo.Text = EQGateDLL.RequestOutput;
                            //textBox_HZCABL.Text = textBox_AccountInfo.Text.Substring(0, 16);
                            //textBox_HZODL.Text = textBox_AccountInfo.Text.Substring(16, 16);
                            int ListCount = 1;
                            //ListCount = EQGateDLL.mcs_RecordsReturned;
                            FillListView(listView_AccountsInfo, ListCount, API, WorkPath + "osv.txt", true);
                        }
                    }
                }
            }
        }
예제 #4
0
        private void button_YYBXDER_Click(object sender, EventArgs e)
        {
            // Проводки по лицевому счету
            if (CheckSession(false))
            {
                string API = "YYBXDER";
                // Дата, за которую отбираются проводки D
                string   Date = "        ";
                DateTime dt   = dateTimePicker_HZBPD.Value;
                Date = dt.ToString("yyyyMMdd");

                StringBuilder sb_input = new StringBuilder(0);
                sb_input = sb_input.Append(Date);                                           // Дата учета D
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces(textBox_Brief.Text, 20)); // Номер лицевого счета А(20)
                sb_input = sb_input.Append(" ");                                            // Код внешней системы А(1)
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 21));                 // Зарезервировано А(21)

                EQGateDLL.mcs_QueryType        = 0;
                EQGateDLL.mcs_RecordsRequested = Convert.ToInt32(numericUpDown_RecordsRequested.Value);
                EQGateDLL.mcs_RecordsReturned  = 0;
                EQGateDLL.mcs_NotFinished      = 0;

                if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                {
                    ShowErrorsWarnings(true); // Ошибки/Предупреждения
                    return;
                }
                //
                textBox_Session_Info.ForeColor = Color.FromName("Green");
                textBox_Session_Info.Text      = @"Готово";
                textBox_Session_Info.Text     += @"  QueryType = " + EQGateDLL.mcs_QueryType.ToString();
                textBox_Session_Info.Text     += @"  RecordsRequested = " + EQGateDLL.mcs_RecordsRequested.ToString();
                textBox_Session_Info.Text     += @"  RecordsReturned = " + EQGateDLL.mcs_RecordsReturned.ToString();
                textBox_Session_Info.Text     += @"  NotFinished = " + EQGateDLL.mcs_NotFinished.ToString();
                listView_YYBXDER.Items.Clear();
                int ListCount = EQGateDLL.mcs_RecordsReturned;
                FillListView(listView_YYBXDER, ListCount, API, WorkPath + API + ".txt", false);
            }
        }
예제 #5
0
        private void button_YS01DER_Click(object sender, EventArgs e)
        {
            try
            {
                // Запрос на существование счетов
                if (CheckSession(false))
                {
                    listView_AccountsInfo.Items.Clear();
                    listView_AccountsInfo.Columns.Clear();
                    groupBox_AccountsInfo.Text = groupBox_YS01DER.Text;
                    string        API      = "YS01DER";
                    StringBuilder sb_input = new StringBuilder(0);
                    sb_input = sb_input.Append(EQGateDLL.InsertSpaces(textBox_YS01DER_HSMSK.Text, 20)); // Номер лицевого счета А(20)
                    sb_input = sb_input.Append(" ");                                                    // Код внешней системы А(1)
                    sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 29));                         // Зарезервировано А(29) "                             "

                    if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                    {
                        ShowErrorsWarnings(true); // Ошибки/Предупреждения
                        return;
                    }
                    //
                    textBox_Session_Info.ForeColor = Color.FromName("Green");
                    textBox_Session_Info.Text      = @"Готово";
                    textBox_Session_Info.Text     += @"  QueryType = " + EQGateDLL.mcs_QueryType.ToString();
                    textBox_Session_Info.Text     += @"  RecordsRequested = " + EQGateDLL.mcs_RecordsRequested.ToString();
                    textBox_Session_Info.Text     += @"  RecordsReturned = " + EQGateDLL.mcs_RecordsReturned.ToString();
                    textBox_Session_Info.Text     += @"  NotFinished = " + EQGateDLL.mcs_NotFinished.ToString();
                    int ListCount = 1;
                    ListCount = EQGateDLL.mcs_RecordsReturned;
                    FillListView(listView_AccountsInfo, ListCount, API, WorkPath + API + ".txt", false);
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
        }
예제 #6
0
        private void button_ClientInfo_Click(object sender, EventArgs e)
        {
            if (CheckSession(false))
            {
                // Запрос информации по клиенту
                string        API      = "YG01EER";
                StringBuilder sb_input = new StringBuilder(0);
                sb_input = sb_input.Append(textBox_GZCUS.Text);             // Мнемоника клиента А(1)
                sb_input = sb_input.Append("   ");                          // Код месторасположения клиента А(3)
                sb_input = sb_input.Append(" ");                            // Код внешней системы А(1)
                sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 22)); // Зарезервировано А(22) "                      "

                if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                {
                    ShowErrorsWarnings(true); // Ошибки/Предупреждения
                    return;
                }
                //
                textBox_Session_Info.ForeColor = Color.FromName("Green");
                textBox_Session_Info.Text      = "Готово";
                int ListCount = 1;
                FillListView(listView_YG01EER, ListCount, API, WorkPath + API + ".txt", false);
            }
        }
예제 #7
0
        private void button_ClientsList_Click(object sender, EventArgs e)
        {
            // Запрос наличия счета
            if (CheckSession(false))
            {
                string API     = "YH69EER";
                string AccFile = WorkPath + @"SP-SCH.acc";
                if (File.Exists(AccFile))
                {
                    try
                    {
                        // Create an instance of StreamReader to read from a file.
                        // The using statement also closes the StreamReader.
                        using (StreamReader sr = new StreamReader(AccFile))
                        {
                            string line;
                            while ((line = sr.ReadLine()) != null)
                            {
                                StringBuilder sb_input = new StringBuilder(0);
                                sb_input = sb_input.Append(EQGateDLL.InsertSpaces(textBox_YH69EER_HZEAN.Text, 20)); //
                                sb_input = sb_input.Append(" ");                                                    // Код внешней системы А(1)
                                sb_input = sb_input.Append(EQGateDLL.InsertSpaces("", 11));                         // Зарезервировано А(11)

                                if (EQGateDLL.Request(API, sb_input, EQGateAPI.EQGateClassAPI.GetAPIAttribute(API, "type")) != true)
                                {
                                    ShowErrorsWarnings(true); // Ошибки/Предупреждения
                                    return;
                                }
                                string ToFile      = WorkPath + @"SP-SCH.txt";
                                string temp        = String.Empty;
                                int    FieldsCount = 0;
                                using (StreamWriter sw = File.CreateText(ToFile))
                                {
                                    FieldsCount = EQGateAPI.EQGateClassAPI.GetFieldsCount(API, "");
                                    temp        = EQGateDLL.GetRequestOutputItem(Convert.ToInt32(Convert.ToDouble(EQGateAPI.EQGateClassAPI.GetFieldValue(API, "", 0, "size", ""))));
                                    for (int i = 1; i < FieldsCount; i++)
                                    {
                                        string Size = EQGateAPI.EQGateClassAPI.GetFieldValue(API, "", i, "size", "");
                                        temp = EQGateDLL.GetRequestOutputItem(Convert.ToInt32(Convert.ToDouble(Size)));
                                        sw.Write(temp.Trim());
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception exc)
                    {
                        // Let the user know what went wrong.
                        //Console.WriteLine("The file could not be read:");
                        //Console.WriteLine(exc.Message);
                        Logger.Log.SaveLog("", exc.ToString(), "err");
                    }
                    textBox_Session_Info.ForeColor = Color.FromName("Green");
                    textBox_Session_Info.Text      = "Готово";


                    int ListCount = 1;

                    FillListView(listView_YH69EER, ListCount, "YH69EER", WorkPath + @"YH69EER.txt", false);
                }
            }
        }