Пример #1
0
        public void CreateUserComment()
        {
            DataRow dr = null;
            bool deleteUserComment = false;
            //userFlagRequest[] requestArray = new userFlagRequest[gridViewInboundDocs.GetSelectedRows().Length];
            //int counter = 0;
            List<InboundDocUserFlagDto> userFlagList = new List<InboundDocUserFlagDto>();
            InboundDocsView inbDocView = null;
            string userComment = "";
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                foreach (int rowHandle in gridViewInboundDocs.GetSelectedRows())
                {
                    //userFlagRequest request = new userFlagRequest();
                    InboundDocUserFlagDto userFlagData = new InboundDocUserFlagDto();
                    dr = gridViewInboundDocs.GetDataRow(rowHandle);
                    inbDocView = CollectionHelper.CreateObjectFromDataRow<InboundDocsView>(dr);
                    userComment = inbDocView.CommentUser;
                    CommentForm commentForm = new CommentForm();
                    commentForm.Comment = userComment;
                    commentForm.ShowDialog();

                    if (commentForm.DialogResult == DialogResult.OK)
                    {
                        //Israel 9/17/2015
                        userComment = commentForm.Comment;     
                    }

                    deleteUserComment = ((userComment == null) || (userComment.Trim() == ""));

                    //request.inboundDocId = inbDocView.Id;
                    //request.flagType = "COMMENT";
                    //request.userName = (inboundWebServices.userName.Text[0]).ToUpper();
                    //request.comment = userComment;
                    //if (deleteUserComment)
                    //{
                    //    request.updateDeleteFlag = updateUserFlag.Delete;
                    //}
                    //else
                    //{
                    //    request.updateDeleteFlag = updateUserFlag.Update;
                    //}
                    //request.updateDeleteFlagSpecified = true;
                    //requestArray[counter] = request;
                    //counter++;

                    userFlagData.InboundDocId = Convert.ToInt32(inbDocView.Id);
                    userFlagData.FlagType = "COMMENT";
                    userFlagData.InboundUser = p_UserId;
                    userFlagData.Comments = userComment;
                    if (deleteUserComment)
                    {
                        userFlagData.UpdateDeleteInd = USER_FLAG_DELETE;
                    }
                    else
                    {
                        userFlagData.UpdateDeleteInd = USER_FLAG_UPDATE;
                    }
                    userFlagList.Add(userFlagData);
                }
                //SubmitUserCommentRequest(requestArray);
                SubmitUserCommentRequest(userFlagList);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("An error occurred while updating the grid with the User Comment." + Environment.NewLine +
                       "Error CNF-497 in " + FORM_NAME + ".CreateUserComment(): " + ex.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Пример #2
0
        public void IgnoreDocument()
        {            
            try
            {
                using (new CursorBlock(Cursors.WaitCursor))
                {
                    List<InboundDocUserFlagDto> userFlagList = new List<InboundDocUserFlagDto>();
                    foreach (int rowHandle in gridViewInboundDocs.GetSelectedRows())
                    {
                        InboundDocUserFlagDto userFlagData = new InboundDocUserFlagDto();
                        var dr = gridViewInboundDocs.GetDataRow(rowHandle);
                        var inbDocView = CollectionHelper.CreateObjectFromDataRow<InboundDocsView>(dr);
                        var isIgnored = "IGNORE".Equals(inbDocView.IgnoreFlag);

                        userFlagData.InboundDocId = Convert.ToInt32(inbDocView.Id);
                        userFlagData.FlagType = "IGNORE";
                        userFlagData.InboundUser = p_UserId;
                        userFlagData.UpdateDeleteInd = isIgnored ? USER_FLAG_DELETE : USER_FLAG_UPDATE;
                        userFlagList.Add(userFlagData);
                    }

                    SubmitIgnoreDocumentsRequest(userFlagList);
                }
            }
            catch (Exception ex)
            {
                LogAndDisplayException("An error occurred while updating the grid with the Ignore setting." + Environment.NewLine +
                               "Error CNF-500 in " + FORM_NAME + ".IgnoreDocument().", ex);
            }
            finally
            {
                DisplayInboundDocument();                
            }
        }
Пример #3
0
        public void BookmarkDocument()
        {
            DataRow dr = null;
            bool isBookMark = false;
            //userFlagRequest[] requestArray = new userFlagRequest[gridViewInboundDocs.GetSelectedRows().Length];
            //int counter = 0;
            List<InboundDocUserFlagDto> userFlagList = new List<InboundDocUserFlagDto>();
            InboundDocsView inbDocView = null;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                foreach (int rowHandle in gridViewInboundDocs.GetSelectedRows())
                {
                    //userFlagRequest request = new userFlagRequest();
                    InboundDocUserFlagDto userFlagData = new InboundDocUserFlagDto();
                    dr = gridViewInboundDocs.GetDataRow(rowHandle);
                    inbDocView = CollectionHelper.CreateObjectFromDataRow<InboundDocsView>(dr);
                    isBookMark = "BOOKMARK".Equals(inbDocView.BookmarkFlag);

                    //request.inboundDocId = inbDocView.Id;
                    //request.flagType = "BOOKMARK";
                    //request.userName = (inboundWebServices.userName.Text[0]).ToUpper();
                    //if (isBookMark)  
                    //{
                    //    request.updateDeleteFlag = updateUserFlag.Delete;
                    //}
                    //else  
                    //{
                    //    request.updateDeleteFlag = updateUserFlag.Update;
                    //}
                    //request.updateDeleteFlagSpecified = true;
                    //requestArray[counter] = request;
                    //counter++;

                    userFlagData.InboundDocId = Convert.ToInt32(inbDocView.Id);
                    userFlagData.FlagType = "BOOKMARK";
                    userFlagData.InboundUser = p_UserId;
                    if (isBookMark)
                    {
                        userFlagData.UpdateDeleteInd = USER_FLAG_DELETE;
                    }
                    else
                    {
                        userFlagData.UpdateDeleteInd = USER_FLAG_UPDATE;
                    }
                    userFlagList.Add(userFlagData);
                }

                //SubmitBookmarkDocumentsRequest(requestArray);
                SubmitBookmarkDocumentsRequest(userFlagList);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("An error occurred while updating the grid with the bookmark." + Environment.NewLine +
                       "Error CNF-494 in " + FORM_NAME + ".BookmarkDocument(): " + ex.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }