protected void ShowVBDHDocumentInfo() { //Khởi tạo services ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(AppSettings.HSCV_Service); if (!string.IsNullOrEmpty(Parameters.VbdhCode)) { var document = client.GetVBDiByIDs(new ArrayOfString { Parameters.VbdhCode }).SingleOrDefault(); ViewState["SyncDoc"] = document; if (document != null) { SoHieuVanBan.Text = document.SoKyHieu; TrichYeu.Text = document.TrichYeu; NgayBanHanh.Text = document.NgayPhatHanh; NguoiKy.SelectByValue(UserServices.GetUser(document.NguoiKy).UserID); NguoiSoanThao.SelectByValue(Sessions.UserID); LoaiVanBan.SelectByValue(4); VanBanNgoai.Checked = true; VanBanNgoai.Enabled = false; } } }
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); }
protected override void GetDataList() { ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient(); client.Endpoint.Address = new EndpointAddress(AppSettings.HSCV_Service); BaseCollection = client.GetVBDiHasIdeaLeader(DateTime.Now.AddDays(-30), DateTime.Now) ?.Where(item => !string.IsNullOrEmpty(item.NguoiSoanThao) && item.NguoiSoanThao.ToUnsign().ToUpper().Equals(Sessions.DisplayName.ToUnsign().ToUpper())) ?.Where(item => DocumentServices.GetByVbdhCode(item.MaVBDi) == null) ?.ToList(); }
protected void VanBanDaBaoCao_OnSelectedIndexChanged(object sender, EventArgs e) { 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(); NoiDungThucHien.Text = $"Đã có văn bản số {VanBanDaBaoCao.SelectedItem.Text} ban hành ngày {document.NgayPhatHanh} báo cáo UBND tỉnh"; ThoiGianThucHien.Text = document.NgayPhatHanh; TrangThai.SelectByValue(2); } }
public static void GetVbdhCode() { ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient(); client.Endpoint.Address = new EndpointAddress(AppSettings.HSCV_Service); var documents = client.GetVBDiByDate(new DateTime(2018, 8, 20), new DateTime(2018, 12, 31))?.ToList(); foreach (var document in DocumentServices.GetList(fromDate: new DateTime(2018, 8, 20), toDate: new DateTime(2018, 12, 31))) { if (document.VBDHCode.IsNullOrEmpty()) { string documentCode = document.DocumentCode.Trim().ToUpper().Replace(" ", ""); document.VBDHCode = documents.Where(doc => doc != null && doc.SoKyHieu != null && doc.SoKyHieu.Trim().ToUpper().Equals(documentCode))?.FirstOrDefault()?.MaVBDi; DocumentServices.Update(document); } } }
protected override void GetDataList() { ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient(); client.Endpoint.Address = new EndpointAddress(AppSettings.HSCV_Service); if (ChiLayVbCaNhan.Checked) { BaseCollection = client.GetVBDiHasIdeaLeader(TuNgay.Text.ToDateTime(), DenNgay.Text.ToDateTime()) .Where(item => item.NguoiSoanThao != null && item.NguoiSoanThao.ToUnsign().ToUpper().Equals(Sessions.DisplayName.ToUnsign().ToUpper())) .Where(item => DocumentServices.GetByVbdhCode(item.MaVBDi) == null) .ToList(); } else { BaseCollection = client.GetVBDiHasIdeaLeader(TuNgay.Text.ToDateTime(), DenNgay.Text.ToDateTime()) .Where(item => DocumentServices.GetByVbdhCode(item.MaVBDi) == null) .ToList(); } }
protected override void BindValueToPageControls() { var request = RequestServices.GetById(Parameters.Pid); ThucHien.Items.Clear(); if (request.Performs?.Count > 0) { foreach (var perform in request.Performs) { ThucHien.AddSelectItem(perform.DepartmentID > 0 ? perform.Department.DepartmentName : perform.User.FullName, perform.PerformID.ToString()); } } else if (request.IsProvinceRequest) { ThucHien.Items.Add(new ListItem(text: AppSettings.AGENCY_NAME, value: "")); } //Hiển thị ô chọn văn bản có ý kiến chỉ đạo nếu đây là YKCD của UBND tỉnh và có dữ liệu ở HSCV Service if (!string.IsNullOrEmpty(AppSettings.HSCV_Service) && request.IsProvinceRequest && AppSettings.IS_USE_SYNC_DOCUMENT_REPORT) { ExchangeDocServiceSoapClient client = new ExchangeDocServiceSoapClient(); client.Endpoint.Address = new EndpointAddress(AppSettings.HSCV_Service); var syncDocs = client.GetVBDiHasIdeaLeader(DateTime.Now.AddDays(-7), DateTime.Now); if (syncDocs != null && syncDocs.Length > 0) { VanBanDaBaoCaoGroup.Visible = true; VanBanDaBaoCao.Items.Clear(); foreach (var item in syncDocs) { VanBanDaBaoCao.AddSelectItem($"{item.SoKyHieu} ({item.TrichYeu})", item.MaVBDi); } VanBanDaBaoCao.AddSelectItem("Chọn văn bản báo cáo", ""); } } }