public CompleteTicketView()
 {
     InitializeComponent();
     _ticketBusiness  = new TicketBusiness(SystemParam.CurrentUser);
     _revenueBusiness = new RevenueBusiness(SystemParam.CurrentUser);
     _expenseBusiness = new ExpenseBusiness(SystemParam.CurrentUser);
 }
Ejemplo n.º 2
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            this.dgProfile.ItemsSource = null;
            Decimal TotalMoney   = 0; //合同金额总计
            Decimal TotalCost    = 0; //成本金额总计
            Decimal TotalProfile = 0; //净利润金额合计
            //项目查询
            string            year1     = this.cmbYear.Text;
            string            month1    = this.cmbMonth.Text;
            string            year2     = this.cmbYear2.Text;
            string            month2    = this.cmbMonth2.Text;
            string            start     = year1 + "-" + month1 + "-1 00:00:00";
            string            end       = year2 + "-" + month2 + "-1 23:59:59";
            DateTime          startDate = DateTime.Parse(start);
            DateTime          endDate   = DateTime.Parse(end).AddMonths(1).AddDays(-1);
            List <TB_PROJECT> list      = Comments.Comment.QueryProject(0, "", "", startDate, endDate);

            if (list.Count > 0)
            {
                List <tmpProfile> ls = new List <tmpProfile>();
                for (int i = 0; i < list.Count; i++)
                {
                    tmpProfile tmp = new tmpProfile();
                    tmp.INDEX       = i + 1;
                    tmp.projName    = list[i].OBJECTNAME;
                    tmp.projDate    = list[i].BEGINDATE.ToShortDateString();
                    tmp.projAddress = list[i].ADDRESS;
                    tmp.LEADER      = list[i].TEAMLEDER;
                    tmp.SALER       = list[i].CREATEUSER;
                    tmp.MONEY       = list[i].MONEY;
                    TotalMoney     += tmp.MONEY;
                    tmp.COST        = ExpenseBusiness.getTotalExpense(list[i].Id);
                    TotalCost      += tmp.COST;
                    profileporcess   pp  = new profileporcess();
                    projProfileClass ppc = pp.getProfile(list[i]);
                    if (ppc != null)
                    {
                        tmp.JLR = ppc.xmjlr; //净利润
                        tmp.JLV = ppc.mlv;   //净利率
                    }
                    TB_BILL bill = getBillInfo(list[i].Id);
                    if (bill != null)
                    {
                        tmp.BILLDATE = bill.CREATEDATE.ToShortDateString();
                    }
                    if (list[i].BILLDATE != null && list[i].BILLSTATUS == "已结算")
                    {
                        tmp.COMPLETEDATE = list[i].BILLDATE.Year.ToString() + "年" + list[i].BILLDATE.Month.ToString() + "月";
                    }
                    ls.Add(tmp);
                }
                this.dgProfile.ItemsSource = ls;
                this.lab1.Content          = "合计发票金额:" + TotalMoney.ToString();
                this.lab2.Content          = "合计成本金额:" + TotalCost.ToString();
                this.lab3.Content          = "合计净利润金额:" + TotalProfile.ToString();
            }
        }
        public RevenueView(bool isRevenue)
        {
            InitializeComponent();

            _revenueBusiness = new RevenueBusiness(SystemParam.CurrentUser);
            _expenseBusiness = new ExpenseBusiness(SystemParam.CurrentUser);

            _isRevenue = isRevenue;
        }