public ucPersonalRatio(decimal profile1, decimal profile2, TB_RATIO ratio) { InitializeComponent(); labName.Content = TB_UserDao.FindFirst(new EqExpression("USER_CODE", ratio.USERCODE)).USER_NAME; labtc1.Content = profile1; labf.Content = ratio.RATIO; labtc2.Content = Math.Round((profile2 * ratio.RATIO / 10), 2); labtotal.Content = Utils.NvDecimal(labtc2.Content) + profile1; }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { List <TB_RATIO> list = new List <TB_RATIO>(); decimal total = 0; //项目负责人 for (int i = 0; i < panel1.Children.Count; i++) { ucRatio2 uc = panel1.Children[i] as ucRatio2; string usercode = uc.labName.Content.ToString(); string ratio = uc.txtRatio.Text; decimal d = 0; decimal.TryParse(ratio, out d); TB_RATIO ro = new TB_RATIO(); ro.USERCODE = usercode; ro.RATIO = d; ro.PROJECTID = (txtProj.Tag as TB_PROJECT).Id; ro.STATUS = 1; list.Add(ro); total += d; } //项目成员 for (int i = 0; i < panel2.Children.Count; i++) { ucRatio2 uc = panel2.Children[i] as ucRatio2; string usercode = uc.labName.Content.ToString(); string ratio = uc.txtRatio.Text; decimal d = 0; decimal.TryParse(ratio, out d); TB_RATIO ro = new TB_RATIO(); ro.USERCODE = usercode; ro.RATIO = d; ro.PROJECTID = (txtProj.Tag as TB_PROJECT).Id; ro.STATUS = 1; list.Add(ro); total += d; } bool flag = RatioBusiness.delete((txtProj.Tag as TB_PROJECT).Id); if (flag) { for (int i = 0; i < list.Count; i++) { list[i].Save(); } MessageHelper.ShowMessage("保存成功!"); this.Close(); } else { MessageHelper.ShowMessage("保存失败!"); } }
public ucRatio2(string usercode, int projId) { InitializeComponent(); mUserCode = usercode; this.labName.Content = usercode; //查询提成份额 TB_RATIO ratio = TB_RATIODAO.FindFirst(new EqExpression("STATUS", 1), new EqExpression("PROJECTID", projId), new EqExpression("USERCODE", usercode)); if (ratio != null) { this.txtRatio.Text = ratio.RATIO.ToString(); } else { this.txtRatio.Text = "0"; } }