Exemple #1
0
 public frmReports(int report)
 {
     InitializeComponent();
     _userBLL       = new UserBLL();
     _roleBLL       = new UserRoleBLL();
     _dictionaryBLL = new DictionaryBLL();
     _paymentBLL    = new PaymentBLL();
     _poolBLL       = new PoolBLL();
     if (report == 1)
     {
         lastDate  = DateTime.Now.ToString("yyyy-MM-dd");
         firstDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
     }
     else if (report == 2)
     {
         lastDate  = DateTime.Now.ToString("yyyy-MM-dd");
         firstDate = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
     }
     else
     {
         firstDate         = dtpStartDate.Value.ToShortDateString();
         lastDate          = dtpEndDate.Value.ToShortDateString();
         groupDate.Visible = true;
     }
 }
        public void doStartPoolChecking()
        {
            new Thread(() =>
            {
                isPoolChecking = true;
                while (this != null && isPoolChecking && !string.IsNullOrEmpty(Config.configAccount))
                {
                    Pool mPool = new PoolBLL().get(Config.configPool);
                    if (mPool != null && !string.IsNullOrEmpty(mPool.poolApiUrl))
                    {
                        int indexOfDot = Config.configAccount.IndexOf(".");

                        ResultPoolApiWallet mResultPoolApiWallet = new PoolApi().getWallet(
                            mPool.poolApiUrl,
                            indexOfDot > -1 ? Config.configAccount.Substring(0, Config.configAccount.IndexOf(".")) : Config.configAccount,
                            Config.configCoin
                            );
                        if (mResultPoolApiWallet != null)
                        {
                            BeginInvoke(new Action(() =>
                            {
                                lbUnpaidCount.Text    = mResultPoolApiWallet.unpaid;
                                lbPaidIn24hCount.Text = mResultPoolApiWallet.paid24h;
                                lbEarnedCount.Text    = mResultPoolApiWallet.total;
                            }));
                        }
                    }
                    else
                    {
                        isPoolChecking = false;
                    }
                    Thread.Sleep(120 * 1000);
                }
            }).Start();
        }
        private void ddlPool_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strPoolNameCurrent = ddlPool.SelectedItem != null ? ((Pool)ddlPool.SelectedItem).poolName : null;
            Pool   mPool = new PoolBLL().get(strPoolNameCurrent);

            if (mPool == null)
            {
                mPool = new Pool();
            }
            if (strPoolNameCurrent.Equals("Add"))
            {
                txtPoolName.Text     = "pool's name";
                txtStratumUrl.Text   = "url and port";
                txtApiUrl.Text       = "pool that powered by yiimp";
                txtPoolName.ReadOnly = false;
                btnDelete.Visible    = false;
            }
            else
            {
                txtPoolName.Text     = mPool.poolName;
                txtStratumUrl.Text   = mPool.poolStratumUrl;
                txtApiUrl.Text       = mPool.poolApiUrl;
                txtPoolName.ReadOnly = true;
                btnDelete.Visible    = true;
            }
        }
 public frmTransferWord(User user)
 {
     InitializeComponent();
     currentUser = user;
     _poolBLL    = new PoolBLL();
     wordIDList  = new List <int>();
     _dictBLL    = new DictionaryBLL();
 }
Exemple #5
0
 public frmNewPool(User user)
 {
     InitializeComponent();
     _allwords    = new List <MyDictionary>();
     _exerciseBLL = new ExerciseBLL();
     _dictBLL     = new DictionaryBLL();
     _currentUser = user;
     _poolBLL     = new PoolBLL();
 }
 public frmExerciseScene(User user, int poolID)
 {
     InitializeComponent();
     _poolBLL     = new PoolBLL();
     _exerciseBLL = new ExerciseBLL();
     _dictBLL     = new DictionaryBLL();
     _currentUser = user;
     _currentPool = _poolBLL.GetPool(poolID);
     index        = 0;
     results      = new int[3];
     words        = new List <MyDictionary>();
 }
        public void loadConfig()
        {
            txtAccount.Text = Config.configAccount;

            List <Pool> mPools  = new PoolBLL().getAll();
            List <Pool> myPools = new List <Pool>();

            if (mPools != null)
            {
                mPools.ForEach(i => myPools.Add(i));
            }
            ddlPool.DataSource    = myPools;
            ddlPool.ValueMember   = "poolName";
            ddlPool.DisplayMember = "poolName";
            ddlPool.SelectedValue = Config.configPool;

            ddlGPU.SelectedIndex = Config.configGPUType;

            cbStartUp.Checked = Config.configStartUp;
        }
        public void initData()
        {
            //ddlPool.Items.Clear();
            List <Pool> mPools  = new PoolBLL().getAll();
            List <Pool> myPools = new List <Pool>();

            if (mPools != null)
            {
                mPools.ForEach(i => myPools.Add(i));
            }
            myPools.Insert(0, new Pool()
            {
                poolName = "Add"
            });
            ddlPool.DataSource    = myPools;
            ddlPool.ValueMember   = "poolName";
            ddlPool.DisplayMember = "poolName";

            if (loadConfigDelegate != null)
            {
                loadConfigDelegate();
            }
        }