public void ModifyDocumentInfoFile_RDLC(string DocumentFilePath, RDLC RDLC) { DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(File.ReadAllText(DocumentFilePath, Encoding.UTF8)); ModifyDocumentVO_ChangeRDLC(RDLC, ref dv); File.WriteAllText(DocumentFilePath, JsonConvert.SerializeObject(dv), Encoding.UTF8); }
public void AddRDLC(ref DocumentVO documentVO, string RDLCPath, string DataSetName) { RDLC r = new RDLC(); r.DataSetName = DataSetName; r.RDLCName = RDLCPath; documentVO.RDLCList.Add(r); }
protected override double Validate(Common.VO record) { DocumentVO document = (DocumentVO)record; double min = -10.0; double temp; foreach (FileVO file in document.Files) { temp = Validate(file.Name); if (temp >= 0.0) { if (min >= 0.0) { min = Math.Min(min, temp); } else { min = temp; } } } return(min); }
public void ModifyDocumentInfoFile_Printer(string DocumentFilePath, string printerName) { DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(File.ReadAllText(DocumentFilePath, Encoding.UTF8)); dv.DefaultRDLC.PrinterName = printerName; File.WriteAllText(DocumentFilePath, JsonConvert.SerializeObject(dv), Encoding.UTF8); }
private void documentsBindingSource_PositionChanged(object sender, EventArgs e) { if (documentsBindingSource.Current == null) { filesBindingSource.Clear(); editSelectedDocumentB.Enabled = false; deleteSelectedDocumentB.Enabled = false; } else { deleteSelectedDocumentB.Enabled = true; editSelectedDocumentB.Enabled = true; DocumentVO document = documentsBindingSource.Current as DocumentVO; if (document.Files != null) { filesBindingSource.Clear(); foreach (FileVO file in document.Files) { filesBindingSource.Add(file); } } } }
public void ModifyDocumentInfoFile_DocumentDetailInfo(string DocumentFilePath, object DocumentDetailInfo) { DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(File.ReadAllText(DocumentFilePath, Encoding.UTF8)); dv.DocumentDetailInfo = DocumentDetailInfo; File.WriteAllText(DocumentFilePath, JsonConvert.SerializeObject(dv), Encoding.UTF8); }
private void editSelectedDocumentB_Click(object sender, EventArgs e) { DocumentVO document = documentsBindingSource.Current as DocumentVO; if (document != null) { OperationsManager manager = new OperationsManager(); //if (document.Type == DocumentVO.DocumentType.FILES) //{ if (manager.HasPermission(OperationsManager.EDIT_DOCS, Library.ConfigurationManager.currUser)) { EFilesArchivingForm form = new EFilesArchivingForm(document, ArchivingForm.OperationMode.EDIT); form.ShowDialog(); } else { Error("أنت لا تمتلك السماحية للقيام بهذه العملية"); } //} //else //{ // if (manager.HasPermission(OperationsManager.EDIT_PAPER_DOCS, Library.ConfigurationManager.currUser)) // { // PaperArchivingForm form1 = new PaperArchivingForm(document, ArchivingForm.OperationMode.EDIT); // form1.ShowDialog(); // } // else // { // Error("أنت لا تمتلك السماحية للقيام بهذه العملية"); // } //} } }
public void ModifyDocumentInfoFile_StampImagePath(string DocumentFilePath, string StampImagePath) { DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(File.ReadAllText(DocumentFilePath, Encoding.UTF8)); dv.StampImagePath = StampImagePath; File.WriteAllText(DocumentFilePath, JsonConvert.SerializeObject(dv), Encoding.UTF8); }
private void FillDocumentInfo(DocumentVO doc) { documentTitleL.Text = doc.Title; fromL.Text = doc.Party.Name; toLabel.Text = doc.Destination.Name; creationDateL.Text = doc.CreationDate.ToString(); }
public void AddRDLC(ref DocumentVO documentVO, string RDLCPath, string DataSetName, RDLC[] SubReportList) { RDLC r = new RDLC(); r.DataSetName = DataSetName; r.RDLCName = RDLCPath; r.SubReportList = SubReportList; documentVO.RDLCList.Add(r); }
public List <FileVO> GetFilesOfDocument(DocumentVO document) { List <FileVO> result = ((IFileDAO)dataAccessObject).GetFilesOfDocument(document); dataAccessObject.CloseConnection(); return(result); }
public List <FileVO> GetFilesOfDocument(DocumentVO document) { string condition = string.Format("{0}={1}", fileDocumentId, document.Id); string statement = SqlStatememtGenerator.Select_ReadAllColumnsByCondition(tableName, condition); SqlDataReader reader = executer.ExecuteSelectStatement(statement, null); return(ReadAllRecords(reader)); }
public JsonResult DocumentInsert(DocumentVO documentVO) { DocumentBasisService.Insert(documentVO); return(Json(new AjaxResult() { Success = true, Data = true })); }
public void SetReporter(ref ReportViewer viewer, string DocumentInfoPath, object Data) { //DocumentVO객체변환 string jsonData = File.ReadAllText(DocumentInfoPath, Encoding.UTF8); DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(jsonData); //리포트 생성 SetReporter(ref viewer, dv.DefaultRDLC, Data); }
public void RemoveRDLC(string documentVOPath, string RDLCPath, string DataSetName) { string jsonData = File.ReadAllText(documentVOPath, Encoding.UTF8); DocumentVO dVO = JsonConvert.DeserializeObject <DocumentVO>(jsonData); RemoveRDLC(ref dVO, RDLCPath); jsonData = JsonConvert.SerializeObject(dVO); File.WriteAllText(documentVOPath, jsonData); }
public void AddRDLC(string documentVOPath, string RDLCPath, string DataSetName, RDLC[] SubReportList) { string jsonData = File.ReadAllText(documentVOPath, Encoding.UTF8); DocumentVO dVO = JsonConvert.DeserializeObject <DocumentVO>(jsonData); AddRDLC(ref dVO, RDLCPath, DataSetName, SubReportList); jsonData = JsonConvert.SerializeObject(dVO); File.WriteAllText(documentVOPath, jsonData); }
public void MakeDocumentInfoFile(string path, DocumentVO documentVO) { string jsonData = JsonConvert.SerializeObject(documentVO); using (StreamWriter sw = File.CreateText(path)) { sw.Write(jsonData); } }
public void MakeDocumentInfoFile(string path, string printerName, string RDLCPath, string DataSetName) { DocumentVO documentVO = MakeDocumentVO(RDLCPath, DataSetName, printerName); string jsonData = JsonConvert.SerializeObject(documentVO); using (StreamWriter sw = File.CreateText(path)) { sw.Write(jsonData); } }
/// <summary> /// 도큐먼트정보객체를 도큐먼트정보파일로부터 생성 /// </summary> /// <param name="FilePath"></param> /// <returns></returns> public DocumentVO GetDocumentVO(string FilePath) { if (!FilePath.Contains(".docInfo")) { return(null); } string strJsonData = File.ReadAllText(FilePath, Encoding.UTF8); DocumentVO dv = JsonConvert.DeserializeObject <DocumentVO>(strJsonData); return(dv); }
public FileVO GenerateNewFile(string filePath, string newFileName, DocumentVO parentDocument, FileVO.FileType type) { FileVO result = new FileVO(); result.Name = newFileName; result.Document = parentDocument; FillData(result, filePath); result.Type = type; return(result); }
public DocumentVO MakeDocumentVO(string RDLCName, string DataSetName, string printerName) { DocumentVO documentVO = new DocumentVO(); IList <RDLC> RDLCList = new List <RDLC>(); RDLC defaultRDLC = new RDLC(RDLCName, DataSetName); RDLCList.Add(defaultRDLC); documentVO = new DocumentVO(); documentVO.RDLCList = RDLCList; documentVO.DefaultRDLC = defaultRDLC; return(documentVO); }
public DocumentVO MakeDocumentVO(RDLC defaultRDLC, string printerName) { DocumentVO documentVO = new DocumentVO(); IList <RDLC> RDLCList = new List <RDLC>(); RDLCList.Add(defaultRDLC); documentVO = new DocumentVO(); documentVO.RDLCList = RDLCList; documentVO.DefaultRDLC = defaultRDLC; documentVO.DefaultRDLC.PrinterName = printerName; return(documentVO); }
public void RemoveRDLC(ref DocumentVO documentVO, string RDLCFileName) { IList <RDLC> rdlcList = new List <RDLC>(); foreach (RDLC rdlc in documentVO.RDLCList) { if (rdlc.RDLCName != RDLCFileName) { rdlcList.Add(rdlc); } } documentVO.RDLCList = rdlcList; }
/// <summary> /// DocumentVO 에서 리스트에 등록된 RDLC 변경 /// </summary> /// <param name="rdlc"></param> /// <param name="dv"></param> private void ModifyDocumentVO_ChangeRDLC(RDLC rdlc, ref DocumentVO dv) { IList <RDLC> newRDLCList = new List <RDLC>(); foreach (RDLC r in dv.RDLCList) { if (r.RDLCName != rdlc.RDLCName) { newRDLCList.Add(r); } } newRDLCList.Add(rdlc); dv.RDLCList = newRDLCList; }
private void WriteToLogFileDleted(DocumentVO doc, FileVO file) { //if (doc.Type == DocumentVO.DocumentType.FILES) //{ string desc = string.Format("{0} {1} {2} {3} {4} {5}", "المستخدم", Library.ConfigurationManager.currUser.Username, "قام بحذف الملف", file.Name, "الخاص بالوثيقة", doc.Title); Log(OperationsManager.EDIT_DOCS, desc); //} //else //{ // string desc = string.Format("{0} {1} {2} {3} {4} {5}", "المستخدم", Library.ConfigurationManager.currUser.Username, "قام بحذف الملف", file.Name, "الخاص بالوثيقة", doc.Title); // Log(OperationsManager.EDIT_PAPER_DOCS, desc); //} }
/// <summary> /// 插入数据 /// </summary> /// <param name="document">数据实体</param> public void Insert(DocumentVO document) { // check DocumentEntity entity = document.ToDocumentEntity(); this.CheckEntity(entity); var folder = FolderBasisService.GetById(entity.FolderId); if (folder == null) { throw new BusinessException("目录不存在,不允许再上传文件"); } DocumentDA.Insert(entity); }
protected override double Validate(Common.VO record) { DocumentVO document = (DocumentVO)record; List <CategoryVO> ids = (List <CategoryVO>)Criteria; foreach (CategoryVO cat in document.Categories) { if (ids.Contains(cat)) { return(0.0); } } return(-10.0); }
public ArchivingForm(DocumentVO document, OperationMode mode) : this() { if (document == null) { currentDocument = new DocumentVO(); currentDocument.Files = new List <FileVO>(); } else { currentDocument = document; } operationMode = mode; }
protected override double Validate(Common.VO record) { DocumentVO document = (DocumentVO)record; double temp; foreach (FileVO file in document.Files) { temp = Validate(file.AdditionDateTime); if (temp >= 0.0) { return(temp); } } return(-10.0); }
private void deleteSelectedDocumentB_Click(object sender, EventArgs e) { OperationsManager opMan = new OperationsManager(); DocumentVO document = documentsBindingSource.Current as DocumentVO; if (document != null) { if (!opMan.HasPermission(OperationsManager.EDIT_DOCS, Library.ConfigurationManager.currUser)) { Error("أنت لا تمتلك السماحية للقيام بهذه العملية"); return; } } else { return; } DialogResult result = Question("هل أنت متأكد من أنك تريد حذف الوثيقة المحددة؟ هذا سيؤدي إلى حذف الملفات المرتبطة بها كذلك كما أنه لا يمكنك التراجع عن هذه العملية لاحقاً"); if (result == System.Windows.Forms.DialogResult.Yes) { document = documentsBindingSource.Current as DocumentVO; if (docsManager.Delete(document)) { Message("تمت عملية الحذف بنجاح", "عملية ناجحة"); WriteToLogDocDleted(document); filesBindingSource.Clear(); documentsBindingSource.Remove(document); SetResultsCount(documentsBindingSource.Count); } else { Error("فشل عملية الحذف", "عملية فاشلة"); } } }
public void RemoveRDLC(ref DocumentVO documentVO, string RDLCFileName) { IList<RDLC> rdlcList = new List<RDLC>(); foreach (RDLC rdlc in documentVO.RDLCList) { if (rdlc.RDLCName != RDLCFileName) { rdlcList.Add(rdlc); } } documentVO.RDLCList = rdlcList; }
/// <summary> /// 리포트뷰어에 기본 RDLC의 페이지세팅을 적용해서 리포트를 보여준다 /// </summary> /// <param name="viewer"></param> /// <param name="dv"></param> /// <param name="RDLCFileName"></param> /// <param name="Data"></param> public void SetReporter(ref ReportViewer viewer,DocumentVO dv, string RDLCFileName, object Data) { //리포트 생성 SetReporter(ref viewer,dv.DefaultRDLC,Data); }
public DocumentVO MakeDocumentVO(string RDLCName, string DataSetName, string printerName) { DocumentVO documentVO = new DocumentVO(); IList<RDLC> RDLCList = new List<RDLC>(); RDLC defaultRDLC = new RDLC(RDLCName, DataSetName); RDLCList.Add(defaultRDLC); documentVO = new DocumentVO(); documentVO.RDLCList = RDLCList; documentVO.DefaultRDLC = defaultRDLC; return documentVO; }
/// <summary> /// DocumentVO 에서 리스트에 등록된 RDLC 변경 /// </summary> /// <param name="rdlc"></param> /// <param name="dv"></param> private void ModifyDocumentVO_ChangeRDLC(RDLC rdlc, ref DocumentVO dv) { IList<RDLC> newRDLCList = new List<RDLC>(); foreach (RDLC r in dv.RDLCList) { if (r.RDLCName != rdlc.RDLCName) { newRDLCList.Add(r); } } newRDLCList.Add(rdlc); dv.RDLCList = newRDLCList; }
public DocumentVO MakeDocumentVO(RDLC defaultRDLC, string printerName) { DocumentVO documentVO = new DocumentVO(); IList<RDLC> RDLCList = new List<RDLC>(); RDLCList.Add(defaultRDLC); documentVO = new DocumentVO(); documentVO.RDLCList = RDLCList; documentVO.DefaultRDLC = defaultRDLC; documentVO.DefaultRDLC.PrinterName = printerName; return documentVO; }