예제 #1
0
 private void LstFiles_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         TreeViewItem item = foldersItem.SelectedItem as TreeViewItem;
         if (LstFiles.SelectedIndex == -1)
         {
             return;
         }
         string openpath = (string)item.Tag + "\\" + LstFiles.SelectedItem;
         AcadFunctions.OpenDrawing(openpath);
         this.Close();
     }
     catch { }
 }
예제 #2
0
 private void openDwg()
 {
     try
     {
         TreeViewItem item = foldersItem.SelectedItem as TreeViewItem;
         if (LstFiles.SelectedIndex == -1)
         {
             return;
         }
         string openpath = (string)item.Tag + "\\" + LstFiles.SelectedItem;
         AcadFunctions.OpenDrawing(openpath);
         BtnClose_Click(null, null);
     }
     catch { }
 }
예제 #3
0
        private void LstFiles_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string partno;
            string qty, itemno, len;

            try
            {
                TreeViewItem item = foldersItem.SelectedItem as TreeViewItem;
                if (LstFiles.SelectedItem != null && item != null)
                {
                    bool lenthcheck = false;
                    setPreviewImages(System.IO.Path.Combine((string)item.Tag, LstFiles.SelectedItem.ToString()));
                    AcadFunctions.ExtractObjectsFromFile(System.IO.Path.Combine((string)item.Tag, LstFiles.SelectedItem.ToString()), out partno, out qty, out itemno, out len, out lenthcheck);

                    TxtPartno.Text = partno;
                    //TxtItemno.Text = itemno.ToString();

                    Txtquantity.Value = 1;
                    // if (string.IsNullOrEmpty(qty))
                    // Txtquantity.Text = "";
                    // else
                    //  Txtquantity.Text = qty.ToString();

                    if (lenthcheck)
                    {
                        lbllen.Visibility = Visibility.Visible;
                        TxtLen.Visibility = Visibility.Visible;
                        TxtLen.Text       = len;
                    }
                    else
                    {
                        lbllen.Visibility = Visibility.Hidden;
                        TxtLen.Visibility = Visibility.Hidden;
                        TxtLen.Text       = "";
                    }
                }
                else
                {
                    Imageview();
                }
            }
            catch { }
        }
예제 #4
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");
        }
예제 #5
0
        //Insert
        private void BtnOpen_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(Txtquantity.Value.ToString()))
                {
                    MessageBox.Show("Enter Quantity");
                    return;
                }
                //else if (string.IsNullOrEmpty(TxtItemno.Text))
                //{
                //    MessageBox.Show("Enter Item No");
                //    return;
                //}
                try
                {
                    int qty = Convert.ToInt32(Txtquantity.Value.ToString());
                    if (qty <= 0)
                    {
                        MessageBox.Show("Enter Valid Quantity");
                        return;
                    }
                }
                catch
                {
                    MessageBox.Show("Enter Valid Quantity");
                    return;
                }

                //try
                //{
                //    int qty = Convert.ToInt32(TxtItemno.Text);
                //    if (qty <= 0)
                //    {
                //        MessageBox.Show("Enter Valid Item No");
                //        return;
                //    }
                //}
                //catch
                //{
                //    MessageBox.Show("Enter Valid Item No");
                //    return;
                //}

                if (TxtLen.Visibility == Visibility.Visible)
                {
                    try
                    {
                        double qty = Convert.ToDouble(TxtLen.Text);
                        if (qty <= 0)
                        {
                            MessageBox.Show("Enter Valid Length");
                            return;
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Enter Valid Length");
                        return;
                    }
                }



                TreeViewItem item = foldersItem.SelectedItem as TreeViewItem;
                if (item != null)
                {
                    if (LstFiles.SelectedIndex == -1)
                    {
                        return;
                    }
                    if (LstFiles.SelectedItem.ToString().StartsWith("No Record", StringComparison.InvariantCultureIgnoreCase))
                    {
                        return;
                    }

                    string openpath = (string)item.Tag + "\\" + LstFiles.SelectedItem;
                    AcadFunctions.InsertBlk(openpath, TxtPartno.Text, Txtquantity.Value.ToString(), TxtItemno.Text, TxtLen.Text);
                    //this.Close();
                }
            }
            catch { }

            // CLOSE_SYMBOL_DIALOG_AFTER_INSERTION = yes
            //IniFile getpath = new IniFile(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Settings.ini"));
            //string checkresult = getpath.IniReadValue("FilePath", "CLOSE_SYMBOL_DIALOG_AFTER_INSERTION");

            // if (checkresult.Equals("YES", StringComparison.InvariantCultureIgnoreCase))
            if (chkclosewindow.IsChecked == true)
            {
                this.Close();
            }
        }
예제 #6
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();
        }