コード例 #1
0
        public bool sendReport()
        {
            //MessageBox.Show("send request");
            _communication.Connect();


            _report           = new Report();
            _report.Sender_ID = SessionInfos.login_user.Id;
            _report.Sender    = SessionInfos.login_user.FirstName + " "
                                + SessionInfos.login_user.LastName + " - "
                                + SessionInfos.login_user.RoleName;
            _report.Recipient_ID = _view.getRecipientID();
            _report.Recipient    = _view.getRecipient();
            _report.Description  = _view.getTDescription();
            _report.Title        = _view.getTitle();
            _report.SendDate     = DateTime.Now;
            _report.isMark       = false;
            _report.isRead       = false;


            Attachments attach;

            if (!String.IsNullOrEmpty(_view.getAttachments()))
            {
                attach = new Attachments();
                attach.FileLocation = _view.getAttachments();
                attach.uploadTime   = DateTime.Now;
            }
            else
            {
                attach = null;
            }

            ReportCategory repCat = new ReportCategory();

            repCat.Title = _view.getCategoryTitle();

            saveNewReport(_report, repCat, attach);

            Request reportRequest = new Request(RequestType.NEW_REPORT, new object[] { _report, repCat, attach });

            _communication.SendRequest(reportRequest);
            if (attach != null)
            {
                this.uploadFile();
            }

            _communication.Disconnect();

            return(true);
        }
コード例 #2
0
        public bool sendReport()
        {
            //MessageBox.Show("send request");
            _communication.Connect();


            _report = new Report(_view.getRecipientID(), _view.getRecipient(), _view.getTDescription(),
                                 _view.getTitle());
            Attachments attach;

            if (!String.IsNullOrEmpty(_view.getAttachments()))
            {
                attach = new Attachments();
                attach.FileLocation = _view.getAttachments();
                attach.uploadTime   = DateTime.Now;
            }
            else
            {
                attach = null;
            }

            ReportCategory repCat = new ReportCategory();

            repCat.Title = _view.getCategoryTitle();

            saveNewReport(_report, repCat, attach);

            Request reportRequest = new Request(RequestType.New_Report, new object[] { _report, repCat, attach });

            _communication.SendRequest(reportRequest);
            if (attach != null)
            {
                this.uploadFile();
            }

            _communication.Disconnect();

            return(true);
        }