Exemple #1
0
 /// <summary>
 /// 初始化数据
 /// </summary>
 /// <param name="rptId">报表编号</param>
 public void InitializeData(long rptId)
 {
     PfmReport       = PfmReportBLL.Select(rptId);
     PfmReportRecord = PfmReportRecordBLL.ISelect(string.Format("rpt_id = '{0}'", rptId));
     this.dgDataSource.DataContext = PfmReportRecord;
     this.txtTitle.Text            = PfmReport.RptName;
     this.txtType.Text             = DictionaryTsit.GetDictName(PfmReport.DictMark);
     this.txtDate.Text             = PfmReport.RptDate.ToString("yyyy年MM月dd日");
     this.txtMemo.Text             = PfmReport.RptMemo;
 }
 /// <summary>
 /// 删除报表信息数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mitmDelete_Click(object sender, RoutedEventArgs e)
 {
     if (ReportEntity != null && ReportEntity.RptId > 0)
     {
         MessageBoxResult boxResult = MessageBox.Show(string.Format("您确定要删除数据【{0}】所包含的信息吗?", ReportEntity.RptName), "询问:", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
         if (boxResult == MessageBoxResult.Yes)
         {
             PfmReportBLL.Delete(ReportEntity.RptId);
             PfmReportRecordBLL.DeleteAll(ReportEntity.RptId);
             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;
        }