예제 #1
0
        public PDFLayerview(IntPtr ptHandler)
        {
            InitializeComponent();
            InitializePublishers();
            new WindowInteropHelper(this).Owner = ptHandler;

            _pbarMaximumSubscriber = new SSDLPlotingSubscriber <double>(SSDLPlotingPublisher.ProgressBarMaximumPublisher);
            _pbarMaximumSubscriber.Publisher.DataPublisher += Publisher_MaximumDataPublisher;

            _pbarValueSubscriber = new SSDLPlotingSubscriber <double>(SSDLPlotingPublisher.ProgressValuePublisher);
            _pbarValueSubscriber.Publisher.DataPublisher += Publisher_ValueDataPublisher;

            _pbarStatusSubscriber = new SSDLPlotingSubscriber <string>(SSDLPlotingPublisher.ProgressStatusPublisher);
            _pbarStatusSubscriber.Publisher.DataPublisher += Publisher_StatusDataPublisher;

            _pbarHeaderSubscriber = new SSDLPlotingSubscriber <string>(SSDLPlotingPublisher.ProgressHeaderPublisher);
            _pbarHeaderSubscriber.Publisher.DataPublisher += Publisher_HeaderDataPublisher;

            Layerlisodwg = new System.Collections.ObjectModel.ObservableCollection <Layerlist>(AcadFunctions.GetLayerlist());
            IniFile getpath = new IniFile(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Settings.ini"));

            _pdfLocation = getpath.IniReadValue("FilePath", "PDFOUTPUT_PATH");
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Layerlisodwg = new System.Collections.ObjectModel.ObservableCollection <Layerlist>(AcadFunctions.GetLayerlist());



            System.Data.DataTable dt = DatabaseClass.GetTimeRollupCategories();

            List <View.clsTimeRollUp> _col = new List <View.clsTimeRollUp>();

            foreach (DataRow dr in dt.Rows)
            {
                int time = 0;
                if (dr["fldTimeAllocated"] != null)
                {
                    if (!string.IsNullOrEmpty(dr["fldTimeAllocated"].ToString()))
                    {
                        time = Convert.ToInt32(dr["fldTimeAllocated"].ToString());
                    }
                }
                _col.Add(new View.clsTimeRollUp()
                {
                    include = false, Category = dr["fldCategory"].ToString(), Time = time
                });
            }
            System.Collections.ObjectModel.ObservableCollection <View.clsTimeRollUp> myCollection = new System.Collections.ObjectModel.ObservableCollection <View.clsTimeRollUp>(_col as List <View.clsTimeRollUp>);
            timeRollupCol = myCollection;

            textBoxdesc.MaxLength = maxAllowed;
            updateRemainingChars();
            dgvTimeRollup.ItemsSource = timeRollupCol;
            //---------------Added by Sundari on 1-11-2018
            BOM od = new BOM();

            System.Data.DataTable dtnew      = od.Get_Drawingdata(updateDwgAttr: false);
            System.Data.DataTable dtnewExcel = new System.Data.DataTable();
            if (dtnew.Rows.Count > 0)
            {
                dtnewExcel = dtnew.DefaultView.ToTable(false, "Partno", "Description", "Timerollup", "SurfaceArea");
            }
            string tempSum = (dtnewExcel.Rows.Count > 0) ? dtnewExcel.AsEnumerable().Sum(x => Convert.ToDouble(x["Timerollup"])).ToString() : "0";

            totalTimeFromDwg = Convert.ToDouble(tempSum);
            //--------------------------
            calcTotal();

            dgvLayerlist.ItemsSource = Layerlisodwg.Where(x => x.LayerName.StartsWith("PAGE", StringComparison.InvariantCultureIgnoreCase)).ToList();
            dgvLayerlist.Items.Refresh();
        }