Ejemplo n.º 1
0
 void Init()
 {
     userController          = new UserController();
     totalController         = new TotalController();
     BackgroundColor         = Constants.backgroundColor;
     LoginIcon.HeightRequest = Constants.LoginIconHeight;
     signUpLoader.IsVisible  = false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 解析读取内容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            if (isCalc == false)
            {
                isCalc            = true;
                this.button2.Text = MessageUtil.GetMessage("waiting");
                new System.Threading.Thread(() =>
                {
                    try
                    {
                        //获取开始时间
                        TimeInterval ti = new TimeInterval()
                        {
                            Start = DateTimeUtil.GetDateTime(this.dtpStartDate.Text, this.dtpLogStartTime.Text),
                            End   = DateTimeUtil.GetDateTime(this.dtpEndDate.Text, this.dtpLogEndTime.Text)
                        };
                        //保存时间间隔
                        preTI = ti;

                        TotalController tc = new TotalController();
                        Total total        = tc.GetTotal(ti);
                        this.BeginInvoke(new EventHandler(delegate(Object send, EventArgs ea)
                        {
                            this.filecopy.Text         = total.FilesCopied.ToString();
                            this.bytescopy.Text        = total.BytesCopied.ToString();
                            this.filedelete.Text       = total.FilesDeleted.ToString();
                            this.bytesdelete.Text      = total.BytesDeleted.ToString();
                            this.filetransport.Text    = total.FileTransfered.ToString();
                            this.bytestransport.Text   = total.BytesTransfered.ToString();
                            this.fileTransDelete.Text  = total.FileTransDeleted.ToString();
                            this.bytesTransDelete.Text = total.BytesTransDeleted.ToString();
                        }), new Object[] { this, EventArgs.Empty });

                        System.Threading.Thread.Sleep(500);
                    }
                    catch (System.Exception ex)
                    {
                        logger.Error(ex.Message);
                        MessageBox.Show(MessageUtil.GetMessage("UnknownError"));
                    }
                    finally
                    {
                        this.BeginInvoke(new EventHandler(delegate(Object send, EventArgs ea) { this.button2.Text = "査問"; }), new Object[] { this, EventArgs.Empty });
                        isCalc = false;
                    }
                }).Start();
            }
        }
Ejemplo n.º 3
0
        private void CompileTotals(int saleId)
        {
            TotalController totalController = new TotalController();
            List <Total>    totals          = totalController.GetTotalsBySaleId(saleId);

            Total t = new Total();

            t.name = "";
            t.startingContribution = totals.Sum(e => e.startingContribution);
            t.saleTotal            = totals.Sum(e => e.saleTotal);
            t.total = totals.Sum(e => e.total);
            totals.Add(t);

            TotalGrid.DataSource = totals;
            SetUpGrid();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 导出到文件 暂时只支持CSV
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (preTI == null)
                {
                    MessageBox.Show(MessageUtil.GetMessage("NoValueForExport"));
                    return;
                }
                //选择文件路径
                if (DialogResult.OK == this.openFileDialog1.ShowDialog())
                {
                    string fpath = this.openFileDialog1.FileName;
                    Total  total = new Total()
                    {
                        FilesCopied = Convert.ToInt32(this.filecopy.Text),
                        BytesCopied = new BudLogManage.Common.Helper.Size(this.bytescopy.Text),

                        FilesDeleted = Convert.ToInt32(this.filedelete.Text),
                        BytesDeleted = new BudLogManage.Common.Helper.Size(this.bytesdelete.Text),

                        FileTransfered    = Convert.ToInt32(this.filetransport.Text),
                        BytesTransfered   = new Common.Helper.Size(this.bytestransport.Text),
                        FileTransDeleted  = Convert.ToInt32(this.fileTransDelete.Text),
                        BytesTransDeleted = new BudLogManage.Common.Helper.Size(this.bytesTransDelete.Text),
                        TimeInterval      = preTI
                    };

                    TotalController tc = new TotalController();
                    tc.Export(total, fpath);
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.Message);
                MessageBox.Show(MessageUtil.GetMessage("ExportFailed"));
            }
        }
Ejemplo n.º 5
0
 public void Init() //initilazes screen components
 {
     BackgroundColor = Constants.backgroundColor;
     totalController = new TotalController();
 }