示例#1
0
        protected override void CreateNewObject()
        {
            report = new Report
            {
                ReportContent = NoiDungThucHien.Text,
                PerformOnDate = ThoiGianThucHien.Text.ToDateTime(),
                RequestID     = Parameters.Pid,
                Status        = TrangThai.SelectedValue.ToInteger(),
                ReporterName  = Sessions.DisplayName,
                DepartmentID  = Sessions.DepartmentID
            };

            if (!string.IsNullOrEmpty(VanBanDaBaoCao.SelectedValue.Trim()))
            {
                ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient();
                client.Endpoint.Address = new System.ServiceModel.EndpointAddress(AppSettings.HSCV_Service);
                var document = client.GetVBDiByIDs(new ArrayOfString {
                    VanBanDaBaoCao.SelectedValue.Trim()
                }).SingleOrDefault();

                ReportServices.Create(report: report, performIds: ThucHien.GetSelectedValues(), fileContent: document?.FileDinhKems?.FirstOrDefault()?.DuLieu, fileName: document?.FileDinhKems?.FirstOrDefault()?.TenFileDinhKem, uploadFolder: AppSettings.UploadFolder, isStaffReport: report.Request.CoQuyenXacNhan, isSendToProvince: true);
            }
            else
            {
                ReportServices.Create(report: report, performIds: ThucHien.GetSelectedValues(), fileContent: FileDinhKem.PostedFile, fileName: FileDinhKem.PostedFile?.FileName, uploadFolder: AppSettings.UploadFolder, isStaffReport: report.Request.CoQuyenXacNhan, isSendToProvince: true);
            }

            ExceptionlessClient.Default.SubmitEvent(new Event {
                Message = $"Nhập báo cáo thực hiện YKCD ({Sessions.DisplayName})", Type = "Nhập báo cáo", Source = AppSettings.AGENCY_NAME
            });

            Redirector.Redirect(ViewNames.Agency.ThongTinYKCD, "id", Parameters.Pid);
        }
示例#2
0
        protected override void CreateNewObject()
        {
            report = new Report
            {
                ReportContent = NoiDungThucHien.Text,
                PerformOnDate = ThoiGianThucHien.Text.ToDateTime(),
                RequestID     = Parameters.Pid,
                Status        = TrangThai.SelectedValue.ToInteger(),
                ReporterName  = Sessions.DisplayName,
                DepartmentID  = Sessions.DepartmentID
            };

            ReportServices.Create(report: report, performIds: ThucHien.GetSelectedValues(), fileContent: FileDinhKem.PostedFile, fileName: FileDinhKem.PostedFile?.FileName, uploadFolder: AppSettings.UploadFolder, isStaffReport: report.Request.CoQuyenXacNhan, isSendToAgency: true);

            ExceptionlessClient.Default.SubmitEvent(new Event {
                Message = $"Nhập báo cáo thực hiện YKCD ({Sessions.DisplayName})", Type = "Nhập báo cáo", Source = AppSettings.AGENCY_NAME
            });

            Redirector.Redirect(ViewNames.SubAgency.ThongTinYKCD, "id", Parameters.Pid);
        }