Ejemplo n.º 1
0
        private void GetAllWorkers()
        {
            ACOT.Services.OrgnameService.IOrgnameService orgnameService = new ACOT.Services.OrgnameService.OrgnameService();
            string orgname = orgnameService.GetOrgname();
            spraw = Environment.CurrentDirectory + "\\SPRAW." + orgname;
            adres = Environment.CurrentDirectory + "\\ADRES." + orgname;

            using (FileStream fs = new FileStream(adres, FileMode.Open, FileAccess.ReadWrite))
            {
                fs.Seek(0, SeekOrigin.Begin);
                byte[] int8600 = new byte[8600];

                while (fs.Read(int8600, 0, 8600) > 0)
                {
                    WorkersDataSet.WorkersRow row = _workersTable.NewWorkersRow();
                    int tna = BitConverter.ToInt32(int8600, 0);
                    if (tna != 0)
                    {
                        row.TBN = tna.ToString("D5");
                        // FIO
                        string buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 4, 44));
                        row.NAME = buf.Trim();

                        // kodstran
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 48, 3));
                        row.KODSTRAN = buf.Trim();

                        // kodreg
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 51, 2));
                        row.KODREG = buf.Trim();

                        // index
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 53, 6));
                        row.INDEX = buf.Trim();

                        // gorod
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 59, 40));
                        row.GOROD = buf.Trim();

                        // n_punkt
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 99, 40));
                        row.NPUNKT = buf.Trim();

                        // raion
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 139, 25));
                        row.RAION = buf.Trim();

                        // ulica
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 164, 40));
                        row.ULICA = buf.Trim();

                        // dom
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 204, 7));
                        row.DOM = buf.Trim();

                        // korp
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 211, 2));
                        row.KORPUS = buf.Trim();

                        // kvart
                        buf = Encoding.UTF8.GetString(
                            Encoding.Convert(Encoding.GetEncoding(866), Encoding.UTF8, int8600, 213, 5));
                        row.KVART = buf.Trim();

                        _workersTable.AddWorkersRow(row);
                    }
                    //else
                    //    row.TBN = "00000";
                }
            }
        }
Ejemplo n.º 2
0
 private string GetOrgnameExtention()
 {
     ACOT.Services.OrgnameService.IOrgnameService orgname = new ACOT.Services.OrgnameService.OrgnameService();
     return orgname.GetOrgname();
 }