Beispiel #1
0
        /// <summary>
        /// Saves a record to the Employee table.
        /// </summary>
        private DynamicParameters Param(Project_CommentEntity project_comment, string action = "add")
        {
            var p = new DynamicParameters();

            if (action == "add")
            {
                p.Add("@Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
                p.Add("@CreateDate", project_comment.CreateDate);
            }
            else
            {
                p.Add("@Id", project_comment.Id);
                p.Add("@ModifiedDate", project_comment.ModifiedDate);
            }
            p.Add("@ParentId", project_comment.ParentId);
            p.Add("@ProjectId", project_comment.ProjectId);
            p.Add("@UserId", project_comment.UserId);
            p.Add("@FullName", project_comment.FullName);
            p.Add("@Description", project_comment.Description);


            p.Add("@IsDel", project_comment.IsDel);

            return(p);
        }
Beispiel #2
0
        public int Insert(Project_CommentEntity project_comment)
        {
            int  res  = 0;
            bool flag = false;

            try
            {
                var p = Param(project_comment);
                flag = (bool)unitOfWork.ProcedureExecute("ptgroup_Project_Comment_Insert", p);
                if (flag)
                {
                    res = p.Get <int>("@Id");
                }
                else
                {
                    res = 0;
                }
            }
            catch (Exception ex)
            {
                Logging.PutError(ex.Message, ex);
                throw;
            }
            return(res);
        }
Beispiel #3
0
        ///Update

        public bool Update(Project_CommentEntity project_comment)
        {
            bool res = false;

            try
            {
                var p = Param(project_comment, "edit");
                res = (bool)unitOfWork.ProcedureExecute("ptgroup_Project_Comment_Update", p);
                return(res);
            }
            catch (Exception ex)
            {
                Logging.PutError(ex.Message, ex);
                throw;
            }
        }