private void loadAttachment(int id) { string fp = ""; try { AttachmentBL attachmentBL = new AttachmentBL(); AttachmentEntity entity = attachmentBL.getById(id); string fileName = entity.Tables[0].Rows[0][AttachmentEntity.FIELD_FILE_NAME].ToString(); try { fileName = fileName.Substring(fileName.LastIndexOf("\\")).Replace("\\", ""); } catch (Exception e) { } byte[] imageData = (byte[])entity.Tables[AttachmentEntity.TableName].Rows[0][AttachmentEntity.FIELD_CONTENT]; string s = Application.ExecutablePath; fp = s.Substring(0, s.LastIndexOf("\\")) + "\\tmp\\"; fp += fileName; File.WriteAllBytes(fp, imageData); Process.Start(fp); } catch (Exception e) { string tt = "خطای زیر رخ داده است" + "\n" + "سیستم قادر به نمایش این فایل نیست" + "\n" + "\n" + e.Message + "\n" + "برای مشاهده این فایل به مسیر زیر مراجعه نمایید" + "\n" + fp; MessageBox.Show(tt); } }
private void getAttachmentCount() { AttachmentBL abl = new AttachmentBL(); int count = abl.getCount(_id); linkAttachment.Text = " ضمائم " + "(" + count + ")"; }
public CallContext AttachmentSave(Attachment entity, CallContext resultContext) { resultContext.securitySettings = ETEMEnums.SecuritySettings.AttachmentSave; CallContext resContext = new AttachmentBL().EntitySave <Attachment>(entity, resultContext); return(resContext); }
public AttachmentForm(int letterId) { _insuranceId = letterId; _attachmentBL = new AttachmentBL(); InitializeComponent(); }
public List <AttachmentDataView> GetAccountingAttachmentList(ICollection <AbstractSearch> searchCriteria, string GridViewSortExpression, string GridViewSortDirection) { List <AttachmentDataView> list = new List <AttachmentDataView>(); list = new AttachmentBL().GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection); return(list); }
public AttachmentForm(int letterId) { _letterId = letterId; _attachmentBL = new AttachmentBL(); InitializeComponent(); loadForm(); }
public AttachmentList(int insuranceId) { _insuranceId = insuranceId; _gridTools = new GridTools(dataGridView1); _attachmentBl = new AttachmentBL(); InitializeComponent(); fillGrid(); }
public AttachmentList(int letterid) { _letterId = letterid; _gridTools = new GridTools(); _attachmentBl = new AttachmentBL(); InitializeComponent(); fillGrid(); }
public CallContext AttachmentSave(Attachment entity, CallContext resultContext) { resultContext.securitySettings = ETEMEnums.SecuritySettings.AttachmentSave; CallContext resContext = new AttachmentBL().EntitySave<Attachment>(entity, resultContext); return resContext; }
public List<AttachmentDataView> GetAccountingAttachmentList(ICollection<AbstractSearch> searchCriteria, string GridViewSortExpression, string GridViewSortDirection) { List<AttachmentDataView> list = new List<AttachmentDataView>(); list = new AttachmentBL().GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection); return list; }