예제 #1
0
 private string GetQualifiedName(string name, BrowseType browseType)
 {
     string pszQualifiedAreaName = null;
     if (browseType == BrowseType.Area)
     {
         try
         {
             ((IOPCEventAreaBrowser) this.m_browser).GetQualifiedAreaName(name, out pszQualifiedAreaName);
             return pszQualifiedAreaName;
         }
         catch (Exception exception)
         {
             throw OpcCom.Interop.CreateException("IOPCEventAreaBrowser.GetQualifiedAreaName", exception);
         }
     }
     try
     {
         ((IOPCEventAreaBrowser) this.m_browser).GetQualifiedSourceName(name, out pszQualifiedAreaName);
     }
     catch (Exception exception2)
     {
         throw OpcCom.Interop.CreateException("IOPCEventAreaBrowser.GetQualifiedSourceName", exception2);
     }
     return pszQualifiedAreaName;
 }
예제 #2
0
        public IActionResult FilterBy(BrowseType filter)
        {
            if (filter == BrowseType.Genre)
            {
                List <MovieGenre> movieFilters = context.Genres.ToList();

                BrowseTypeViewModel movieViewModel = new BrowseTypeViewModel
                {
                    Genres = movieFilters
                };

                movieViewModel.Title  = "Movies filtered by " + filter;
                movieViewModel.Filter = filter;

                return(View(movieViewModel));
            }

            else
            {
                List <MovieStreamingService> movieFilters = context.StreamingServices.ToList();

                BrowseTypeViewModel movieViewModel = new BrowseTypeViewModel
                {
                    StreamingServices = movieFilters,
                };

                movieViewModel.Title  = "Choose a " + filter;
                movieViewModel.Filter = filter;

                return(View(movieViewModel));
            }
        }
예제 #3
0
 private int FetchElements(BrowseType browseType, int maxElements, UCOMIEnumString enumerator, ArrayList elements)
 {
     string[] rgelt = new string[1];
     int celt = ((maxElements > 0) && ((maxElements - elements.Count) < rgelt.Length)) ? (maxElements - elements.Count) : rgelt.Length;
     int pceltFetched = 0;
     int num3 = enumerator.Next(celt, rgelt, out pceltFetched);
     while (num3 == 0)
     {
         for (int i = 0; i < pceltFetched; i++)
         {
             BrowseElement element = new BrowseElement {
                 Name = rgelt[i],
                 QualifiedName = this.GetQualifiedName(rgelt[i], browseType),
                 NodeType = browseType
             };
             elements.Add(element);
         }
         if ((maxElements > 0) && (elements.Count >= maxElements))
         {
             return num3;
         }
         celt = ((maxElements > 0) && ((maxElements - elements.Count) < rgelt.Length)) ? (maxElements - elements.Count) : rgelt.Length;
         num3 = enumerator.Next(celt, rgelt, out pceltFetched);
     }
     return num3;
 }
예제 #4
0
 private void Transit(BookmarkItemViewModel item, BrowseType type)
 {
     Messenger.Send(new NavigationMessage(
                        new Uri("/View/BookmarkContentView.xaml", UriKind.Relative),
                        new BookmarkContentViewModel(ChooseVM(), item, type, ChooseTitle()),
                        MessageKeys.TransitionKey));
 }
 public string[] GetTagByCriteria(BrowseType type, string filterCriteria)
 {
     return(_server
            .GetAddressSpaceBrowser()
            .GetItemIds(type, filterCriteria, VarEnum.VT_EMPTY, 0)
            .ToArray());
 }
예제 #6
0
        void openBrowse(BrowseType type)
        {
            switch (type)
            {
            case BrowseType.Ffmpeg:
                OpenFileDialog ofd = new OpenFileDialog
                {
                    Title  = "Open ffmpeg",
                    Filter = "Application (*.exe)|*.exe|All files (*.*)|*.*"
                };
                if (ofd.ShowDialog() == true && !string.IsNullOrWhiteSpace(ofd.FileName))
                {
                    tbFfmpegPath.Text       = ofd.FileName;
                    conf.Default.ffmpegPath = ofd.FileName;
                }
                break;

            case BrowseType.Downloads:
                WinForms.FolderBrowserDialog fbd = new WinForms.FolderBrowserDialog
                {
                    Description = "Please select the folder where downloaded streams will be saved to."
                };
                if (fbd.ShowDialog() == WinForms.DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    tbDownloadDir.Text       = fbd.SelectedPath;
                    conf.Default.downloadDir = fbd.SelectedPath;
                }
                break;

            default:
                break;
            }
        }
예제 #7
0
        public Browse(string startupPath, BrowseType type, string[] restictedDrives, params string[] extensions)
        {
            InitializeComponent();

            tb_Location.Text = startupPath;
            open             = type == BrowseType.Open;
            LoadLanguage();
            if (open)
            {
                tb_Filename.ReadOnly = true;
                tb_Filename.TabStop  = false;
            }
            this.extensions = extensions;

            cbDrives.Items.Clear();
            var drives = Directory.GetLogicalDrives();

            foreach (var drive in drives)
            {
                var found = restictedDrives != null && restictedDrives.Any(restictedDrive => drive == restictedDrive);
                if (!found)
                {
                    var drv = new DriveInfo(drive);
                    cbDrives.Items.Add(GetDriveName(drv));
                }
            }
            if (cbDrives.Items.Count > 0)
            {
                if (tb_Location.Text == String.Empty)
                {
                    cbDrives.SelectedIndex = 0;
                }
                else
                {
                    var i = 0;
                    while (i < cbDrives.Items.Count)
                    {
                        if (String.Equals(tb_Location.Text.Substring(0, 2), cbDrives.Items[i].ToString().Substring(0, 2), StringComparison.CurrentCultureIgnoreCase))
                        {
                            cbDrives.SelectedIndex = i;
                            tb_Location.Text       = startupPath;
                            GetFoldersAndFiles(tb_Location.Text, this.extensions);
                            break;
                        }
                        i++;
                    }
                    if (cbDrives.SelectedIndex == NotFount)
                    {
                        cbDrives.SelectedIndex = 0;
                    }
                }
            }
            else
            {
                tb_Location.Text = ErrorNoDrivesFound;
            }

            lvFiles.Select();
        }
예제 #8
0
 // Token: 0x060000A0 RID: 160 RVA: 0x000043B0 File Offset: 0x000033B0
 public BrowseElement[] Browse(string areaID, BrowseType browseType, string browseFilter, int maxElements, out IBrowsePosition position)
 {
     if (this.m_server == null)
     {
         throw new NotConnectedException();
     }
     return(((IServer)this.m_server).Browse(areaID, browseType, browseFilter, maxElements, out position));
 }
예제 #9
0
 // Token: 0x0600009F RID: 159 RVA: 0x0000438D File Offset: 0x0000338D
 public BrowseElement[] Browse(string areaID, BrowseType browseType, string browseFilter)
 {
     if (this.m_server == null)
     {
         throw new NotConnectedException();
     }
     return(((IServer)this.m_server).Browse(areaID, browseType, browseFilter));
 }
예제 #10
0
        public Form ShowTabular()
        {
            if (!BaseWinFramework.CheckModuleAccessWithError(ModuleName,
                                                             SecurityVarName.ReportView, true))
            {
                return(null);
            }

            using (new WaitCursor())
            {
                if (!TypeChecked)
                {
                    CheckEntityType();
                }

                if (_UIN != null)
                {
                    IRuleInitUI riu = (IRuleInitUI)_UIN.Entity;
                    _DataFilter   = riu.GetBrowseFilter();
                    BrowseColumns = riu.GetBrowseColumns();
                    riu.GetBrowseSql(out BrowseSql, out BrowseCondition, out BrowseOrder);
                    BrowseFormat.Clear();
                    riu.GetBrowseFormat(BrowseFormat);

                    TableDef td = MetaData.GetTableDef(riu.GetType());
                    if (riu.GetFieldTransactionDate().Length == 0)
                    {
                        fldTransactionDate = td.fldTransactionDate;
                    }
                    else
                    {
                        fldTransactionDate = td.GetFieldDef(
                            riu.GetFieldTransactionDate());
                    }
                }

                if (_BrowseForm == null || _BrowseForm.IsDisposed ||
                    _BrowseType != BrowseType.Tabular)
                {
                    if (BaseWinFramework.TouchScreenVersion)
                    {
                        _BrowseForm = new frmGridReportTC();
                    }
                    else
                    {
                        _BrowseForm = new frmGridReport();
                    }
                    _BrowseForm.MdiParent = BaseWinFramework._MdiParent;
                    ((IBrowseForm)_BrowseForm).ShowForm(this, ModuleName);
                    _BrowseType = BrowseType.Tabular;
                }
                else
                {
                    _BrowseForm.BringToFront();
                }
                return(_BrowseForm);
            }
        }
예제 #11
0
 /// <summary>
 /// Saves the parameters for an incomplete browse information.
 /// </summary>
 public BrowsePosition(
     string areaID,
     BrowseType browseType,
     string browseFilter)
 {
     m_areaID       = areaID;
     m_browseType   = browseType;
     m_browseFilter = browseFilter;
 }
예제 #12
0
 public AppDialogBrowse(BrowseType type, string[] extensions, string initialDirectory = null)
 {
     InitializeComponent();
     CenterOnParent();
     browseType            = type;
     this.initialDirectory = (string.IsNullOrEmpty(initialDirectory) ? null : initialDirectory);
     viewList.ItemsSource  = DisplayedItems;
     this.extensions       = extensions;
     Loaded += OnLoaded;
 }
예제 #13
0
        /// <summary>
        /// Converts a NodeType value to the OPCAEBROWSETYPE equivalent.
        /// </summary>
        internal static OpcRcw.Ae.OPCAEBROWSETYPE GetBrowseType(BrowseType input)
        {
            switch (input)
            {
            case BrowseType.Area:   return(OpcRcw.Ae.OPCAEBROWSETYPE.OPC_AREA);

            case BrowseType.Source: return(OpcRcw.Ae.OPCAEBROWSETYPE.OPC_SOURCE);
            }

            return(OpcRcw.Ae.OPCAEBROWSETYPE.OPC_AREA);
        }
예제 #14
0
    //Called when the user clicks a link
    public void Browse(Website w, BrowseType browseType)
    {
        //Manage browsing history
        if (currentTab.siteHistoryCount > 0 && browseType != BrowseType.SwitchTab)
        {
            currentTab.currentWebsite.siteObject.SetActive(false);
        }

        switch (browseType)
        {
        case BrowseType.Regular:
            //We browsed after we returned to a previous site, cut some of the sites off
            if (currentTab.historyPointer < currentTab.siteHistoryCount)
            {
                int amountOfSitesToRemove = currentTab.siteHistoryCount - currentTab.historyPointer;
                for (int i = 0; i < amountOfSitesToRemove; i++)
                {
                    currentTab.siteHistory.RemoveAt(currentTab.historyPointer);
                }
            }

            currentTab.siteHistory.Add(w);
            currentTab.siteHistoryCount = currentTab.siteHistory.Count;
            currentTab.historyPointer   = currentTab.siteHistoryCount;
            break;

        case BrowseType.Return:
            currentTab.historyPointer--;
            break;

        case BrowseType.UndoReturn:
            currentTab.historyPointer++;
            break;

        default:
            break;
        }

        //Show new site
        w.siteObject.SetActive(true);
        urlText.text = w.url;

        currentTab.headerText.text = w.headerText;
        currentTab.currentWebsite  = w;

        if (browseType != BrowseType.SwitchTab)
        {
            scrollBarHandle.SetPageAndHandle(0f);
        }
        else
        {
            scrollBarHandle.SetPageAndHandle(currentTab.percentagePageScrolled);
        }
    }
예제 #15
0
 public BrowseElement[] Browse(string areaID, BrowseType browseType, string browseFilter)
 {
     lock (this)
     {
         IBrowsePosition position = null;
         BrowseElement[] elementArray = this.Browse(areaID, browseType, browseFilter, 0, out position);
         if (position != null)
         {
             position.Dispose();
         }
         return elementArray;
     }
 }
예제 #16
0
 /// <summary>
 /// InputBox Constructor
 /// </summary>
 /// <param name="episode">caption episode</param>
 /// <param name="description">Description text</param>
 /// <param name="InitialValue">Initial textbox value</param>
 /// <param name="Browse">Show browse button?</param>
 /// <param name="AcceptEmptyOrInexistant">if empty strings or (if browse button is visible) invalid folders are accepted</param>
 public InputBox(string title, string description, string InitialValue, BrowseType Browse, bool AcceptEmptyOrInexistant)
 {
     browse = Browse;
     Accept = AcceptEmptyOrInexistant;
     InitializeComponent();
     if (Browse == BrowseType.None)
     {
         btnBrowse.Visible = false;
         btnBrowse.Enabled = false;
         txtInput.Width = 339;
     }
     this.Text = title;
     lblText.Text = description;
     txtInput.Text = InitialValue;
 }
예제 #17
0
 /// <summary>
 /// InputBox Constructor
 /// </summary>
 /// <param name="title">caption title</param>
 /// <param name="description">Description text</param>
 /// <param name="InitialValue">Initial textbox value</param>
 /// <param name="Browse">Show browse button?</param>
 /// <param name="AcceptEmptyOrInexistant">if empty strings or (if browse button is visible) invalid folders are accepted</param>
 public InputBox(string title, string description, string InitialValue, BrowseType Browse, bool AcceptEmptyOrInexistant)
 {
     browse = Browse;
     Accept = AcceptEmptyOrInexistant;
     InitializeComponent();
     if (Browse == BrowseType.None)
     {
         btnBrowse.Visible = false;
         btnBrowse.Enabled = false;
         txtInput.Width    = 339;
     }
     this.Text     = title;
     lblText.Text  = description;
     txtInput.Text = InitialValue;
 }
예제 #18
0
        /// <summary>
        /// Retrieves enumerator of current branch.
        /// </summary>
        /// <param name="type">Namespace browse mode. See <see cref="BrowseType"/></param>
        /// <param name="filterCriteria">Mask of item/folder name.</param>
        /// <param name="dataTypeFilter">Filter by type.</param>
        /// <param name="accessRightsFilter">Filter by access rights.</param>
        /// <returns>Enumerator of current namespace level.</returns>
        public IEnumerable <string> GetItemIds(BrowseType type, string filterCriteria, VarEnum dataTypeFilter, int accessRightsFilter)
        {
            IEnumString enumerator;

            browseServerSpace.BrowseOPCItemIDs(
                type,
                filterCriteria,
                (short)dataTypeFilter,
                accessRightsFilter,
                out enumerator);

            try
            {
                enumerator.Reset();
                var itemBlock = new Queue <string>(blockSize);
                while (true)
                {
                    if (itemBlock.Count == 0)
                    {
                        var  itemIds = new string[blockSize];
                        uint fetched;
                        var  res = enumerator.Next((uint)blockSize, itemIds, out fetched);
                        if (res > 1)
                        {
                            Marshal.ThrowExceptionForHR(res);
                        }
                        for (var i = 0; i < fetched; i++)
                        {
                            itemBlock.Enqueue(itemIds[i]);
                        }
                    }

                    if (itemBlock.Count == 0)
                    {
                        break;
                    }

                    yield return(itemBlock.Dequeue());
                }
            }
            finally
            {
                if (enumerator != null)
                {
                    Marshal.ReleaseComObject(enumerator);
                }
            }
        }
예제 #19
0
        public Form ShowFreeLayout()
        {
            if (!BaseWinFramework.CheckModuleAccessWithError(ModuleName,
                                                             SecurityVarName.ReportView, true))
            {
                return(null);
            }

            using (new WaitCursor())
            {
                if (!TypeChecked)
                {
                    CheckEntityType();
                }

                if (_UIN != null)
                {
                    IRuleInitUI riu = (IRuleInitUI)_UIN.Entity;
                    _DataFilter   = riu.GetBrowseFilter();
                    BrowseColumns = riu.GetBrowseColumns();
                    riu.GetBrowseSql(out BrowseSql, out BrowseCondition, out BrowseOrder);
                    BrowseFormat.Clear();
                    riu.GetBrowseFormat(BrowseFormat);
                }

                if (_BrowseForm == null || _BrowseForm.IsDisposed ||
                    _BrowseType != BrowseType.FreeLayout)
                {
                    if (BaseWinFramework.mdiRibbonControl != null)
                    {
                        _BrowseForm = new frmFreeReport();
                    }
                    else
                    {
                        _BrowseForm = new frmFreeReport2();
                    }

                    _BrowseForm.MdiParent = BaseWinFramework._MdiParent;
                    ((IFreeReport)_BrowseForm).ShowForm(this, ModuleName);
                    _BrowseType = BrowseType.FreeLayout;
                }
                else
                {
                    _BrowseForm.BringToFront();
                }
                return(_BrowseForm);
            }
        }
예제 #20
0
 private object CreateEnumerator(BrowseType browseType, string browseFilter)
 {
     OPCAEBROWSETYPE dwBrowseFilterType = OpcCom.Ae.Interop.GetBrowseType(browseType);
     IEnumString ppIEnumString = null;
     try
     {
         ((IOPCEventAreaBrowser) this.m_browser).BrowseOPCAreas(dwBrowseFilterType, (browseFilter != null) ? browseFilter : "", out ppIEnumString);
     }
     catch (Exception exception)
     {
         throw OpcCom.Interop.CreateException("IOPCEventAreaBrowser.BrowseOPCAreas", exception);
     }
     if (ppIEnumString == null)
     {
         throw new InvalidResponseException("enumerator == null");
     }
     return ppIEnumString;
 }
예제 #21
0
        public Form ShowFreeLayout(string FreeFilter,
                                   object TransStartDate, object TransEndDate,
                                   params object[] Parameters)
        {
            if (!BaseWinFramework.CheckModuleAccessWithError(ModuleName,
                                                             SecurityVarName.ReportView, true))
            {
                return(null);
            }

            using (new WaitCursor())
            {
                if (!TypeChecked)
                {
                    CheckEntityType();
                }

                if (_BrowseForm == null || _BrowseForm.IsDisposed ||
                    _BrowseType != BrowseType.FreeLayout)
                {
                    if (BaseWinFramework.mdiRibbonControl != null)
                    {
                        _BrowseForm = new frmFreeReport();
                    }
                    else
                    {
                        _BrowseForm = new frmFreeReport2();
                    }

                    _BrowseForm.MdiParent = BaseWinFramework._MdiParent;
                    _BrowseType           = BrowseType.FreeLayout;
                    ((IFreeReport)_BrowseForm).ShowForm2(this, ModuleName,
                                                         FreeFilter, TransStartDate, TransEndDate, Parameters);
                }
                else
                {
                    ((IFreeReport)_BrowseForm).ShowForm3(
                        FreeFilter, TransStartDate, TransEndDate, Parameters);
                }
                return(_BrowseForm);
            }
        }
예제 #22
0
        public ContentBaseViewModel(IList <T> items, T current, BrowseType type, string title)
        {
            this.Items        = items;
            this.Current      = current;
            this.currentIndex = items.IndexOf(current);
            CurrentTitle      = title;
            switch (type)
            {
            case BrowseType.Browser:
                this.SelectedIndex = 0;
                break;

            case BrowseType.Info:
                this.SelectedIndex = 1;
                break;

            default:
                break;
            }
        }
        /// <summary>
        /// Retrieves enumerator of current branch.
        /// </summary>
        /// <param name="type">Namespace browse mode. See <see cref="BrowseType"/></param>
        /// <param name="filterCriteria">Mask of item/folder name.</param>
        /// <param name="dataTypeFilter">Filter by type.</param>
        /// <param name="accessRightsFilter">Filter by access rights.</param>
        /// <returns>Enumerator of current namespace level.</returns>
		public IEnumerable<string> GetItemIds(BrowseType type, string filterCriteria, VarEnum dataTypeFilter, int accessRightsFilter)
		{
            IEnumString enumerator;
			browseServerSpace.BrowseOPCItemIDs(
				type, 
				filterCriteria,
                (short)dataTypeFilter, 
				accessRightsFilter, 
				out enumerator);								

			try
			{
				enumerator.Reset();
			    var itemBlock = new Queue<string>(blockSize);
				while(true)
				{
				    if (itemBlock.Count == 0)
				    {
                        var itemIds = new string[blockSize];
                        uint fetched;
                        var res = enumerator.Next((uint)blockSize, itemIds, out fetched);
                        if (res > 1)
                            Marshal.ThrowExceptionForHR(res);
                        for(var i = 0; i < fetched; i++)
                            itemBlock.Enqueue(itemIds[i]);
                    }

                    if (itemBlock.Count == 0)
						break;

                    yield return itemBlock.Dequeue();					
				}            
			}
			finally
			{
				if(enumerator != null)
					Marshal.ReleaseComObject(enumerator);
			}
		}
예제 #24
0
        public string GetAspxUrl()
        {
            string     text       = "/article/node.aspx?nid=" + this.AutoID.ToString();
            BrowseType browseType = (BrowseType)Enum.Parse(typeof(BrowseType), ConfigProvider.Configs.BrowseType);
            string     str        = string.IsNullOrEmpty(this.UrlRewriteName) ? this.AutoID.ToString() : this.UrlRewriteName;

            switch (browseType)
            {
            case BrowseType.UrlRewriteAndAspx:
                text = "/article/" + str + ".aspx";
                break;

            case BrowseType.UrlRewriteNoAspx:
                text = "/article/" + str;
                break;

            case BrowseType.HtmlRewrite:
                text = "/article/" + str + ".html";
                break;
            }
            return(text.Replace("//", "/"));
        }
예제 #25
0
 public BrowseElement[] Browse(string areaID, BrowseType browseType, string browseFilter, int maxElements, out IBrowsePosition position)
 {
     position = null;
     lock (this)
     {
         if (base.m_server == null)
         {
             throw new NotConnectedException();
         }
         this.InitializeBrowser();
         this.ChangeBrowsePosition(areaID);
         UCOMIEnumString enumerator = (UCOMIEnumString) this.CreateEnumerator(browseType, browseFilter);
         ArrayList elements = new ArrayList();
         if (this.FetchElements(browseType, maxElements, enumerator, elements) != 0)
         {
             OpcCom.Interop.ReleaseServer(enumerator);
         }
         else
         {
             position = new OpcCom.Ae.BrowsePosition(areaID, browseType, browseFilter, enumerator);
         }
         return (BrowseElement[]) elements.ToArray(typeof(BrowseElement));
     }
 }
예제 #26
0
        /// <summary>
        /// Browse artist, album or track info.
        /// </summary>
        /// <param name="type">Type of media to browse for.</param>
        /// <param name="id">A 32-character hex string or a Spotify URI.</param>
        /// <returns></returns>
        private object Browse(BrowseType type, string id)
        {
            if (id.Length != 32 && !Hex.IsHex(id))
            {
                try
                {
                    Link link = Link.Create(id);

                    if ((type == BrowseType.ARTIST && !link.IsArtistLink) ||
                       (type == BrowseType.ALBUM && !link.IsAlbumLink) ||
                       (type == BrowseType.TRACK && !link.IsTrackLink))
                    {
                        throw new ArgumentException("Browse type doesn't match given Spotify URI.");
                    }

                    id = link.Id;
                }
                catch (InvalidSpotifyURIException)
                {
                    throw new ArgumentException("Given id is neither a 32-character hex string nor a valid Spotify URI.");
                }
            }

            /* Create channel callback. */
            ChannelCallback listener = new ChannelCallback();

            /* Send browse request. */
            try
            {
                this.protocol.SendBrowseRequest(listener, (int)type, id);
            }
            catch (ProtocolException)
            {
                return null;
            }
            return XMLMediaParser.Parse(listener.Get(this.Timeout));
        }
예제 #27
0
 public BrowsePosition(string areaID, BrowseType browseType, string browseFilter, IEnumString enumerator)
     : base(areaID, browseType, browseFilter)
 {
     m_enumerator = enumerator;
 }
예제 #28
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="t"></param>
 /// <param name="path"></param>
 public ConfigurablePath(BrowseType t, string path) : base(path)
 {
     DialogType = t;
 }
예제 #29
0
 public IEnumerable <string> BrowseItems(BrowseType browseType, string tagName, DataType dataType)
 {
     lock (SyncRoot)
     {
         if (_list.Count == 0)
         {
             yield break;
         }
         int len = _list.Count;
         if (itemList == null)
         {
             itemList = new string[len];
             for (int i = 0; i < len; i++)
             {
                 itemList[i] = _list[i].Name;
             }
             Array.Sort(itemList);
         }
         int    ii     = 0;
         bool   hasTag = !string.IsNullOrEmpty(tagName);
         bool   first  = true;
         string str    = hasTag ? tagName + SPLITCHAR : string.Empty;
         if (hasTag)
         {
             ii = Array.BinarySearch(itemList, tagName);
             if (ii < 0)
             {
                 first = false;
             }
             //int strLen = str.Length;
             ii = Array.BinarySearch(itemList, str);
             if (ii < 0)
             {
                 ii = ~ii;
             }
         }
         //while (++i < len && temp.Length >= strLen && temp.Substring(0, strLen) == str)
         do
         {
             if (first && hasTag)
             {
                 first = false;
                 yield return(tagName);
             }
             string temp = itemList[ii];
             if (hasTag && !temp.StartsWith(str, StringComparison.Ordinal))
             {
                 break;
             }
             if (dataType == DataType.NONE || _mapping[temp].Address.VarType == dataType)
             {
                 bool b3 = true;
                 if (browseType != BrowseType.Flat)
                 {
                     string curr  = temp + SPLITCHAR;
                     int    index = Array.BinarySearch(itemList, ii, len - ii, curr);
                     if (index < 0)
                     {
                         index = ~index;
                     }
                     b3 = itemList[index].StartsWith(curr, StringComparison.Ordinal);
                     if (browseType == BrowseType.Leaf)
                     {
                         b3 = !b3;
                     }
                 }
                 if (b3)
                 {
                     yield return(temp);
                 }
             }
         } while (++ii < len);
     }
 }
예제 #30
0
    private void QueryRecordMainFromToolbar(string s_Code, BrowseType bt)
    {
        #region

        try
        {

            BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
            ArrayList ParameterList = new ArrayList();


            #region 查詢指定之CODE
            ParameterList.Clear();
            ParameterList.Add(txt_CODE.Text);
            ParameterList.Add(slp_STORE.Text);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(bt.ToString());
            string strCodeWanted = "";
            strCodeWanted = bco.QueryRecordMainByTool(ParameterList);
            #endregion

            #region 查詢條件設定
            ParameterList.Clear();
            ParameterList.Add(null);
            ParameterList.Add(strCodeWanted);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(DateTime.Now);
            #endregion

            #region 取得查詢資料

            DataSet ds_Return = new DataSet();

            ds_Return = bco.QueryCRMRecordByFind2(ParameterList);

            if (ds_Return.Tables.Count == 0)
            {//沒查到資料

                System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('查無資料')", true);

                #region 設定頁面模式

                this.hid_Page_Status.Value = "QUERY";
                this.txt_Page_Status.Text = "QUERY";

                #endregion

                return;
            }
            else
            {//有查到資料

                #region 使用XML放置到前端資料

                #region 將空白的資料做處理
                GetDataSetBeforeSaveXML(ref ds_Return);
                #endregion


                xml_OLDData.InnerHtml = ds_Return.GetXml();

                #endregion

                #region 設定各個欄位


                this.slp_Up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
                this.slp_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
                this.txt_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
                this.slp_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市

                this.slp_Up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToShortDateString();//處理日期
                this.txt_ANSWER_TIME.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
                this.slp_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員
                this.slp_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
                this.txt_ROUTD_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
                this.txt_ROUTD_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
                this.txt_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼

                this.txt_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
                this.txt_STORE_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼

                this.txt_STORE_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
                this.txt_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
                this.txt_DEAL_CONTENT.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"].ToString();//處理內容

                foreach (DataRow dRow in ds_Return.Tables["VDS_CRM_RECORD_DETL"].Rows)
                {
                    chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected = true;
                }

                #endregion

                #region 設定頁面模式

                this.hid_Page_Status.Value = "VIEW";
                this.txt_Page_Status.Text = "VIEW";

                #endregion

                #region 設定各欄位模式ReadOnly

                this.slp_Up_CHAN_NO.ReadOnly = true;
                this.slp_Z_O.ReadOnly = true;
                this.txt_CODE.ReadOnly = true;
                this.txt_CODE.CssClass = "readtxtbox";
                this.slp_STORE.ReadOnly = true;
                this.slp_Up_BUSDATE.ReadOnly = true;
                this.txt_ANSWER_TIME.ReadOnly = true;
                this.slp_SAL_ID.ReadOnly = true;
                this.slp_BUSUID.ReadOnly = true;
                this.txt_ROUTD_ID.ReadOnly = true;
                this.txt_ROUTD_ID.CssClass = "readtxtbox";
                this.txt_ROUTD_STEP.ReadOnly = true;
                this.txt_ROUTD_STEP.CssClass = "readtxtbox";
                this.txt_STORE_TEL_AREA.ReadOnly = true;
                this.txt_STORE_TEL_AREA.CssClass = "readtxtbox";
                this.txt_STORE_TEL_NO.ReadOnly = true;
                this.txt_STORE_TEL_NO.CssClass = "readtxtbox";
                this.txt_STORE_FAX_AREA.ReadOnly = true;
                this.txt_STORE_FAX_AREA.CssClass = "readtxtbox";
                this.txt_STORE_FAX_NO.ReadOnly = true;
                this.txt_STORE_FAX_NO.CssClass = "readtxtbox";
                this.txt_STORE_ADDRESS.ReadOnly = true;
                this.txt_STORE_ADDRESS.CssClass = "readtxtbox";
                this.txt_DEAL_CONTENT.ReadOnly = true;
                this.txt_DEAL_CONTENT.CssClass = "readtxtbox";
                this.chkbl_Detail.Enabled = false;

                #endregion

            }

            #endregion

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            GetPageDefault();
        }
        #endregion
    }
예제 #31
0
 public Browse(string startupPath, BrowseType type, params string[] extensions) : this(startupPath, type, null, extensions)
 {
 }
예제 #32
0
 public Browse(BrowseType type, params string[] extensions) : this(Directory.GetCurrentDirectory(), type, null, extensions)
 {
 }
예제 #33
0
 public CIS_BrowsePath()
 {
     this.InitializeComponent();
     this.Validation       = DataValidation.None;
     this.BrowseDialogType = BrowseType.File;
 }
예제 #34
0
 /// <summary>
 /// /
 /// </summary>
 /// <param name="type"></param>
 public void SetBrowseType(BrowseType type)
 {
     this.BrowseDialogType = type;
 }