using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Model; namespace Payroll.BO { [Serializable] public class PMPRating : BasicBaseObject { #region Constructor public PMPRating() { this._name = string.Empty; this._ratingvalue = string.Empty; ; } #endregion #region Properties #region Name : string private string _name; public string Name { get { return _name; } set { _name = value; } } #endregion #region RatingValue : string private string _ratingvalue; public string RatingValue { get { return _ratingvalue; } set { _ratingvalue = value; } } #endregion #region DummyId public int? ObjectId { get { if (!ID.IsUnassigned) return ID.Integer; return null; } } #endregion #endregion #region Service Factory IPMPRatingService : IPMPRatingService internal static IPMPRatingService Service { get { return Services.Factory.CreateService(typeof(IPMPRatingService)); } } #endregion public string[] InputValidator() { string[] sErrorString = new string[2]; if (this.RatingValue == "") { sErrorString[0] = "Rating Value can not be empty"; sErrorString[1] = "RatingValue"; return sErrorString; } if (this.Name == null) { sErrorString[0] = "Name can not be empty"; sErrorString[1] = "Name"; return sErrorString; } sErrorString = null; return sErrorString; } #region Functions #region Get By Status public static ObjectsTemplate Get(EnumStatus status) { return PMPRating.Service.Get(EnumStatus.Regardless); } #endregion #region Save public ID Save() { this.SetAuditTrailProperties(); return PMPRating.Service.Save(this); } #endregion #region Get By Id public static PMPRating GetById(ID id) { return PMPRating.Service.GetById(id); } #endregion #region Delete public static void Delete(ID id) { PMPRating.Service.Delete(id); } #endregion #endregion } #region IPMPRating Service public interface IPMPRatingService { ObjectsTemplate< PMPRating > Get(EnumStatus status); PMPRating GetById(ID id); void Delete(ID id); ID Save(PMPRating pMPRating); } #endregion }