コード例 #1
0
        protected void getDataPieChart()
        {
            decimal[]      arr2        = new decimal[10];
            string[]       cat1        = new string[10];
            decimal[]      Values      = new decimal[10];
            decimal[]      percentages = new decimal[10];
            string[]       expenses    = new string[] { "House Rent", "Utilities", "Education", "Health", "Shopping", "Transport/Travel", "Entertainment", "Outside Eating", "EMI", "Other Expenses" };
            ExpensesDAL    expDAL      = new ExpensesDAL();
            IncomeSourceBO incB        = new IncomeSourceBO();
            IncomeDAL      incDAL      = new IncomeDAL();

            incB = incDAL.GetIncomeDetail();
            decimal   totalIncome = incB.bankAccount + incB.jobIncome + incB.rentalIncome + incB.retirementPension + incB.socialSecurity + incB.otherSources;
            DataSet   ds          = new DataSet();
            DataTable dt          = new DataTable();

            arr2 = expDAL.getExpenseData();
            for (int j = 0; j < 10; j++)
            {
                percentages[j] = (decimal)(arr2[j] / totalIncome) * 100;
            }


            int i;

            for (i = 0; i < 10; i++)
            {
                cat1[i]   = expenses[i];
                Values[i] = percentages[i];
            }
            Chart2.Series[0].Points.DataBindXY(cat1, Values);
            this.Chart2.Series[0]["PieLabelStyle"] = "Outside";
            Chart2.Series[0].Label      = "#PERCENT{P2}";
            Chart2.Series[0].LegendText = "#VALX (#PERCENT)";
        }
        protected void getDataPieChart()
        {
            decimal[]      incomeArr1        = new decimal[5];
            string[]       incomeCat         = new string[5];
            decimal[]      incomevValues     = new decimal[5];
            decimal[]      incomePercentages = new decimal[10];
            string[]       income            = new string[] { "Job/Business Income", "Rental Income", "Retirement Pension", "Social Security", "Other sources" };
            ExpensesDAL    expDAL            = new ExpensesDAL();
            IncomeSourceBO incB   = new IncomeSourceBO();
            IncomeDAL      incDAL = new IncomeDAL();

            incB = incDAL.GetIncomeDetail();
            decimal   totalIncome = incB.jobIncome + incB.rentalIncome + incB.retirementPension + incB.socialSecurity + incB.otherSources;
            DataSet   ds          = new DataSet();
            DataTable dt          = new DataTable();

            incomeArr1 = incDAL.getDataOfIncome();
            for (int j = 0; j < 5; j++)
            {
                incomePercentages[j] = (decimal)(incomeArr1[j] / totalIncome) * 100;
            }

            int i;

            for (i = 0; i < 5; i++)
            {
                incomeCat[i]     = income[i];
                incomevValues[i] = incomePercentages[i];
            }
            Chart2.Series[0].Points.DataBindXY(incomeCat, incomevValues);
            Chart2.Series[0].Label      = "#PERCENT{P2}";
            Chart2.Series[0].LegendText = "#VALX (#PERCENT)";
        }
コード例 #3
0
        private void btnPaijiang_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dgTouzhuSpf.Rows)
            {
                long   batchid  = Convert.ToInt64(row.Cells["id"].Value);
                string type     = "竞彩足球";
                double jiangjin = Convert.ToDouble(row.Cells["jiangjin"].Value);
                if (jiangjin != 0)
                {
                    Income income = new Income();
                    income.Amount      = jiangjin;
                    income.IncomeType  = "中奖";
                    income.TouzhuID    = batchid;
                    income.TouzhuType  = type;
                    income.Operator    = "吴林";
                    income.OperateTime = DateTime.Now;
                    income.id          = batchid;
                    IncomeDAL dal = new IncomeDAL();

                    //如果没有排过奖
                    if (dal.HasPaijiang(income) == 0)
                    {
                        dal.InsertIncome(income);
                    }
                }
            }
            MessageBox.Show("派奖成功!");
        }
コード例 #4
0
        private void BindGrid(string incomeType)
        {
            DataSet ds = new DataSet();

            ds = new IncomeDAL().GetIncomeDetails(incomeType);
            dgvIncome.DataSource = ds.Tables[0];
        }
コード例 #5
0
        private void GetAllAmount()
        {
            IncomeDAL dal          = new IncomeDAL();
            double    chongzhijine =
                dal.GetTotalAmount("充值");
            double goujiangjine   = dal.GetTotalAmount("购奖");
            double zhongjiangjine = dal.GetTotalAmount("中奖");

            lblZongjine.Text       = chongzhijine.ToString();
            lblGoujiangjine.Text   = goujiangjine.ToString();
            lblZhongjiangjine.Text = zhongjiangjine.ToString();
            lblYue.Text            = (chongzhijine + zhongjiangjine - goujiangjine).ToString();
        }
コード例 #6
0
        public Boolean Delete(SqlInt32 IncomeID, SqlInt32 UserID)
        {
            IncomeDAL dalIncome = new IncomeDAL();

            if (dalIncome.Delete(IncomeID, UserID))
            {
                return(true);
            }
            else
            {
                Message = dalIncome.Message;
                return(false);
            }
        }
コード例 #7
0
        public Boolean Update(IncomeENT entIncome)
        {
            IncomeDAL dalIncome = new IncomeDAL();

            if (dalIncome.Update(entIncome))
            {
                return(true);
            }
            else
            {
                Message = dalIncome.Message;
                return(false);
            }
        }
コード例 #8
0
    private void fillGridViewIncome(SqlInt32 UserID)
    {
        IncomeDAL dalIncome = new IncomeDAL();
        DataTable dtIncome  = new DataTable();

        dtIncome = dalIncome.SelectAll(UserID);

        if (dtIncome != null && dtIncome.Rows.Count > 0)
        {
            gvIncome.DataSource = dtIncome;
            gvIncome.DataBind();
            calculateSum();
        }
        else
        {
            gvIncome.DataSource = null;
            gvIncome.DataBind();
        }
    }
コード例 #9
0
 public IncomeBLL()
 {
     _incomeDAL = new IncomeDAL();
 }
コード例 #10
0
        public IncomeENT SelectByPK(SqlInt32 IncomeID, SqlInt32 UserID)
        {
            IncomeDAL dalIncome = new IncomeDAL();

            return(dalIncome.SelectByPK(IncomeID, UserID));
        }
コード例 #11
0
        public DataTable SelectAll(SqlInt32 UserID)
        {
            IncomeDAL dalIncome = new IncomeDAL();

            return(dalIncome.SelectAll(UserID));
        }