Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        private void getAttachmentCount()
        {
            AttachmentBL abl   = new AttachmentBL();
            int          count = abl.getCount(_id);

            linkAttachment.Text = " ضمائم  " + "(" + count + ")";
        }
Ejemplo n.º 3
0
        public CallContext AttachmentSave(Attachment entity, CallContext resultContext)
        {
            resultContext.securitySettings = ETEMEnums.SecuritySettings.AttachmentSave;
            CallContext resContext = new AttachmentBL().EntitySave <Attachment>(entity, resultContext);

            return(resContext);
        }
Ejemplo n.º 4
0
        public AttachmentForm(int letterId)
        {
            _insuranceId  = letterId;
            _attachmentBL = new AttachmentBL();

            InitializeComponent();
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        public AttachmentForm(int letterId)
        {
            _letterId     = letterId;
            _attachmentBL = new AttachmentBL();

            InitializeComponent();

            loadForm();
        }
Ejemplo n.º 7
0
        public AttachmentList(int insuranceId)
        {
            _insuranceId = insuranceId;

            _gridTools    = new GridTools(dataGridView1);
            _attachmentBl = new AttachmentBL();

            InitializeComponent();

            fillGrid();
        }
Ejemplo n.º 8
0
        public AttachmentList(int letterid)
        {
            _letterId = letterid;

            _gridTools    = new GridTools();
            _attachmentBl = new AttachmentBL();

            InitializeComponent();

            fillGrid();
        }
Ejemplo n.º 9
0
        public CallContext AttachmentSave(Attachment entity, CallContext resultContext)
        {
            resultContext.securitySettings = ETEMEnums.SecuritySettings.AttachmentSave;
            CallContext resContext = new AttachmentBL().EntitySave<Attachment>(entity, resultContext);

            return resContext;
        }
Ejemplo n.º 10
0
        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;
        }