private void Edit_Profile_Load(object sender, EventArgs e)
        {
            DataShow ds = new DataShow();

            String[] result = ds.datashow(username);

            textBox_name.Text        = result[0];
            textBox_username.Text    = result[1];
            textBox_designation.Text = result[2];
            textBox_phonenumber.Text = result[3];
            textBox_email.Text       = result[4];
            richTextBox_address.Text = result[5];
            String dateOfBirth = result[6];

            String[] token = dateOfBirth.Split();
            comboBox_date.Text  = token[0];
            comboBox_month.Text = token[1];
            comboBox_year.Text  = token[2];
            String gender = result[7];

            if (gender.Equals("Male"))
            {
                radioButton_male.Checked = true;
            }

            else
            {
                radioButton_female.Checked = true;
            }
        }
Пример #2
0
        private void 生产ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CloseForm();
            Control frm;

            if (!dictform.ContainsKey("MoMForm"))
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable data = sqlSelectTable.GetMom();
                frm = new ChildrenForm(data);
                var client = frm as ChildrenForm;
                client.SetScrDataGrid();
                client.CellDouble += new CellDoubleClickHandler((col, dr) => {
                    this.Cursor = Cursors.WaitCursor;
                    if (dr[col] != null && !dr["项目编码"].Equals(""))
                    {
                        data = sqlSelectTable.GetMom_moallocate(dr["项目编码"].ToString());
                    }
                    DataShow children = new DataShow(data);
                    children.Show();
                    this.Cursor = Cursors.Default;
                });
                dictform.Add("MoMForm", frm);
                this.Cursor = Cursors.Default;
            }
            else
            {
                frm = dictform["MoMForm"];
            }
            OpenForm(frm);
        }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        lookAtMe = GameObject.Find("DataTag/AirConditioner").GetComponent <LookAtMe>();

        dataPanel = GameObject.Find("Canvas/DataChart").GetComponent <DataPanel>();

        dataShow = GameObject.Find("Canvas").GetComponent <DataShow>();
    }
    IEnumerator ReturnShowTag()
    {
        yield return(new WaitForSeconds(2.5f));

        //标签显示
        dataShow = transform.parent.GetComponent <DataShow>();
        dataShow.ShowPositionIn();
        mainCamera.GetComponent <CameraRotate>().enabled = true; //开启脚本
    }
Пример #5
0
 /// <summary>
 /// 表單載入事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Form1_Load(object sender, EventArgs e)
 {
     //顯示/隱藏按鈕
     EnableBtn(false);
     //設定Comport選項
     SetComport();
     //設定Slot通道選項
     SetSlotPassage();
     //建立委派的物件
     dataShow = new DataShow(ShowCMD);
     //輸入對話框聚焦
     TB_CmdToSend.Focus();
 }
Пример #6
0
        private void Profile_Load(object sender, EventArgs e)
        {
            DataShow ds = new DataShow();

            String[] result = ds.datashow(username);

            label_name.Text        = result[0];
            label_username.Text    = result[1];
            label_designation.Text = result[2];
            label_phoneno.Text     = result[3];
            label_email.Text       = result[4];
            label_address.Text     = result[5];
            label_dob.Text         = result[6];
            label_gender.Text      = result[7];
        }
Пример #7
0
 private void DataShow_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == DataShow.Columns["Install"].Index)
     {
         DataShow.EndEdit();  //Stop editing of cell.
         if ((bool)DataShow.Rows[e.RowIndex].Cells["Install"].Value)
         {
             MessageBox.Show("The Value is Checked", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("UnChecked", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Пример #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     DataShow.EndEdit();
     DataShow.CurrentCell = null;
     DataShow.Columns["Install"].Visible = false;
     for (int i = 0; i < DataShow.RowCount; i++)
     {
         if ((bool)DataShow.Rows[i].Cells["Install"].Value == false)
         {
             DataShow.Rows[i].Visible = false;
         }
     }
     ButtonReview.Visible  = false;
     ButtonInstall.Visible = true;
     ButtonBack.Visible    = true;
 }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     mainCamera       = Camera.main.gameObject;
     CDZTarget        = GameObject.FindWithTag("CDZTarget").transform;
     chongdianzhuang  = GameObject.FindWithTag("chongdianzhuang").GetComponent <Animation>();
     chongdianzhuang2 = GameObject.FindWithTag("chongdianzhuang2").GetComponent <Animation>();
     chongdianzhuang3 = GameObject.FindWithTag("chongdianzhuang3").GetComponent <Animation>();
     chepeng          = GameObject.Find("chepeng").transform;
     qiang            = GameObject.Find("qiang").transform;
     guangfuban       = GameObject.Find("guangfuban").transform;
     kongtiao         = GameObject.Find("kongtiao").transform;
     peidian          = GameObject.Find("peidian").transform;
     chuNeng          = GameObject.Find("chuNeng").transform;
     Target           = GameObject.Find("Target").transform;
     dataShow         = GameObject.Find("Canvas").GetComponent <DataShow>();
     dataPanel        = GameObject.Find("DataChart").GetComponent <DataPanel>();
 }
Пример #10
0
        private void FormReview_Load(object sender, EventArgs e)
        {
            Form_Review form_Review = null;

            if (!string.IsNullOrEmpty(_dbFilePath))
            {
                DataShow _ds = new DataShow();
                _ds.ShowInspectData(_dbFilePath, _pieceID, _lotID, _picFolder, _recipeID);
                form_Review = new Form_Review(_ds);
            }
            else
            {
                form_Review = new Form_Review();
            }
            form_Review.TopLevel = false;
            form_Review.Dock     = DockStyle.Fill;
            Controls.Add(form_Review);
            form_Review.Visible = true;
            form_Review.TopMost = true;
        }
Пример #11
0
        private void button_Edit_Click(object sender, EventArgs e)
        {
            DataShow ds     = new DataShow();
            String   dob    = comboBox_date.Text + " " + comboBox_month.Text + " " + comboBox_year.Text;
            String   gender = "";

            if (radioButton_male.Checked)
            {
                gender = "Male";
            }

            else
            {
                gender = "Female";
            }

            Edit ed = new Edit();

            username = ed.editData(textBox_username.Text, textBox_name.Text, textBox_designation.Text, textBox_email.Text, textBox_phonenumber.Text, richTextBox_address.Text, dob, gender);

            MessageBox.Show("Your Information is updated!!!");

            Edit_Profile_Load(sender, e);
        }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     dataShow = GameObject.Find("Canvas").GetComponent <DataShow>();
 }
Пример #13
0
        private void UpdateChartDatas()
        {
            if (!this.IsHandleCreated)
            {
                return;
            }
            this.BeginInvoke(new Action(() =>
            {
                var val = trackBar1.Value;

                var date1 = (DateTime.Now.AddDays(-val + 1)).ToString("yyyyMMdd");

                chart1.Series[0].Points.Clear();

                for (int pointIndex = 0; pointIndex < 24; pointIndex++)
                {
                    chart1.Series[0].Points.AddXY(dateTimeArray[pointIndex], DataShow[pointIndex]);
                }

                title1.Text = LengedTitle + ", Date:" + (DateTime.Now.AddDays(-val + 1)).ToString("MM-dd") + " ,Total:" + DataShow.Sum();
            }));
        }
Пример #14
0
        public static void Main(string[] args)
        {
            string printername = "";

            AssemblyResolver.HandleUnresolvedAssemblies();

#if REPMAN_DOTNET2
            // Bug in .Net 1.x, don't enable, but you can use a .manifest file
#if FORMS
            Application.EnableVisualStyles();
#endif
#endif
            bool dothrow = false;



            Report rp = new Report();
            try
            {
                bool   asyncexecution  = true;
                bool   stdin           = false;
                bool   pdf             = false;
                bool   metafile        = false;
                bool   showprintdialog = false;
                string filename        = "";
                string pdffilename     = "";
                string fieldsfilename  = "";
                bool   deletereport    = false;
                bool   showprogress    = false;
                bool   preview         = false;
                bool   showparams      = false;
                bool   compressedpdf   = true;
                bool   systempreview   = false;
                bool   showdata        = false;
                bool   showfields      = false;
                bool   testconnection  = false;
                string connectionname  = "";
                bool   doprint         = true;
                bool   evaluatetext    = false;
                bool   syntaxcheck     = false;
                bool   doread          = true;
                string evaltext        = "";
                string dataset         = "";
                SortedList <string, string> ParamValues = new SortedList <string, string>();
#if REPMAN_DOTNET2
                bool   showproviders     = false;
                string providersfilename = "";
#endif
                try
                {
                    for (int i = 0; i < args.Length; i++)
                    {
                        if (args[i].Trim().Length > 0)
                        {
                            switch (args[i].ToUpper())
                            {
                            case "-STDIN":
                                stdin = true;
                                break;

                            case "-PREVIEW":
                                preview = true;
                                break;

                            case "-SHOWPARAMS":
                                showparams = true;
                                break;

                            case "-SYNCEXECUTION":
                                asyncexecution = false;
                                break;

                            case "-SYSTEMPREVIEW":
                                systempreview = true;
                                break;

                            case "-U":
                                compressedpdf = false;
                                break;

                            case "-THROW":
                                dothrow = true;
                                break;

                            case "-PDF":
                                pdf = true;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    pdffilename = args[i];
                                }
                                break;

                            case "-M":
                                metafile = true;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    pdffilename = args[i];
                                }
                                break;

                            case "-SHOWDATA":
                                showdata = true;
                                doprint  = false;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    dataset = args[i];
                                }
                                break;

                            case "-TESTCONNECTION":
                                doprint        = false;
                                testconnection = true;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    connectionname = args[i];
                                }
                                break;

                            case "-EVAL":
                                doprint      = false;
                                evaluatetext = true;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    evaltext = args[i];
                                }
                                break;

                            case "-SYNTAX":
                                doprint     = false;
                                syntaxcheck = true;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    evaltext = args[i];
                                }
                                break;

                            case "-SHOWFIELDS":
                                showfields = true;
                                doprint    = false;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    dataset = args[i];
                                }
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    fieldsfilename = args[i];
                                }
                                break;

                            case "-GETPROVIDERS":
                                showproviders = true;
                                doprint       = false;
                                doread        = false;
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    providersfilename = args[i];
                                }
                                break;

                            case "-GETPRINTERS":
                                System.Text.StringBuilder nprinters = new System.Text.StringBuilder();
                                nprinters.AppendLine("Installed printers:");
                                foreach (string pname in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
                                {
                                    nprinters.AppendLine(pname);
                                }
#if FORMS
                                MessageBox.Show(nprinters.ToString());
#else
                                System.Console.WriteLine(nprinters.ToString());
#endif
                                break;

                            case "-PRINTERNAME":
                                if (args.GetUpperBound(0) > i)
                                {
                                    i++;
                                    printername = args[i];
                                }
                                else
                                {
                                    throw new Exception("A printer name must be provided after -printername");
                                }
                                break;

                            case "-SHOWPROGRESS":
                                showprogress = true;
                                break;

                            case "-DELETEREPORT":
                                deletereport = true;
                                break;

                            case "-PRINTDIALOG":
                                showprintdialog = true;
                                break;

                            default:
                                // Get parameter names and values
                                string argname = args[i];
                                if (argname[0] == '-')
                                {
                                    bool correctparam = false;
                                    if (argname.Length > 7)
                                    {
                                        if (argname.Substring(0, 6).ToUpper() == "-PARAM")
                                        {
                                            argname = argname.Substring(6, argname.Length - 6);
                                            int indexequ = argname.IndexOf('=');
                                            if (indexequ < 0)
                                            {
                                                throw new Exception("Invalid syntax in -param, -paramPARAMNAME=value syntax must be used");
                                            }
                                            string paramvalue = argname.Substring(indexequ + 1, argname.Length - indexequ - 1);
                                            argname = argname.Substring(0, indexequ);
                                            ParamValues.Add(argname, paramvalue);
                                            System.Console.WriteLine("Decoded parameter: " + argname + " value " + paramvalue);
                                            correctparam = true;
                                        }
                                    }
                                    if (!correctparam)
                                    {
                                        throw new Exception("Invalid argument:" + args[i]);
                                    }
                                }
                                else
                                {
                                    if (filename.Length > 0)
                                    {
                                        filename = args[i];
                                    }
                                    else
                                    {
                                        filename = args[i];
                                    }
                                }
                                break;
                            }
                        }
                    }
                    AddCustomFactories();

#if REPMAN_DOTNET2
                    if (showproviders)
                    {
                        string messageproviders = "";

/*#if REPMAN_MONO
 *                                              if (providersfilename.Length == 0)
 *                                              {
 *                                                      foreach (Provider p in ProviderFactory.Providers)
 *                                                      {
 *                                                              if (messageproviders.Length!=0)
 *                                                                      messageproviders=messageproviders+(char)13+(char)10;
 *                                                              messageproviders=messageproviders+p.Name;
 *
 *                                                      }
 *                                                      MessageBox.Show(messageproviders,"Data providers");
 *                                              }
 *                                              else
 *                                              {
 *                                                      FileStream providersstream = new FileStream(providersfilename,System.IO.FileMode.Create,System.IO.FileAccess.Write,System.IO.FileShare.None);
 *                                                      try
 *                                                      {
 *                                                              foreach (Provider p2 in ProviderFactory.Providers)
 *                                                              {
 *                                                                      StreamUtil.SWriteLine(providersstream,p2.Name);
 *                                                              }
 *                                                      }
 *                                                      finally
 *                                                      {
 *                                                              providersstream.Close();
 *                                                      }
 *
 *                                              }
 #else*/
                        int       indexp;
                        DataTable atable = DbProviderFactories.GetFactoryClasses();
                        if (providersfilename.Length == 0)
                        {
                            bool firebirdfound = false;
                            bool mysqlfound    = false;
                            bool sqlitefound   = false;
                            for (indexp = 0; indexp < atable.Rows.Count; indexp++)
                            {
                                if (messageproviders.Length != 0)
                                {
                                    messageproviders = messageproviders + (char)13 + (char)10;
                                }
                                string nprovider = atable.Rows[indexp][2].ToString();
                                if (nprovider == DatabaseInfo.FIREBIRD_PROVIDER)
                                {
                                    firebirdfound = true;
                                }
                                if (nprovider == DatabaseInfo.MYSQL_PROVIDER)
                                {
                                    mysqlfound = true;
                                }
                                if (nprovider == DatabaseInfo.SQLITE_PROVIDER)
                                {
                                    sqlitefound = true;
                                }
                                messageproviders = messageproviders + atable.Rows[indexp][2].ToString();
                            }
                            if (!firebirdfound)
                            {
                                messageproviders = DatabaseInfo.FIREBIRD_PROVIDER + (char)13 + (char)10 + messageproviders;
                            }
                            if (!mysqlfound)
                            {
                                messageproviders = DatabaseInfo.MYSQL_PROVIDER + (char)13 + (char)10 + messageproviders;
                            }
                            if (!sqlitefound)
                            {
                                messageproviders = DatabaseInfo.SQLITE_PROVIDER + (char)13 + (char)10 + messageproviders;
                            }
#if FORMS
                            MessageBox.Show(messageproviders, "Data providers");
#else
                            System.Console.WriteLine("Data providers");
                            System.Console.WriteLine(messageproviders);
#endif
                        }
                        else
                        {
                            FileStream providersstream = new FileStream(providersfilename, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None);
                            try
                            {
                                bool    firebirdfound = false;
                                bool    mysqlfound    = false;
                                bool    sqlitefound   = false;
                                Strings nstrings      = new Strings();
                                for (indexp = 0; indexp < atable.Rows.Count; indexp++)
                                {
                                    string nprovider = atable.Rows[indexp][2].ToString();
                                    if (nprovider == DatabaseInfo.FIREBIRD_PROVIDER)
                                    {
                                        firebirdfound = true;
                                    }
                                    if (nprovider == DatabaseInfo.MYSQL_PROVIDER)
                                    {
                                        mysqlfound = true;
                                    }
                                    if (nprovider == DatabaseInfo.SQLITE_PROVIDER)
                                    {
                                        sqlitefound = true;
                                    }
                                    nstrings.Add(nprovider);
                                }
                                if (!firebirdfound)
                                {
                                    nstrings.Insert(0, DatabaseInfo.FIREBIRD_PROVIDER);
                                }
                                if (!mysqlfound)
                                {
                                    nstrings.Insert(0, DatabaseInfo.MYSQL_PROVIDER);
                                }
                                if (!sqlitefound)
                                {
                                    nstrings.Insert(0, DatabaseInfo.SQLITE_PROVIDER);
                                }

                                foreach (string nstring in nstrings)
                                {
                                    StreamUtil.SWriteLine(providersstream, nstring);
                                }
                            }
                            finally
                            {
                                providersstream.Close();
                            }
                        }
//#endif
                    }
#endif
                    if (doread)
                    {
                        if (stdin)
                        {
                            Stream astream = System.Console.OpenStandardInput();
                            rp.LoadFromStream(astream, 8192);
                        }
                        else
                        {
                            if (filename.Length == 0)
                            {
                                throw new Exception("You must provide a report filename");
                            }
                            rp.LoadFromFile(filename);
                        }

                        foreach (string nparamname in ParamValues.Keys)
                        {
                            string nvalue = ParamValues[nparamname];
                            if (rp.Params.IndexOf(nparamname) < 0)
                            {
                                System.Console.WriteLine("Warning: parameter not found created: " + nparamname);
                                Reportman.Reporting.Param xparam = new Reportman.Reporting.Param(rp);
                                xparam.Alias   = nparamname;
                                xparam.Visible = false;
                                rp.Params.Add(xparam);
                                //throw new Exception("Parameter " + nparamname + " not found");
                            }
                            rp.Params[nparamname].Value = nvalue;
                        }
                    }
                    if (showdata)
                    {
                        rp.PrintOnlyIfDataAvailable = false;
                        PrintOutPDF printpdf3 = new PrintOutPDF();
                        rp.BeginPrint(printpdf3);
#if FORMS
                        DataShow.ShowData(rp, dataset);
#else
                        rp.DataInfo[dataset].Connect();
                        ReportDataset ndataset = rp.DataInfo[dataset].Data;
                        foreach (DataColumn ncol in ndataset.Columns)
                        {
                            string nstring = ncol.ColumnName.PadLeft(30);
                            if (nstring.Length > 30)
                            {
                                nstring = nstring.Substring(0, 30);
                            }
                            System.Console.Write(nstring);
                        }
                        System.Console.WriteLine();
                        while (!ndataset.Eof)
                        {
                            foreach (DataColumn ncol in ndataset.Columns)
                            {
                                string nstring = ndataset.CurrentRow[ncol.ColumnName].ToString().PadLeft(30);
                                if (nstring.Length > 30)
                                {
                                    nstring = nstring.Substring(0, 30);
                                }
                                System.Console.Write(nstring);
                            }
                            System.Console.WriteLine();
                            ndataset.Next();
                        }
#endif
                    }
                    if (testconnection)
                    {
                        int conindex = rp.DatabaseInfo.IndexOf(connectionname);
                        if (conindex < 0)
                        {
                            throw new Exception("Connection name not found:" + connectionname);
                        }
                        rp.DatabaseInfo[conindex].Connect();
#if FORMS
                        MessageBox.Show("Connexion successfull:" + connectionname);
#else
                        System.Console.WriteLine("Connexion successfull:" + connectionname);
#endif
                    }
                    if (showfields)
                    {
                        int index = rp.DataInfo.IndexOf(dataset);
                        if (index < 0)
                        {
                            throw new Exception("Dataset not found:" + dataset);
                        }
                        rp.DataInfo[index].Connect();
                        FileStream fstream = new FileStream(fieldsfilename,
                                                            System.IO.FileMode.Create, System.IO.FileAccess.Write,
                                                            System.IO.FileShare.None);
                        try
                        {
                            rp.DataInfo[index].GetFieldsInfo(fstream);
                        }
                        finally
                        {
                            fstream.Close();
                        }
                    }
                    if ((evaluatetext) || (syntaxcheck))
                    {
                        rp.PrintOnlyIfDataAvailable = false;
                        PrintOutPDF printpdf2 = new PrintOutPDF();
                        rp.BeginPrint(printpdf2);
                        if (evaluatetext)
                        {
                            try
                            {
                                Variant aresult = rp.Evaluator.EvaluateText(evaltext);
#if FORMS
                                MessageBox.Show("Result:" + aresult.ToString());
#else
                                System.Console.WriteLine("Result:" + aresult.ToString());
#endif
                            }

                            catch (EvalException e)
                            {
#if FORMS
                                MessageBox.Show("Error Line: " + e.SourceLine.ToString() +
                                                " Error position:" + e.SourcePos.ToString() + " - " + e.Message);
#else
                                System.Console.WriteLine("Error Line: " + e.SourceLine.ToString() +
                                                         " Error position:" + e.SourcePos.ToString() + " - " + e.Message);
#endif
                            }
                            catch (Exception E)
                            {
#if FORMS
                                MessageBox.Show("Error: " + E.Message);
#else
                                System.Console.WriteLine("Error: " + E.Message);
#endif
                            }
                        }
                        else
                        {
                            try
                            {
                                rp.Evaluator.CheckSyntax(evaltext);
#if FORMS
                                MessageBox.Show("Syntax check ok");
#else
                                System.Console.WriteLine("Syntax check ok");
#endif
                            }
                            catch (Exception E)
                            {
#if FORMS
                                MessageBox.Show("Error: " + E.Message);
#else
                                System.Console.WriteLine("Error: " + E.Message);
#endif
                            }
                        }
                    }
                    // Ask for parameters?
                    if (doprint)
                    {
                        if (showparams)
                        {
#if FORMS
                            doprint = ParamsForm.ShowParams(rp);
#else
                            throw new Exception("Show params not supported in console mode");
#endif
                        }
                    }
                    if (doprint)
                    {
                        if (showprogress)
#if FORMS
                        {
                            ReportProgressForm fprogres = new ReportProgressForm();
                            fprogres.SetMetaFile(rp.MetaFile);
                            fprogres.Show();
                        }
#else
                        { throw new Exception("Show progress not supported in console mode"); }
#endif
                        if (pdf)
                        {
                            rp.AsyncExecution = false;
                            PrintOutPDF printpdf = new PrintOutPDF();
                            printpdf.FileName   = pdffilename;
                            printpdf.Compressed = compressedpdf;
                            printpdf.Print(rp.MetaFile);
                        }
                        else
                        if (metafile)
                        {
                            rp.AsyncExecution = false;
                            rp.TwoPass        = true;
                            PrintOutPDF printpdf = new PrintOutPDF();
                            printpdf.FileName   = "";
                            printpdf.Compressed = compressedpdf;
                            printpdf.Print(rp.MetaFile);
                            rp.MetaFile.SaveToFile(pdffilename, compressedpdf);
                        }
                        else
                        {
                            rp.AsyncExecution = asyncexecution;
#if FORMS
                            PrintOutReportWinForms prw = new PrintOutReportWinForms(rp);
                            prw.Preview         = preview;
                            prw.ShowInTaskbar   = true;
                            prw.SystemPreview   = systempreview;
                            prw.ShowPrintDialog = showprintdialog;
                            prw.Print(rp.MetaFile);
#else
                            PrintOutPrint prw = new PrintOutPrint();
                            if (printername.Length > 0)
                            {
                                PrintOutNet.DefaultPrinterName = printername;
                            }

                            prw.Print(rp.MetaFile);
#endif

                            //                                PrintOutWinForms prw = new PrintOutWinForms();
                            //							prw.OptimizeWMF = WMFOptimization.Gdiplus;
                        }
                    }
                }
                finally
                {
                    if (deletereport)
                    {
                        if (filename.Length > 0)
                        {
                            System.IO.File.Delete(filename);
                        }
                    }
                }
            }
            catch (Exception E)
            {
                if (!dothrow)
                {
                    int    i;
                    string amessage = E.Message + (char)13 + (char)10;
                    for (i = 0; i < args.Length; i++)
                    {
                        amessage = amessage + (char)13 + (char)10 + "Arg" + i.ToString() + ":" + args[i];
                    }
                    Strings astrings = GetParams();
                    for (i = 0; i < astrings.Count; i++)
                    {
                        amessage = amessage + (char)13 + (char)10 + astrings[i];
                    }

#if FORMS
                    MessageBox.Show(amessage, "Error");
#else
                    System.Console.WriteLine(amessage);
#endif
                    System.Console.WriteLine(E.StackTrace);
                }
                else
                {
                    PrintParams();
                    throw;
                }
                //				Variant.WriteStringToUTF8Stream(amessage,System.Console.OpenStandardError());
            }
        }
Пример #15
0
        private void ButtonInstall_Click(object sender, EventArgs e)
        {
            string           DstFolder;
            List <ToInstall> InstallPaths = new List <ToInstall>();

            int ProgramsCopy = DataShow.DisplayedRowCount(true), Copied = 0, ProgramInstall = 0, Installed = 0;

            DataShow.Visible      = false;
            CopyStatus.Visible    = true;
            InstallStatus.Visible = true;
            ButtonBack.Visible    = false;
            ButtonInstall.Visible = false;
            TBoxStatus.Visible    = true;

            //check how many programs need to be installed
            foreach (DataGridViewRow Row in DataShow.Rows)
            {
                if ((string)Row.Cells["Type"].Value != "Portable" && Row.Visible == true)
                {
                    ProgramInstall++;
                }
            }
            int i = 0;

            //stay there untill
            while (ProgramInstall > Installed)
            {
                if (i < DataShow.RowCount)
                {
                    if (DataShow.Rows[i].Visible == true && (string)DataShow.Rows[i].Cells["Type"].Value == "Executable")
                    {
                        /*set the location to copy the files*/
                        //if this program is a folder
                        if (DataShow.Rows[i].Cells["Executable"].Value != System.DBNull.Value)
                        {
                            DstFolder = Environment.GetEnvironmentVariable("TEMP") + "\\AllInOne\\" + DataShow.Rows[i].Cells["Name"].Value;
                            CopyDirectory((string)DataShow.Rows[i].Cells["Path"].Value, DstFolder);
                            DstFolder = DstFolder + "\\" + DataShow.Rows[i].Cells["Executable"].Value;
                        }
                        //if this program is just one file
                        else
                        {
                            DstFolder = Environment.GetEnvironmentVariable("TEMP") + "\\AllInOne\\" + DataShow.Rows[i].Cells["Name"].Value;
                            if (!System.IO.Directory.Exists(DstFolder))
                            {
                                System.IO.Directory.CreateDirectory(DstFolder);
                            }
                            DstFolder = DstFolder + "\\" + Path.GetFileName((string)DataShow.Rows[i].Cells["Path"].Value);
                            System.IO.File.Copy((string)DataShow.Rows[i].Cells["Path"].Value, DstFolder, true);
                        }

                        // text.Replace("@", "@" + Environment.NewLine);
                        TBoxStatus.Text += DataShow.Rows[i].Cells["Name"].Value + "- Copied with success\r\n";
                        InstallPaths.Add(new ToInstall()
                        {
                            path = DstFolder, arguments = (string)DataShow.Rows[i].Cells["Arguments"].Value, name = (string)DataShow.Rows[i].Cells["Name"].Value
                        });
                        Copied++;
                    }
                    i++;
                }
                if (Installed < Copied && Variables.Installing == 0)
                {
                    Process p = new Process();
                    try
                    {
                        p.StartInfo.FileName  = InstallPaths[Installed].path;
                        p.Exited             += new EventHandler(p_Exited);
                        p.EnableRaisingEvents = true;
                        if (InstallPaths[Installed].arguments.Length > 1)
                        {
                            p.StartInfo.Arguments = InstallPaths[Installed].arguments;
                        }
                        Variables.Installing = 1;
                    }
                    catch
                    {
                        MessageBox.Show("Probelms to install" + InstallPaths[Installed].path);
                    }
                    Installed++;
                    p.Start();
                }
                CopyStatus.Text = "Copyied " + Copied + " of " + ProgramsCopy + "programs";           //counter to show the status of copy
                CopyStatus.Refresh();
                InstallStatus.Text = "Installed " + Installed + " of " + ProgramInstall + "programs"; //counter to show the status of copy
                InstallStatus.Refresh();
            }
            i = 0;
            //if there is portable programs to copy
            while (Copied < ProgramsCopy)
            {
                if (i < DataShow.RowCount)
                {
                    if (DataShow.Rows[i].Visible == true && (string)DataShow.Rows[i].Cells["Type"].Value == "Portable")
                    {
                        /*set the location to copy the files*/
                        //if this program is a folder
                        if (DataShow.Rows[i].Cells["Executable"].Value != System.DBNull.Value)
                        {
                            DstFolder = Environment.GetEnvironmentVariable("homepath") + "\\Desktop\\AllInOne\\" + DataShow.Rows[i].Cells["Name"].Value;
                            CopyDirectory((string)DataShow.Rows[i].Cells["Path"].Value, DstFolder);
                            DstFolder = DstFolder + "\\" + DataShow.Rows[i].Cells["Executable"].Value;
                        }
                        //if this program is just one file
                        else
                        {
                            DstFolder = Environment.GetEnvironmentVariable("homepath") + "\\Desktop\\AllInOne\\" + DataShow.Rows[i].Cells["Name"].Value;
                            if (!System.IO.Directory.Exists(DstFolder))
                            {
                                System.IO.Directory.CreateDirectory(DstFolder);
                            }
                            DstFolder = DstFolder + "\\" + Path.GetFileName((string)DataShow.Rows[i].Cells["Path"].Value);
                            System.IO.File.Copy((string)DataShow.Rows[i].Cells["Path"].Value, DstFolder, true);
                        }
                        TBoxStatus.Text += DataShow.Rows[i].Cells["Name"].Value + "- Copied with success\r\n";

                        Copied++;
                    }
                    i++;
                }
                CopyStatus.Text = "Copyied " + Copied + " of " + ProgramsCopy + "Programs";           //counter to show the status of copy
                CopyStatus.Refresh();
                InstallStatus.Text = "Installed " + Installed + " of " + ProgramInstall + "programs"; //counter to show the status of copy
                InstallStatus.Refresh();
            }
            MessageBox.Show("Complete Installation");
            ButtonReview.Visible  = true;
            DataShow.Visible      = true;
            InstallStatus.Visible = false;
            CopyStatus.Visible    = false;
            LoadData();
        }
Пример #16
0
        public static void Run()
        {
            try
            {
                if (BasicData.indexNum == 0)
                {
                    dataFiler = new DataFiler();
                }
                dataShow = new DataShow();
                if (dataFiler.IsGetData())
                {
                    dataFiler.GetData();
                    //dataFiler.SetColor();

                    dataShow.ToTable();
                    dataShow.UpdateLineLoc();

                    dataShow.ToZhongzhou();

                    dataShow.ToLong();
                    dataShow.ToOutMark();
                    //dataShow.UpLine();
                    dataShow.UpStar();
                    dataShow.UpCirMark();
                    dataShow.ToRixingtu();
                    dataShow.ToFengxiangtu();
                    dataShow.ToZoushitu();
                    dataShow.ToSignLight();
                    dataShow.ToSignZoushitu();
                    //dataShow.ToAllDoubleZST();
                    dataShow.UpdateSignnumState();
                }

                if (BasicData.indexNum == 0)
                {
                    foreach (TimeCountDown tcd in FMWarnTime.timeCountDown)
                    {
                        DataFiler.FindMoney(tcd.Name).wakeupList.Add(tcd.CountDown);
                    }
                    foreach (Money money in DataFiler.basicMoney)
                    {
                        if (money.wakeupList.Count != 0)
                        {
                            money.wakeupList.Sort();
                        }
                    }
                }


                //if (BasicData.indexNum == 2)
                //{
                //    dataShow.ToZoushitu();
                //    dataShow.ToFengxiangtu();
                //}

                dataShow.ToShortSuperNum();
                dataShow.ToTime();
                dataShow.ToZSTDownTime();
                dataShow.Countdown();
                //dataShow.ToOutMark();

                dataFiler.PPP();
                dataFiler.hxc();
                dataShow.ToLocation();
                dataShow.ToHxcData();
                if (dataFiler.IsGetData() || dataShow.IsUpdateDZST())
                {
                    dataShow.ToDoubleZoushitu();
                    dataShow.ToAllDoubleZST();
                }
                dataFiler.ToGGG();

                indexNum++;
                Thread.Sleep(1000);     //3000 修改为 1000
                Run();
            }
            catch (Exception ex)
            {
                DataFiler.ErrorLog(ex.ToString());
                Run();
            }
        }
Пример #17
0
 protected void Showdata_Click(object sender, EventArgs e)
 {
     DataShow.Visible = true;
     DataShow.DataBind();
     TotalAdmitCard.Text = DataShow.Rows.Count.ToString();
 }