Ejemplo n.º 1
0
        public void AddComment(String strTableName, Guid iID, String strComment)
        {
            if (String.IsNullOrWhiteSpace(strComment))
            {
                return;
            }
            if (DataStructureProvider.IsExistedTable(strTableName) == false)
            {
                return;
            }
            if (BusinessControllerFactory.GetBusinessController(strTableName).GetObjectByID(iID) == null)
            {
                return;
            }

            RefreshTagsString();

            String strCreateUser     = ABCUserProvider.CurrentUserName.Replace("'", "''");
            String strCreateEmployee = ABCUserProvider.CurrentEmployeeName.Replace("'", "''");

            String strQuery = String.Format(@"INSERT INTO GEComments ( GECommentID,CreateTime , CreateUser , Employee , TableName , ID ,Comment,TagString,TagStringDisplay ) 
                                                              VALUES ('{0}',GetDate() ,N'{1}' ,N'{2}' ,'{3}','{4}',N'{5}',N'{6}',N'{7}')", Guid.NewGuid(), strCreateUser.Replace("'", "''"), strCreateEmployee.Replace("'", "''"), strTableName, iID, strComment.Replace("'", "''"), Tags.Replace("'", "''"), TagsDisplay.Replace("'", "''"));

            BusinessObjectController.RunQuery(strQuery);
            NotifyProvider.CreateNewNotifyFromComment(strTableName, iID);
            LoadComments();
            this.gridView.MoveLast();

            this.richEditControl1.Text = "";

            this.tabPanel.ClearTags();
        }
Ejemplo n.º 2
0
        void gridViewNotifies_Click(object sender, EventArgs e)
        {
            Point pt = gridControl1.PointToClient(Control.MousePosition);

            GridHitInfo info = gridViewNotifies.CalcHitInfo(pt);

            if (info != null && info.InRow || info.InRowCell)
            {
                DataRow dr = gridViewNotifies.GetDataRow(info.RowHandle);
                if (dr == null)
                {
                    return;
                }
                dr["Viewed"] = 1;
                NotifyProvider.SetNotifyToViewed(ABCHelper.DataConverter.ConvertToGuid(dr["GENotifyID"]));
                if (dr["TableName"].ToString() == "GEMeetings")
                {
                    ABCScreen.ABCScreenManager.Instance.RunLink("GEMeetings", ABCCommon.ViewMode.Runtime, false, ABCHelper.DataConverter.ConvertToGuid(dr["ID"]), ABCCommon.ABCScreenAction.None);
                }
                else
                {
                    ABCControls.ABCObjectInformation.ShowObjectInfo(dr["TableName"].ToString(), ABCHelper.DataConverter.ConvertToGuid(dr["ID"]));
                }
            }
        }