/// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     this.DataVerify();
     if (this.IsVerify)
     {
         PfmIaeDetailedMDL detMdl = new PfmIaeDetailedMDL();
         detMdl.DetAddTime = DateTime.Now;
         detMdl.MbrId      = TypeHelper.TypeToInt32(this.cboxMember.SelectedValue, 0);
         detMdl.AccId      = TypeHelper.TypeToInt32(this.cboxAccounts.SelectedValue, 0);
         detMdl.CatId      = TypeHelper.TypeToInt32(this.cboxCategory.SelectedValue, 0);
         detMdl.DetName    = this.txtName.Text;
         decimal tmpMoney = 0;
         decimal.TryParse(this.txtMoney.Text, out tmpMoney);
         detMdl.DetMoney       = tmpMoney * TypeHelper.TypeToInt32(this.cboxType.SelectedValue, 1);
         detMdl.DetAddress     = string.IsNullOrEmpty(this.txtAddress.Text) ? null : this.txtAddress.Text;
         detMdl.DetDescription = string.IsNullOrEmpty(this.txtDescription.Text) ? null : this.txtDescription.Text;
         detMdl.DetMemo        = string.IsNullOrEmpty(this.txtMemo.Text) ? null : this.txtMemo.Text;
         detMdl.DetStatus      = 1;
         PfmIaeDetailedBLL.Insert(detMdl);
         MessageBoxResult boxResult = MessageBox.Show("新数据添加成功!是否继续添加?", "提示:", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.No);
         if (boxResult == MessageBoxResult.Yes)
         {
             this.InitializeData();
         }
         else
         {
             if (ModuleExtend != null)
             {
                 this.ModuleExtend(false, Library.Transit.NameItems.IaeDetailed);
             }
         }
     }
 }
Example #2
0
 /// <summary>
 ///  初始化数据
 /// </summary>
 private void InitializeData()
 {
     if (this.svDetailed.Visibility == Visibility.Visible)
     {
         this.DetailedBack();
     }
     EntityListener.PfmIaeDetailedListener.Instance.Receive(PfmIaeDetailedBLL.ISelectPaging(pager.PageSize, pager.PageCurrent, out _dataTotal));
 }
Example #3
0
 /// <summary>
 /// 删除收支明细数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mitmDelete_Click(object sender, RoutedEventArgs e)
 {
     if (IaeDetailedEntity != null && IaeDetailedEntity.DetId > 0)
     {
         MessageBoxResult boxResult = MessageBox.Show(string.Format("您确定要删除数据【{0}】所包含的信息吗?", IaeDetailedEntity.DetName), "询问:", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
         if (boxResult == MessageBoxResult.Yes)
         {
             PfmIaeDetailedBLL.Delete(IaeDetailedEntity.DetId);
             MessageBox.Show("数据删除成功!", "提示:", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
             this.InitializePaging();
         }
     }
 }
        /// <summary>
        /// 保存报表明细数据
        /// </summary>
        /// <param name="rptId">报表编号</param>
        private void ReportRecordSave(int rptId)
        {
            DataTable          dt     = PfmIaeDetailedBLL.Report(DateBegin, DateEnd);
            PfmReportRecordMDL recMdl = new PfmReportRecordMDL();

            foreach (DataRow dr in dt.Rows)
            {
                recMdl.RptId       = rptId;
                recMdl.MbrId       = TypeHelper.TypeToInt32(dr["mbr_id"]);
                recMdl.AccId       = TypeHelper.TypeToInt32(dr["acc_id"]);
                recMdl.RrdAddTime  = DateTime.Now;
                recMdl.RrdInSum    = TypeHelper.TypeToDecimal(dr["Incomings"]);
                recMdl.RrdInCount  = TypeHelper.TypeToInt32(dr["InCount"]);
                recMdl.RrdOutSum   = TypeHelper.TypeToDecimal(dr["Outgoings"]);
                recMdl.RrdOutCount = TypeHelper.TypeToInt32(dr["OutCount"]);
                recMdl.RrdSum      = TypeHelper.TypeToDecimal(dr["Sums"]);
                PfmReportRecordBLL.Insert(recMdl);
            }
            recMdl = null;
        }