//作废
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            var reportId       = ((Button)sender).CommandArgument;
            var costReportInfo = _costReport.GetReportByReportId(new Guid(reportId));

            if (!(costReportInfo.State.Equals((int)CostReportState.Auditing) || costReportInfo.State.Equals((int)CostReportState.AuditingNoPass) || (costReportInfo.ReportKind.Equals((int)CostReportKind.Later) && costReportInfo.State.Equals((int)CostReportState.InvoiceNoPass))))
            {
                MessageBox.Show(this, "该单据状态已更新,不允许此操作!");
                return;
            }

            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    var memo = WebControl.RetrunUserAndTime("[【作废申报】:申报作废;]");
                    _costReport.UpdateReport(new Guid(reportId), (int)CostReportState.Cancel, string.Empty, memo, Guid.Empty);

                    //添加操作日志
                    _operationLogManager.Add(Personnel.PersonnelId, Personnel.RealName, new Guid(reportId), costReportInfo.ReportNo, OperationPoint.CostDeclare.AuditDeclare.GetBusinessInfo(), 1, "");

                    RG_Report.Rebind();
                    ts.Complete();
                }
                catch
                {
                    MessageBox.AppendScript(this, "作废申报失败!");
                }
            }
        }
Exemple #2
0
 protected void OnClick_Search(object sender, ImageClickEventArgs e)
 {
     StartTime     = RDP_StartTime.SelectedDate != null ? RDP_StartTime.SelectedDate.Value : DateTime.MinValue;
     EndTime       = RDP_EndTime.SelectedDate != null ? RDP_EndTime.SelectedDate.Value : DateTime.MinValue;
     SearchFiliale = RCB_Filliale.SelectedValue;
     SearchBranch  = RCB_Branch.SelectedValue;
     SearchClass   = RCB_CompanyClass.SelectedValue;
     if (new Guid(SearchClass) == Guid.Empty && new Guid(SearchBranch) == Guid.Empty)
     {
         SearchType = "Default";
     }
     else
     {
         SearchType = "Search";
     }
     RG_Report.Rebind();
 }