public string ReadManufacturer(string Srch)
        {
            StreamReader Sr = new StreamReader("WellKnown.txt");
            string       str = "", str2 = "", str3 = "", str4 = "";
            int          FirstPos = 0;

            while (Sr.Peek() != -1)
            {
                str = Sr.ReadLine();
                if (str.IndexOf(Srch) >= 0)
                {
                    FirstPos = Srch.Length;
                    str2     = str.Substring(FirstPos, str.Length - FirstPos);
                    Sr.Close();
                    return(str2);
                }
            }

            Sr.Close();

            if (str2 == "")
            {
                str3 = Srch.Substring(0, 8);
                str4 = Srch.Substring(9, 8);
                Sr   = new StreamReader("Manufacturers.txt");

                while (Sr.Peek() != -1)
                {
                    str = Sr.ReadLine();
                    if (str.IndexOf(str3) >= 0)
                    {
                        FirstPos = str.IndexOf("#");
                        if (FirstPos > 0)
                        {
                            FirstPos -= 9;
                        }
                        else
                        {
                            FirstPos = str.Length - 9;
                        }
                        str2  = str.Substring(9, FirstPos);
                        str2 += "_" + str4;
                        Sr.Close();
                        return(str2);
                    }
                }
            }

            Sr.Close();

            str2 = Srch;

            return(str2);
        }
Ejemplo n.º 2
0
        internal override IEnumerable <NavMessage> Parse()
        {
            while (!Sr.EndOfStream)
            {
                var  ch = Sr.Peek();
                char s  = Convert.ToChar(ch);
                var  satelliteSystem = s.ConvertToEnum();

                switch (satelliteSystem)
                {
                case SatelliteSystem.Gps:
                    var gpsParser = _parserMap[satelliteSystem] as GpsNavMessageContentParser;
                    Debug.Assert(gpsParser != null, "temp != null");
                    yield return(gpsParser.ParseImpl <GpsNavMessage>());

                    break;

                case SatelliteSystem.Glo:
                    var gloParser = _parserMap[satelliteSystem] as GloNavMessageContentParser;
                    Debug.Assert(gloParser != null, "temp != null");
                    yield return(gloParser.ParseImpl <GloNavMessage>());

                    break;

                case SatelliteSystem.Gal:
                    var galParser = _parserMap[satelliteSystem] as GalNavMessageContentParser;
                    Debug.Assert(galParser != null, "temp != null");
                    yield return(galParser.ParseImpl <GalNavMessage>());

                    break;

                case SatelliteSystem.Qzss:
                    var qzssParser = _parserMap[satelliteSystem] as QzssNavMessageContentParser;
                    Debug.Assert(qzssParser != null, "temp != null");
                    yield return(qzssParser.ParseImpl <QzssNavMessage>());

                    break;

                case SatelliteSystem.Bds:
                    var bdsParser = _parserMap[satelliteSystem] as BdsNavMessageContentParser;
                    Debug.Assert(bdsParser != null, "temp != null");
                    yield return(bdsParser.ParseImpl <BdsNavMessage>());

                    break;

                case SatelliteSystem.Irnss:
                    var irnssParser = _parserMap[satelliteSystem] as IrnssNavMessageContentParser;
                    Debug.Assert(irnssParser != null, "temp != null");
                    yield return(irnssParser.ParseImpl <IrnssNavMessage>());

                    break;

                case SatelliteSystem.Sbas:
                    var sbasParser = _parserMap[satelliteSystem] as SbasNavMessageContentParser;
                    Debug.Assert(sbasParser != null, "temp != null");
                    yield return(sbasParser.ParseImpl <SbasNavMessage>());

                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Side != null)
                {
                    hash = hash * 59 + Side.GetHashCode();
                }

                if (Sv != null)
                {
                    hash = hash * 59 + Sv.GetHashCode();
                }

                if (Pt != null)
                {
                    hash = hash * 59 + Pt.GetHashCode();
                }

                if (Ot != null)
                {
                    hash = hash * 59 + Ot.GetHashCode();
                }

                if (P != null)
                {
                    hash = hash * 59 + P.GetHashCode();
                }

                if (Sc != null)
                {
                    hash = hash * 59 + Sc.GetHashCode();
                }

                if (Rc != null)
                {
                    hash = hash * 59 + Rc.GetHashCode();
                }

                if (S != null)
                {
                    hash = hash * 59 + S.GetHashCode();
                }

                if (Pd != null)
                {
                    hash = hash * 59 + Pd.GetHashCode();
                }

                if (Rac != null)
                {
                    hash = hash * 59 + Rac.GetHashCode();
                }

                if (Md != null)
                {
                    hash = hash * 59 + Md.GetHashCode();
                }

                if (Sl != null)
                {
                    hash = hash * 59 + Sl.GetHashCode();
                }

                if (Avp != null)
                {
                    hash = hash * 59 + Avp.GetHashCode();
                }

                if (Sm != null)
                {
                    hash = hash * 59 + Sm.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Bsp != null)
                {
                    hash = hash * 59 + Bsp.GetHashCode();
                }

                if (Status != null)
                {
                    hash = hash * 59 + Status.GetHashCode();
                }

                if (Sr != null)
                {
                    hash = hash * 59 + Sr.GetHashCode();
                }

                if (Cd != null)
                {
                    hash = hash * 59 + Cd.GetHashCode();
                }

                return(hash);
            }
        }
        public async Task<ActionResult> Search(string filterSearch, string currentFilter, string Sr, string propertyView, int? page)
        {
            ViewBag.CurrentSearch = filterSearch;
            ViewBag.CurrentView = propertyView;

            // Biddings Pagination
            if (Sr != null)
            {
                page = 1;
            }
            else
            {
                Sr = currentFilter;
            }

            ViewBag.CurrentFilter = Sr;

            SearchBiddingsPropertyPhViewModel viewModel = new SearchBiddingsPropertyPhViewModel();

            IEnumerable<Property> allProperties = null;
            IEnumerable<Bidding> allBiddings = null;
            if ((!String.IsNullOrEmpty(Sr) && filterSearch == "Properties") || (!String.IsNullOrEmpty(Sr) && filterSearch == null))
            {
                allProperties = await db.Properties.Where(p => p.Availability.ToString().Contains("Yes")).OrderByDescending(p => p.Id).ToListAsync();
                allProperties = allProperties.Where(p => p.Id.ToString().Contains(Sr.ToUpper()) || p.Title.ToUpper().Contains(Sr.ToUpper()) || p.Agent.FullName.ToUpper().Contains(Sr.ToUpper()) );
                List<HomePropertyPhotoViewModel> allPropertyPhoto = new List<HomePropertyPhotoViewModel>();
                foreach (var property in allProperties)
                {
                    HomePropertyPhotoViewModel model = new HomePropertyPhotoViewModel();
                    model.Property = property;
                    model.Photo = await db.Photos.Where(ph => ph.PropertyId == property.Id).OrderBy(ph => ph.Id).Take(1).SingleOrDefaultAsync();
                    //model.Products = db.Photos.Where(ph => ph.PropertyID == property.ID).ToList();
                    allPropertyPhoto.Add(model);
                }

                int pageSize = 12;
                int pageNumber = (page ?? 1);
                viewModel.PropertyPhotoPaged = allPropertyPhoto.ToPagedList(pageNumber, pageSize);
            }
            else if (Sr != null && filterSearch == "Biddings" )
            {
                allBiddings = await db.Biddings.OrderByDescending(b => b.Id).ToListAsync();
                allBiddings = allBiddings.Where(b => b.Id.ToString().Contains(Sr.ToUpper()) || b.Title.ToUpper().Contains(Sr.ToUpper()) || b.Property.Agent.FullName.ToUpper().Contains(Sr.ToUpper()));

                List<BiddingsPhotoViewModel> allBiddingPhoto = new List<BiddingsPhotoViewModel>();
                foreach (var bidding in allBiddings)
                {
                    BiddingsPhotoViewModel model = new BiddingsPhotoViewModel();
                    model.Bidding = bidding;
                    model.Property = bidding.Property;
                    model.Photo = await db.Photos.Where(ph => ph.PropertyId == model.Property.Id).OrderBy(ph => ph.Id).Take(1).SingleOrDefaultAsync();
                    //model.Products = db.Photos.Where(ph => ph.PropertyID == property.ID).ToList();
                    allBiddingPhoto.Add(model);
                }

                int pageSize = 12;
                int pageNumber = (page ?? 1);
                viewModel.BiddingsPhotoPaged = allBiddingPhoto.ToPagedList(pageNumber, pageSize);
            }
            else
            {
                ViewBag.CurrentSearch = "Properties";
            }

            

            return View(viewModel);
        }
Ejemplo n.º 5
0
        public override bool Import()
        {
            string s = Sr.ReadToEnd();

            TemplateHelper tmph = new TemplateHelper("");

            string[]            arys = regRowSplit.Split(s);
            List <DAL.ShowBase> sbs  = new List <DAL.ShowBase>();
            List <DAL.STPa>     pas  = new List <DAL.STPa>();
            List <DAL.STIV>     ivs  = new List <DAL.STIV>();
            List <DAL.STIpc>    ipcs = new List <DAL.STIpc>();
            List <DAL.STPR>     prs  = new List <DAL.STPR>();
            List <DAL.STDT>     dts  = new List <DAL.STDT>();
            List <DAL.STQY>     qys  = new List <DAL.STQY>();

            int count = arys.Length - 1;

            SetMaxProcess(this, count);
            Thimport = new Thread(() =>
            {
                //第一行为空
                for (int i = 1; i <= arys.Length - 1; i++)
                {
                    string tmp = regspace.Replace(regcharRNT.Replace(arys[i].Trim(), ""), "");
                    foreach (string x in otherstring)
                    {
                        tmp = tmp.Replace(x, "");
                    }
                    tmp = RemoveZaoZi(tmp);
                    MatchCollection mhs = rowRege.Matches(tmp);
                    ShowBase sb         = new ShowBase();
                    sb.ZTID             = ZTId;
                    sb.ImportDate       = DateTime.Now;

                    foreach (Match m in mhs)
                    {
                        string colname        = m.Groups["colname"].Value;
                        string val            = m.Groups["colval"].Value.Trim().Trim('\t');
                        string mappingcolname = tmph.getMappingColumnName(colname);
                        switch (mappingcolname)
                        {
                        case "申请号":
                            sb.An  = val;
                            sb.SiD = val;
                            break;

                        case "发明名称":
                            sb.Title = val;
                            break;

                        case "摘要":
                            sb.ABs = val;
                            break;

                        case "权利要求":
                            sb.ClM = val;
                            break;

                        case "国际分类号":
                            sb.Ipc = val;
                            break;

                        case "范畴分类号":
                            sb.FCfL = val;
                            break;

                        case "国家/省市":
                            sb.ShEng = val;
                            break;

                        case "申请人":
                            sb.Pa = val;
                            break;

                        case "联系地址":
                            sb.AddR = val;
                            break;

                        case "邮编":
                            sb.Zip = val;
                            break;

                        case "代理机构":
                            sb.DLJG = val;
                            break;

                        case "代理人":
                            sb.DLr = val;
                            break;

                        case "代理机构地址":
                            sb.DLJGAddR = val;
                            break;

                        case "发明人":
                            sb.IV = val;
                            break;

                        case "申请日":
                            sb.Ad = val;
                            break;

                        case "公开号":
                            sb.PN = val;
                            break;

                        case "公开日":
                            sb.PD = val;
                            break;

                        //case "授权公告日":
                        //    sb.Gd = val;
                        //    break;
                        case "公告日":
                            sb.Gd = val;
                            break;

                        //case "授权日":
                        //    sb.Gd = val;
                        //    break;
                        case "公告号":
                            sb.GN = val;
                            break;

                        case "优先权":
                            sb.PR = val;
                            break;

                        case "审批历史":
                            sb.LG = val;
                            break;

                        case "附图数":
                            sb.PiCSum = val;
                            break;

                        case "页数":
                            sb.DesPageSum = val;
                            break;

                        case "权利要求项数":
                            sb.ClMSum = val;
                            break;
                        }
                    }
                    if (CheckExist(sb.SiD))
                    {
                        if (Skip)
                        {
                            Skip_sum++;
                            continue;
                        }
                        else
                        {
                            DelExist(sb.ZTID.ToString(), sb.SiD.ToString());
                            Overwrite_sum++;
                        }
                    }
                    else
                    {
                        Sids.Add(sb.SiD, true);
                    }
                    sbs.Add(sb);

                    List <STPa> pa   = new List <STPa>();
                    List <STIV> iv   = new List <STIV>();
                    List <STIpc> ipc = new List <STIpc>();
                    List <STPR> pr   = new List <STPR>();
                    List <STQY> qy   = new List <STQY>();
                    dts.Add(CPRSIndex.AutoIndex(sb, out pa, out iv, out ipc, out pr, out qy));
                    pas.AddRange(pa);
                    ivs.AddRange(iv);
                    ipcs.AddRange(ipc);
                    prs.AddRange(pr);
                    qys.AddRange(qy);

                    if (i % 100 == 0)
                    {
                        //Thread.Sleep(1000);
                        //todo:标引
                        //todo:标引信息入库

                        //todo:基本信息入库
                        BulkInsert(sbs, pas, ivs, ipcs, prs, dts, qys);
                        sbs.Clear();
                        pas.Clear();
                        ivs.Clear();
                        ipcs.Clear();
                        prs.Clear();
                        dts.Clear();
                        qys.Clear();
                        ShowProcess(this, i, Skip_sum, Overwrite_sum, "导入");
                    }
                }
                if (sbs.Count > 0)
                {
                    BulkInsert(sbs, pas, ivs, ipcs, prs, dts, qys);
                    sbs.Clear();
                    pas.Clear();
                    ivs.Clear();
                    ipcs.Clear();
                    prs.Clear();
                    dts.Clear();
                    qys.Clear();
                }

                log.Info(string.Format("导入完毕: 专题库:{0},ID:{1},类型:,{2}总量:{3},跳过:{4}", ztName, ZTId, Type, count, Skip_sum));
                ShowProcess(this, count, Skip_sum, Overwrite_sum, "导入完毕");

                Sr.Close();
                Sr.Dispose();
            });
            Thimport.Start();
            return(true);
        }
Ejemplo n.º 6
0
        public override bool Import()
        {
            string s = Sr.ReadToEnd().Replace(kunkaojin, "");
            TemplateHelper tmph = new TemplateHelper("");
            string[] arys = regRowSplit.Split(s);
            List<ShowBase> sbs = new List<ShowBase>();
            List<STPa> pas = new List<STPa>();
            List<STIV> ivs = new List<STIV>();
            List<STIpc> ipcs = new List<STIpc>();
            List<STPR> prs = new List<STPR>();
            List<STDT> dts = new List<STDT>();
            List<STFML> fmls = new List<STFML>();
            List<STCPc> cpcs = new List<STCPc>();
            int count = arys.Length - 1;
            SetMaxProcess(this, count);
            Thimport = new Thread(() =>
            {
                //第一行为空
                for (int i = 1; i <= count; i++)
                {
                    string tmp = regsharp.Replace(arys[i], "");
                    tmp = regspace.Replace(regcharRNT.Replace(tmp, ""), " ");
                    tmp = MarkReplece.Replace(tmp, "【$1】").Trim();
                    MatchCollection mhs = rowRege.Matches(tmp);
                    ShowBase sb = new ShowBase() { An = "", SiD = "", Ipc = "", Pa = "", IV = "", PN = "" };
                    sb.ZTID = ZTId;
                    sb.ImportDate = DateTime.Now;

                    foreach (Match m in mhs)
                    {
                        string colname = m.Groups["colname"].Value;
                        string val = m.Groups["colval"].Value.Trim().Trim('\t');
                        string mappingcolname = tmph.getMappingColumnName(colname);
                        switch (mappingcolname)
                        {
                            case "AN":
                                sb.SiD = val;
                                break;
                            case "AP":
                                sb.An = val;
                                break;
                            case "TI":
                                sb.Title = val;
                                break;
                            case "IC":
                            case "CCA":
                            case "CCI":
                                if (sb.Ipc == null)
                                {
                                    sb.Ipc = val;
                                }
                                else
                                {
                                    sb.Ipc += ";" + val;
                                }
                                break;
                            case "PA":
                                sb.Pa = val;
                                break;
                            case "CPY":
                                sb.CPY = val;
                                break;
                            case "OPD":
                                sb.OpD = val;
                                break;
                            case "AB":
                                sb.ABs = val;
                                break;
                            case "IN":
                                sb.IV = val;
                                break;
                            case "PN":
                                sb.PN = val;
                                break;
                            case "PR":
                                sb.PR = val;
                                break;
                            case "PD":
                                sb.PD = val;
                                break;
                            case "DS":
                                sb.DS = val;
                                break;
                            case "DMC":
                                sb.DMc = val;
                                break;
                            case "FAMN":
                                sb.FaMN = val;
                                break;
                            case "CT":
                                sb.Ct = val;
                                break;
                            case "CTNP":
                                sb.CtNP = val;
                                break;
                            case "FI":
                                sb.FI = val;
                                break;
                            case "FT":
                                sb.FT = val;
                                break;
                            case "RF":
                                sb.RF = val;
                                break;
                            case "RFAP":
                                sb.RFaP = val;
                                break;
                            case "RFNP":
                                sb.RFNP = val;
                                break;
                            case "EC":
                                sb.Ec = val;
                                break;

                        }
                    }
                    if (CheckExist(sb.SiD))
                    {
                        if (Skip)
                        {

                            Skip_sum++;
                            continue;
                        }
                        else
                        {
                            DelExist(sb.ZTID.ToString(), sb.SiD.ToString());
                            Overwrite_sum++;
                        }

                    }
                    else
                    {
                        Sids.Add(sb.SiD, true);
                    }
                    sbs.Add(sb);

                    List<STPa> pa = new List<STPa>();
                    List<STIV> iv = new List<STIV>();
                    List<STIpc> ipc = new List<STIpc>();
                    List<STPR> pr = new List<STPR>();
                    List<STFML> fml = new List<STFML>();
                    List<STCPc> cpc = new List<STCPc>();
                    dts.Add(EPODOCIndex.AutoIndex(sb, out pa, out iv, out ipc, out pr, out fml, out cpc));
                    pas.AddRange(pa);
                    ivs.AddRange(iv);
                    ipcs.AddRange(ipc);
                    prs.AddRange(pr);
                    fmls.AddRange(fml);
                    cpcs.AddRange(cpc);
                    if (i % 100 == 0)
                    {

                        //Thread.Sleep(1000);
                        //todo:标引
                        //todo:标引信息入库

                        //todo:基本信息入库
                        //BulkInsert(sbs);
                        BulkInsert(sbs, pas, ivs, ipcs, prs, fml, dts, cpcs);
                        sbs.Clear();
                        pas.Clear();
                        ivs.Clear();
                        ipcs.Clear();
                        prs.Clear();
                        dts.Clear();
                        fmls.Clear();
                        cpcs.Clear();
                        ShowProcess(this, i, Skip_sum, Overwrite_sum, "导入");
                    }

                }
                if (sbs.Count > 0)
                {
                    BulkInsert(sbs, pas, ivs, ipcs, prs, fmls, dts, cpcs);
                    sbs.Clear();
                    pas.Clear();
                    ivs.Clear();
                    ipcs.Clear();
                    prs.Clear();
                    dts.Clear();
                    fmls.Clear();
                    cpcs.Clear();
                }

                ShowProcess(this, count, Skip_sum, Overwrite_sum, "导入完毕");

                Sr.Close();
                Sr.Dispose();

            });
            Thimport.Start();
            return true;
        }
Ejemplo n.º 7
0
        private void SearchMebelKreslo()
        {
            switch (comboBox3.SelectedIndex)
            {
            case 0:
                DirectoryInfo di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла");
                FileInfo[]    fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        MessageBox.Show("На найдено");
                        Sr.Close();
                    }
                    Sr.Close();
                }

                break;

            case 1:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                    Sr.ReadLine();
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        MessageBox.Show("На найдено");
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 2:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                    for (int j = 0; j < 2; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        MessageBox.Show("На найдено");
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 3:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                    for (int j = 0; j < 3; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        MessageBox.Show("На найдено");
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 4:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла");
                fia = di.GetFiles();

                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                    for (int j = 0; j < 4; j++)
                    {
                        Sr.ReadLine();
                    }
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Кресла\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        MessageBox.Show("На найдено");
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            default:
                MessageBox.Show("Заполните все поля");
                break;
            }
        }
Ejemplo n.º 8
0
        private void SearchMebelDivan()
        {
            switch (comboBox3.SelectedIndex)
            {
            case 0:
                DirectoryInfo di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны");
                FileInfo[]    fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }


                    Sr.Close();
                }

                break;

            case 1:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                    Sr.ReadLine();
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }


                    Sr.Close();
                }
                break;

            case 2:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                    for (int j = 0; j < 2; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }


                    Sr.Close();
                }
                break;

            case 3:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                    for (int j = 0; j < 3; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 4:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны");
                fia = di.GetFiles();

                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                    for (int j = 0; j < 4; j++)
                    {
                        Sr.ReadLine();
                    }
                    if (textBox5.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Mebel\Диваны\" + fia[i].ToString());
                        listBox3.Items.Add(Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }


                    Sr.Close();
                }
                break;
            }
        }
Ejemplo n.º 9
0
        private void Search_Click_1(object sender, EventArgs e)
        {
            listBox2.Items.Clear();
            switch (comboBox6.SelectedIndex)
            {
            case 0:
                DirectoryInfo di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base");
                FileInfo[]    fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                    if (textBox4.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                        listBox2.Items.Add(Sr.ReadLine() + " " + Sr.ReadLine() + " " + Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }

                break;

            case 1:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                    Sr.ReadLine();
                    if (textBox4.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                        listBox2.Items.Add(Sr.ReadLine() + " " + Sr.ReadLine() + " " + Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 2:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                    for (int j = 0; j < 2; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox4.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                        listBox2.Items.Add(Sr.ReadLine() + " " + Sr.ReadLine() + " " + Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 3:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base");
                fia = di.GetFiles();
                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                    for (int j = 0; j < 3; j++)
                    {
                        Sr.ReadLine();
                    }

                    if (textBox4.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                        listBox2.Items.Add(Sr.ReadLine() + " " + Sr.ReadLine() + " " + Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;

            case 4:
                di  = new DirectoryInfo(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base");
                fia = di.GetFiles();

                for (int i = 0; i < fia.Count(); i++)
                {
                    StreamReader Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                    for (int j = 0; j < 4; j++)
                    {
                        Sr.ReadLine();
                    }
                    if (textBox4.Text == Sr.ReadLine())
                    {
                        Sr.Close();
                        Sr = new StreamReader(@"C:\Users\Univer\Desktop\Модуль\csharp_blank\Base\" + fia[i].ToString());
                        listBox2.Items.Add(Sr.ReadLine() + " " + Sr.ReadLine() + " " + Sr.ReadLine());
                    }
                    else
                    {
                        Sr.Close();
                    }
                    Sr.Close();
                }
                break;
            }
        }