using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;

namespace CafeTerrace.Models.DataBase
{
    public class Rate
    {

        public string FoodId { get; set; }
        public int UserId { get; set; }

        public float Point { get; set; }
        public DateTime Register { get; set; }
        public string Description { get; set; }
        public string UserName { get; set; }

        public String PersianRegister
        {
            get
            {
                PersianCalendar pc = new PersianCalendar();
                return string.Format("{0}/{1}/{2}", pc.GetYear(Register), pc.GetMonth(Register), pc.GetDayOfMonth(Register));
            }
        }
        public string Name
        {
            get
            {
                if (User == null)
                    return "کاربرمهمان";
                else if (User.FullName.Contains("تراس"))
                    return "کاربرمهمان";
                else
                    return User.FullName;
            }
        }

        public virtual Food Food { get; set; }
        public virtual User User { get; set; }
    }
}
