/// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>Returns a string that represents the current object.</returns> public override string ToString() { var sb = new StringBuilder(); sb.AppendFormat("ExtensionSize : {0}\r\n", ExtensionSize); sb.AppendFormat("AuthorName : {0}\r\n", AuthorName.TrimEnd('\0')); sb.AppendFormat("AuthorComments : {0}\r\n", AuthorComments.TrimEnd('\0')); if (TimeStamp.HasValue) { sb.AppendFormat("TimeStamp : {0:yyyy/MM/dd HH:mm:ss}\r\n", TimeStamp.Value); } else { sb.AppendLine("TimeStamp : not specified"); } sb.AppendFormat("Job Name/ID : {0}\r\n", JobNameID.TrimEnd('\0')); sb.AppendFormat("JobTime : {0:hh\\:mm\\:ss}\r\n", JobTime); sb.AppendFormat("SoftwareID : {0}\r\n", SoftwareID); sb.AppendFormat("SoftwareVersion : {0}\r\n", SoftwareVersion); sb.AppendFormat("KeyColor : #{0:X08}\r\n", KeyColor); if (PixelAspectRatioHeight != 0) { sb.AppendFormat("PixelAspectRatio : {0}:{1}\r\n", PixelAspectRatioWidth, PixelAspectRatioHeight); } else { sb.AppendLine("PixelAspectRatio : not specified"); } if (GammaDenominator != 0) { sb.AppendFormat("GammaValue : {0:0.0}\r\n", GammaNumerator / ((double)GammaDenominator)); } else { sb.AppendLine("GammaValue : not specified"); } sb.AppendFormat("ColorCorrectionOffset: {0}\r\n", ColorCorrectionOffset); sb.AppendFormat("PostageStampOffset : {0}\r\n", PostageStampOffset); sb.AppendFormat("ScanLineOffset : {0}\r\n", ScanLineOffset); sb.AppendFormat("AttributesType : {0}\r\n", AttributesType); return(sb.ToString()); }
public ActionResult CommentAuthor(int id, string _point, string _comment) { try { Authors author = db.Authors.Find(id); User user = db.Users.Where(x => x.USERNAME == User.Identity.Name).FirstOrDefault(); AuthorComments new_comment = new AuthorComments(); new_comment.AUTHOR = author; new_comment.USER = user; new_comment.COMMENT = _comment; new_comment.POINT = Convert.ToInt32(_point); db.AuthorComments.Add(new_comment); db.SaveChanges(); return(RedirectToAction("TheAuthor", new { id = author.AUTHOR_ID })); } catch (Exception) { return(HttpNotFound()); } }