private void rationProcess() { if (mproj != null) { if (string.IsNullOrEmpty(mproj.BILLSTATUS)) { labMyMoney.Content = "待结算"; return; } profileporcess pp = new profileporcess(); projProfileClass ppc = pp.getProfile(TB_PROJECTDAO.FindFirst(new EqExpression("Id", mprojID))); List <TB_PERSONAL_PROFILE> list = pp.personalProcess(ppc, mprojID); if (list.Count > 0) { List <TB_PERSONAL_PROFILE> rtn = list.FindAll(a => a.USERCODE == Global.g_usercode); //数据过滤 if (rtn.Count > 0) { labMyMoney.Content = rtn[0].PROFILE1 + rtn[0].PROFILE2 + "元"; } else { labMyMoney.Content = "0元"; } } else { labMyMoney.Content = "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(); } }
/// <summary> /// 查询已结算项目的成员提成 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSearch_Click(object sender, RoutedEventArgs e) { dgProfile.ItemsSource = null; if (this.txtProj.Tag == null) { MessageHelper.ShowMessage("请选择需要查询的项目"); return; } else { TB_PROJECT proj = this.txtProj.Tag as TB_PROJECT; if (proj.BILLSTATUS == "已结算") { profileporcess pp = new profileporcess(); projProfileClass ppc = pp.getProfile(TB_PROJECTDAO.FindFirst(new EqExpression("Id", proj.Id))); List <TB_PERSONAL_PROFILE> list = pp.personalProcess(ppc, proj.Id); List <TB_PERSONAL_PROFILE> _list = new List <TB_PERSONAL_PROFILE>(); if (txtUser.Tag == null) { _list = list; } else { TB_User user = txtUser.Tag as TB_User; _list = list.FindAll(a => a.USERCODE == user.USER_CODE); } if (_list.Count > 0) { for (int i = 0; i < _list.Count; i++) { _list[i].INDEX = i + 1; _list[i].USERNAME = TB_UserDao.FindFirst(new EqExpression("USER_CODE", _list[i].USERCODE)).USER_NAME; } dgProfile.ItemsSource = list; } } else { MessageHelper.ShowMessage("该项目未结算"); return; } } }
public ucPreview2(int _projectID) { InitializeComponent(); if (_projectID == 0) { return; } mprojID = _projectID; this.dgExpense.ItemsSource = null; Query(); //报销信息查询 BindProjectInfo(); QueryBillInfo(); profileporcess pp = new profileporcess(); projProfileClass ppc = pp.getProfile(TB_PROJECTDAO.FindFirst(new EqExpression("Id", mprojID))); profileProcess(ppc); //项目利润计算 this.panel.Children.Clear(); rationProcess(ppc); //个人提成计算 }
private void brnPrint_Click(object sender, RoutedEventArgs e) { try { if (this.dgObject.SelectedItem != null) { TB_PROJECT proj = this.dgObject.SelectedItem as TB_PROJECT; profileporcess proce = new profileporcess(); projProfileClass ppc = proce.getProfile(proj); //公司项目利润 if (ppc != null) { ppc.expens = ExpenseProcess(ppc.expens); //合并 ProfilePrint print = new ProfilePrint(); print.Print(ppc, proj); } } } catch (Exception ex) { MessageHelper.ShowMessage(ex.Message); } }