示例#1
0
        /// <summary>
        /// Gets the name of the file.
        /// </summary>
        private void GetFileName()
        {
            CommentsData configDetailsDataSet = new CommentsData();

            configDetailsDataSet = WSHelper.GetConfigDetails("TS_HelpFiles");
            this.tempFilePath    = configDetailsDataSet.GetCommentsConfigDetails.Rows[0][configDetailsDataSet.GetCommentsConfigDetails.ConfigurationValueColumn].ToString();
        }
示例#2
0
        /// <summary>
        /// Inits the get closed date.
        /// </summary>
        private void InitGetClosedDate()
        {
            CommentsData getYearDataSet = new CommentsData();

            getYearDataSet            = this.Form1201Control.WorkItem.GetConfigDetails("TR_ClosingDate");
            this.ClosedDateLabel.Text = getYearDataSet.GetCommentsConfigDetails.Rows[0][getYearDataSet.GetCommentsConfigDetails.ConfigurationValueColumn].ToString();
        }
示例#3
0
        public IActionResult Index(int teamId)
        {
            _logger.LogInformation("entered Comments controller");
            CommentsData commentsData = this._commentsRepository.GetCommentsData(teamId);

            return(View(commentsData));
        }
示例#4
0
        /// <summary>
        /// Gets the comments based on the keyid, formid.
        /// </summary>
        /// <param name="keyId">The key id.</param>
        /// <param name="formId">The form id.</param>
        /// <returns>The dataset containing the comment and priority.</returns>
        public static CommentsData F9075_GetComment(int keyId, int formId)
        {
            CommentsData commentsData = new CommentsData();
            Hashtable    ht           = new Hashtable();

            ht.Add("@KeyID", keyId);
            ht.Add("@Form", formId);
            Utility.LoadDataSet(commentsData.GetComments, "f9075_pcget_Comment", ht);
            return(commentsData);
        }
示例#5
0
        /// <summary>
        /// Gets the comments based on the keyid, formid and userid.
        /// </summary>
        /// <param name="configName">Name of the config.</param>
        /// <returns>The dataset containing the comments.</returns>
        public static CommentsData GetConfigDetails(string configName)
        {
            CommentsData commentsData = new CommentsData();
            Hashtable    ht           = new Hashtable();

            ht.Add("@CfgName", configName);
            Utility.LoadDataSet(commentsData.GetCommentsConfigDetails, "f9020_pcget_Configuration", ht);
            return(commentsData);

            ////return DataProxy.FetchDataSet("f9020_pcget_Configuration", ht);
        }
示例#6
0
        /// <summary>
        /// Gets the comments count.
        /// </summary>
        /// <param name="formId">The form id.</param>
        /// <param name="keyId">The key id.</param>
        /// <param name="userId">The user id.</param>
        /// <returns>The typed dataset having count of comments.</returns>
        public static CommentsData GetCommentsCount(int formId, int keyId, int userId)
        {
            CommentsData commentsData = new CommentsData();
            Hashtable    ht           = new Hashtable();

            ht.Add("@Form", formId);
            ht.Add("@KeyID", keyId);
            ht.Add("@UserID", userId);
            Utility.LoadDataSet(commentsData.GetCommentsCount, "f9075_pcget_CommentsCount", ht);
            return(commentsData);
            ////return DataProxy.FetchSPOutput("f9075_pcget_CommentsCount", ht);
        }
示例#7
0
        protected static UserComment BuildUserCommentObject(CommentsData info)
        {
            var comment = new UserComment {
                Comment      = info.Comment,
                Created      = info.Created,
                IDSubtitle   = info.IDSubtitle,
                UserID       = info.UserID,
                UserNickName = info.UserNickName
            };

            return(comment);
        }
示例#8
0
        /// <summary>
        /// Gets the config roll year.
        /// </summary>
        private void GetConfigRollYear()
        {
            CommentsData.GetCommentsConfigDetailsRow rollYearRow;
            this.getRollYearConfigurationValue.GetCommentsConfigDetails.Clear();
            this.getRollYearConfigurationValue = this.form15050Control.WorkItem.GetConfigDetails("TR_RollYear");

            if (this.getRollYearConfigurationValue.GetCommentsConfigDetails.Rows.Count > 0)
            {
                rollYearRow = (CommentsData.GetCommentsConfigDetailsRow) this.getRollYearConfigurationValue.GetCommentsConfigDetails.Rows[0];

                int.TryParse(rollYearRow.ConfigurationValue, out this.rollYear);
            }
        }
示例#9
0
文件: F1505.cs 项目: CSSAdmin/TScan
        // TO IMPLEMENT CO:TFS 8095 – Provide Year default for 1102 when called from 11002.
        /// <summary>
        /// GET THE ROLL YEAR
        /// </summary>
        private int GetYear()
        {
            CommentsData getYearDataSet = new CommentsData();

            getYearDataSet = this.form1505Control.WorkItem.GetConfigDetails("TR_RollYear");
            int tempRollYear = -1;

            int.TryParse(getYearDataSet.GetCommentsConfigDetails.Rows[0][getYearDataSet.GetCommentsConfigDetails.ConfigurationValueColumn].ToString(), out tempRollYear);
            if (tempRollYear.Equals(0))
            {
                MessageBox.Show(SharedFunctions.GetResourceString("InvalidFieldYear"), "TerraScan T2", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(tempRollYear);
        }
示例#10
0
        public CommentsData GetCommentsData(int teamEntityId)
        {
            CommentsData commentsData = new CommentsData();
            Team         team         = _teamRepository.AllTeams.Where(x => x.EntityId == teamEntityId).First();

            commentsData.TeamName         = team.NickName;
            commentsData.TeamLocation     = team.LocationName;
            commentsData.LogoImage        = team.LogoImage;
            commentsData.Comments         = this.GetComments(team.EntityId);
            commentsData.NumberOfComments = commentsData.Comments.Count;



            return(commentsData);
        }
示例#11
0
        public NotificationAboutBox()
        {
            InitializeComponent();

            CommentsData getPrivacyStmt = new CommentsData();

            getPrivacyStmt = LoginController.LoginConfigDetails("TS_PrivacyStmtURL");
            if (getPrivacyStmt.GetCommentsConfigDetails.Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(getPrivacyStmt.GetCommentsConfigDetails.Rows[0][getPrivacyStmt.GetCommentsConfigDetails.ConfigurationValueColumn].ToString()))
                {
                    getPrivacyNotification = Convert.ToString(getPrivacyStmt.GetCommentsConfigDetails.Rows[0][getPrivacyStmt.GetCommentsConfigDetails.ConfigurationValueColumn]);
                }
            }
        }
示例#12
0
        /// <summary>
        /// 插入评论
        /// </summary>
        /// <param name="rData"></param>
        /// <returns></returns>
        private int InsertComments(CommentsData rData)
        {
            string puid       = rData.puid ?? string.Empty;
            string sourceId   = rData.srcid ?? string.Empty;
            string content    = rData.content ?? string.Empty;
            string sourceType = rData.type ?? string.Empty;
            string url        = rData.url ?? string.Empty;
            int    us_id      = int.Parse(rData.us_id);
            string us_name    = rData.us_name;

            CommentInfo cmt = new CommentInfo();

            cmt.cmt_accept       = 0;
            cmt.cmt_checkRemark  = string.Empty;
            cmt.cmt_checkTime    = string.Empty;
            cmt.cmt_checkUser    = string.Empty;
            cmt.cmt_content      = content;
            cmt.cmt_createTime   = DateTime.Now;
            cmt.cmt_createUser   = us_name;
            cmt.cmt_createUserID = us_id;
            cmt.cmt_id           = 0;

            OperationContext              context           = OperationContext.Current;
            MessageProperties             messageProperties = context.IncomingMessageProperties;
            RemoteEndpointMessageProperty endpointProperty  =
                messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

            cmt.cmt_ip = endpointProperty.Address;

            cmt.cmt_ipArea     = string.Empty;
            cmt.cmt_parentIds  = string.Empty;
            cmt.cmt_sourceId   = sourceId;
            cmt.cmt_sourceType = sourceType;
            cmt.cmt_status     = 1;
            cmt.cmt_title      = string.Empty;
            cmt.cmt_uid        = GetCmtUID(sourceId);

            cmt.cmt_sourceCateId = rData.cmt_sourceCateId;
            cmt.cmt_platform     = rData.cmt_platform;
            cmt.cmt_device       = rData.cmt_device;
            cmt.cmt_title        = rData.cmt_title;

            return(DataAccess_News.Comments_Insert(cmt, puid, url));
        }
示例#13
0
        /// <summary>
        /// Handles the Click event of the NewDatasetButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NewDatasetButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.TemplateNameCombo.SelectedIndex > 0)
                {
                    RegistryKey regClasses = Registry.ClassesRoot;
                    //// Check whether Microsoft Excel is installed on this computer,
                    //// by searching the HKEY_CLASSES_ROOT\Excel.Application key.
                    RegistryKey regExcel = regClasses.OpenSubKey("Excel.Application");
                    if (regExcel != null)
                    {
                        this.myapplication = new Excel.Application();

                        //// Checking for the Excel version
                        this.excelversion = this.myapplication.Version;
                        decimal installedExcelVersion = 0;

                        if (!string.IsNullOrEmpty(this.excelversion))
                        {
                            decimal.TryParse(this.excelversion, out installedExcelVersion);
                        }

                        //if (this.excelversion.Trim().Equals("12.0"))
                        //{
                        if (installedExcelVersion >= 12)
                        {
                            //// Getting the folder path and the template file
                            CommentsData excelDataSet = new CommentsData();
                            excelDataSet = this.form9042Control.WorkItem.GetConfigDetails("TS_ATemplateRoot");
                            if (excelDataSet.Tables.Count > 0 && excelDataSet.Tables[excelDataSet.GetCommentsConfigDetails.TableName].Rows.Count > 0)
                            {
                                this.templatePath = excelDataSet.GetCommentsConfigDetails.Rows[0][excelDataSet.GetCommentsConfigDetails.ConfigurationValueColumn].ToString() + "\\" + this.templateFile + ".xltm";
                                if (!string.IsNullOrEmpty(this.templatePath) && System.IO.File.Exists(this.templatePath))
                                {
                                    this.myapplication.Visible = true;

                                    //// Opening a workbook with template assigned from a specific location
                                    this.wb = (Excel.Workbook)(this.myapplication.Workbooks.Add(this.templatePath));

                                    //// Getting the value from the DB for Connection String
                                    excelDataSet = this.form9042Control.WorkItem.GetConfigDetails("TS_AConnStr");
                                    if (excelDataSet.Tables.Count > 0 && excelDataSet.Tables[excelDataSet.GetCommentsConfigDetails.TableName].Rows.Count > 0)
                                    {
                                        this.connectionString = excelDataSet.GetCommentsConfigDetails.Rows[0][excelDataSet.GetCommentsConfigDetails.ConfigurationValueColumn].ToString();
                                    }

                                    this.templateName       = this.TemplateNameCombo.Text.ToString();
                                    this.templateDefinition = this.DefinitionTextBox.Text;
                                    this.templatePurpose    = this.PurposeTextBox.Text;
                                    this.username           = TerraScanCommon.UserName;
                                    this.title       = this.TitleTextBox.Text;
                                    this.description = this.DescriptionTextBox.Text;

                                    //// Back Ground thread invoke process
                                    backGroundWork                     = new BackgroundWorker();
                                    backGroundWork.DoWork             += new DoWorkEventHandler(this.BackGroundWorkDoWork);
                                    backGroundWork.ProgressChanged    += new ProgressChangedEventHandler(this.BackGroundWorkProgressChanged);
                                    backGroundWork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.BackGroundWorkRunWorkerCompleted);
                                    backGroundWork.RunWorkerAsync();

                                    this.job    = new ThreadStart(this.ThreadJob);
                                    this.thread = new Thread(this.job);
                                    this.thread.IsBackground = false;
                                    this.thread.Start();
                                    this.Close();
                                }
                                else
                                {
                                    ////Template file not found
                                    ErrorEngine.ShowForm(13, this.templatePath);
                                }
                            }
                            else
                            {
                                ////Path not found
                                ErrorEngine.ShowForm(14);  //// if TS_ATemplateRoot doesnot exit
                            }
                        }
                        else
                        {
                            ////Excel version not found
                            ErrorEngine.ShowForm(12);
                        }

                        //else
                        //{
                        //    ////Excel version not found
                        //    ErrorEngine.ShowForm(12);
                        //}
                    }
                    else
                    {
                        MessageBox.Show(SharedFunctions.GetResourceString("ExcelNotFound"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(SharedFunctions.GetResourceString("SelectTemplateName"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
        }
示例#14
0
 public PreviewPage(IWebDriver driver) : base(driver)
 {
     CommentsData = new CommentsData(Driver);
 }
示例#15
0
文件: F25090.cs 项目: CSSAdmin/TScan
        private void Photosbutton_Click(object sender, EventArgs e)
        {
            if (this.FieldData.PhotosData != null)
            {
                if (this.FieldData.PhotosData.Rows.Count > 0)
                {
                    this.FieldData.PhotosData.Rows.Clear();
                }
            }
            if (AttachFileDataTable != null)
            {
                AttachFileDataTable.Rows.Clear();
            }
            if (FileDataTable != null)
            {
                FileDataTable.Rows.Clear();
            }
            this.SummaryButton.Image         = global::D20000.Properties.Resources.summer1;
            this.Salesbutton.Image           = global::D20000.Properties.Resources.sales1;
            this.Permitsbutton.Image         = global::D20000.Properties.Resources.Permits1;
            this.Photosbutton.Image          = global::D20000.Properties.Resources.Photos;
            this.Correctionbutton.Image      = global::D20000.Properties.Resources.Corrections1;
            this.Ancestrybutton.Image        = global::D20000.Properties.Resources.ancestry1;
            this.Historybutton.Image         = global::D20000.Properties.Resources.history1;
            this.ParcelOwnershipbutton.Image = global::D20000.Properties.Resources.ownership1;
            this.FieldData = this.form25090Control.WorkItem.F25090_GetPhotos(this.keyId, 30000);
            if (this.FieldData != null)
            {
                if (FileDataTable.Columns.Count.Equals(0))
                {
                    FileDataTable.Columns.Add(AttachFilePath);
                }
                if (AttachFileDataTable.Columns.Count.Equals(0))
                {
                    AttachFileDataTable.Columns.Add(FileID);
                    AttachFileDataTable.Columns.Add(EventDate);
                    AttachFileDataTable.Columns.Add(FunctionName);
                    AttachFileDataTable.Columns.Add(DescriptName);
                    AttachFileDataTable.Columns.Add(Extension);
                }
                AttachFileDataTable = this.FieldData.PhotosData;

                if (this.FieldData.PhotosData.Rows.Count > 0)
                {
                    if (AttachFileDataTable.Rows.Count > 0)
                    {
                        //Used for the Attachment Path Creation
                        for (int j = 0; j < AttachFileDataTable.Rows.Count; j++)
                        {
                            DataRow fileAttachRow = FileDataTable.NewRow();
                            int     fileId;
                            int.TryParse(AttachFileDataTable.Rows[j][3].ToString(), out fileId);
                            string FileAttachID    = this.form25090Control.WorkItem.GetOriginalFilePath(fileId, TerraScanCommon.UserId);
                            string CentralApexPath = string.Empty;
                            string fieldLocalPath  = string.Empty;

                            CommentsData serverFilePathData = this.form25090Control.WorkItem.GetudfConfigurationFile();
                            CentralApexPath = serverFilePathData.GetCommentsConfigDetails[0][0].ToString();
                            if (TerraScanCommon.IsFieldUser)
                            {
                                fieldLocalPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\TerraScan Attachment\";
                                FileAttachID   = FileAttachID.Replace(CentralApexPath, fieldLocalPath);
                                // Path1 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                                if (String.IsNullOrEmpty(FileAttachID))
                                {
                                }
                                else
                                {
                                    FileInfo photoFile = new FileInfo(FileAttachID);
                                    {
                                        if (photoFile.Exists)
                                        {
                                        }
                                        else
                                        {
                                            FileInfo fieldUpdatedPAth = new FileInfo(FileAttachID.Replace(fieldLocalPath, fieldLocalPath + @"\IsFieldAdded\"));
                                            if (fieldUpdatedPAth.Exists)
                                            {
                                                FileAttachID = FileAttachID.Replace(fieldLocalPath, fieldLocalPath + @"\IsFieldAdded\");
                                            }
                                        }
                                    }
                                }
                            }
                            fileAttachRow[0] = FileAttachID;
                            FileDataTable.Rows.Add(fileAttachRow);
                            FileDataTable.AcceptChanges();
                        }
                    }
                }


                ///Used to populate Path
                this.PopulatePhotosUserControll();
            }
        }
 public CommentsPresenter(ICommentsView view)
 {
     this.view  = view;
     this.cData = new CommentsData();
     this.eData = new EntityData();
 }
示例#17
0
        /// <summary>
        /// 发表评论
        /// </summary>
        /// <param name="rData"></param>
        /// <returns></returns>
        public Stream CommentAdd(CommentsData rData)
        {
            // 得到上下文
            WebOperationContext woc = WebOperationContext.Current;

            //设置响应格式,消除了返回为string的有反斜杠情况
            woc.OutgoingResponse.ContentType = "application/json; charset=utf-8";

            string sourceId = rData.srcid ?? string.Empty;
            string content  = rData.content ?? string.Empty;
            int    us_id    = int.Parse(rData.us_id);
            string json     = "";

            if (us_id <= 0)
            {
                json = Util.GetResultStr("请登录后再评论!");
                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }
            string cacheName = "UserBlack_" + us_id.ToString();
            object o         = CacheHelper.Cache_Get(cacheName);

            if (o != null)
            {
                try
                {
                    int bl_status = (int)o;
                    if ((bl_status & (int)SiteBlackStatus.评论) > 0)
                    {
                        json = Util.GetResultStr("评论失败:禁止评论!");
                    }
                    return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
                }
                catch
                {
                }
            }

            if (sourceId == string.Empty)
            {
                json = Util.GetResultStr("评论失败:参数错误!");
                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }

            if (content == string.Empty)
            {
                json = Util.GetResultStr("评论失败:请输入评论内容!");
                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }

            if (content.Length > 800)
            {
                json = Util.GetResultStr("评论失败:评论内容超过800个字!");
                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }

            // 过滤危险字符,以防脚本攻击
            content = content.ToPure().ToText();
            MatchCollection matches = Regex.Matches(content, "http://");

            if (matches != null && matches.Count > 2)
            {
                json = Util.GetResultStr("评论失败:非法的评论内容!");
                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }

            int relt = InsertComments(rData);

            if (relt > 0)
            {
                json = Util.GetResultStr("评论成功!", "true");


                try
                {
                    UserInfo user = DataAccess.User_FromId_Select_2(us_id);
                    if (user != null)
                    {
                        user.u_total_exp += 10;       // 奖励10个积分

                        DataAccess.User_Update(user); // 更新用户信息
                    }
                }
                catch
                {
                }


                return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
            }

            json = Util.GetResultStr("评论失败:请稍许再提交!");
            return(new MemoryStream(Encoding.UTF8.GetBytes(json)));
        }