internal static void FillComment(ObjectComment comment, CommentResult result) { comment.ComId = result.COM_ID; comment.ObjId = result.OBJ_ID; comment.UsrId = result.USR_ID; comment.Username = result.UserName; comment.Text = result.COM_Text; comment.Status = (CommentStatus)result.COM_Status; comment.CreateDate = result.COM_InsertedDate; comment.UpdateDate = result.COM_UpdatedDate; comment.ObjType = result.OBJ_Type; }
public static ObjectComment Load(Guid comId) { ObjectComment comment = new ObjectComment(); try { CSBooster_DataContext cdc = new CSBooster_DataContext(ConfigurationManager.ConnectionStrings["CSBoosterConnectionString"].ConnectionString); CommentResult result = cdc.hisp_Comments_GetComment(comId).ElementAtOrDefault(0); if (result != null) { FillComment(comment, result); } } catch { } return(comment); }
public static ObjectComment Load(Guid comId) { ObjectComment comment = new ObjectComment(); try { CSBooster_DataContext cdc = new CSBooster_DataContext(Helper.GetSiemeConnectionString()); CommentResult result = cdc.hisp_Comments_GetComment(comId).ElementAtOrDefault(0); if (result != null) { FillComment(comment, result); } } catch { } return(comment); }
public static List <ObjectComment> GetComments(Guid?userId, DateTime?createdFrom, DateTime?createdTo, string text, Guid?objectId, string username, string generalSearchParam, int?pageNum, int?pageSize, string sortAttr, string sortDir, out int numberItems) { List <ObjectComment> commentList = new List <ObjectComment>(); int?refNumberItems = null; CSBooster_DataContext cdc = new CSBooster_DataContext(Helper.GetSiemeConnectionString()); var commentResults = cdc.hisp_Comments_GetComments(userId, createdFrom, createdTo, "%" + text + "%", objectId, "%" + username + "%", "%" + generalSearchParam + "%", pageNum, pageSize, sortAttr, sortDir, ref refNumberItems); foreach (CommentResult commentResult in commentResults) { ObjectComment comment = new ObjectComment(); ObjectComment.FillComment(comment, commentResult); commentList.Add(comment); } numberItems = refNumberItems.Value; return(commentList); }