using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35; using Ease.CoreV35.Model; using Ease.CoreV35.Caching; using System.Data.Linq.Mapping; namespace Payroll.BO { #region CarFuelProcessDetailItem [Serializable] public class CarFuelProcessDetailItem : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(CarFuelProcessDetailItem)); #endregion #region Constructor public CarFuelProcessDetailItem() { _changeNetAmount = 0; _description = string.Empty; _netAmount = 0; _taxAmount = 0; _CarFuelItemID = null; _CarFuelProcessDetailID = null; _CarFuelType = EnumCarFuelType.Provision; } #endregion #region Properties #region ChangeNetAmount : double private double _changeNetAmount; public double ChangeNetAmount { get { return _changeNetAmount; } set { base.OnPropertyChange("changenetamount", _changeNetAmount, value); _changeNetAmount = value; } } #endregion #region Description : string private string _description; public string Description { get { return _description; } set { base.OnPropertyChange("description", _description, value); _description = value; } } #endregion #region NetAmount : double private double _netAmount; public double NetAmount { get { return _netAmount; } set { base.OnPropertyChange("netamount", _netAmount, value); _netAmount = value; } } #endregion #region Paramter: Paramter private CarFuelParameter _paramter; public CarFuelParameter Paramter { get { return _paramter; } set { _paramter = value; } } #endregion #region CarFuelItemID : ID private ID _CarFuelItemID; public ID CarFuelItemID { get { return _CarFuelItemID; } set { base.OnPropertyChange("CarFuelitemid", _CarFuelItemID, value); _CarFuelItemID = value; } } #endregion #region CarFuelProcessDetailID : ID private ID _CarFuelProcessDetailID; public ID CarFuelProcessDetailID { get { return _CarFuelProcessDetailID; } set { base.OnPropertyChange("CarFuelprocessdetailid", _CarFuelProcessDetailID, value); _CarFuelProcessDetailID = value; } } #endregion #region CarFuelType : EnumCarFuelType private EnumCarFuelType _CarFuelType; public EnumCarFuelType CarFuelType { get { return _CarFuelType; } set { base.OnPropertyChange("_CarFueltype", (short)_CarFuelType, (short)value); _CarFuelType = value; } } #endregion #region TaxAmount : double private double _taxAmount; public double TaxAmount { get { return _taxAmount; } set { base.OnPropertyChange("taxamount", _taxAmount, value); _taxAmount = value; } } #endregion #region Service Factory ICarFuelProcessDetailItemService : ICarFuelProcessDetailItemService internal static ICarFuelProcessDetailItemService Service { get { return Services.Factory.CreateService(typeof(ICarFuelProcessDetailItemService)); } } #endregion #endregion #region Functions public static CarFuelProcessDetailItem Get(ID nCarFuelProcessDetailItemID) { CarFuelProcessDetailItem oCarFuelProcessDetailItem = null; #region Cache Header oCarFuelProcessDetailItem = (CarFuelProcessDetailItem)_cache["Get", nCarFuelProcessDetailItemID]; if (oCarFuelProcessDetailItem != null) return oCarFuelProcessDetailItem; #endregion oCarFuelProcessDetailItem = CarFuelProcessDetailItem.Service.Get(nCarFuelProcessDetailItemID); #region Cache Footer _cache.Add(oCarFuelProcessDetailItem, "Get", nCarFuelProcessDetailItemID); #endregion return oCarFuelProcessDetailItem; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate oCarFuelProcessDetailItems = _cache["Get"] as ObjectsTemplate; if (oCarFuelProcessDetailItems != null) return oCarFuelProcessDetailItems; #endregion try { oCarFuelProcessDetailItems = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(oCarFuelProcessDetailItems, "Get"); #endregion return oCarFuelProcessDetailItems; } public ID Save() { this.SetAuditTrailProperties(); return CarFuelProcessDetailItem.Service.Save(this); } public void Delete(ID id) { CarFuelProcessDetailItem.Service.Delete(id); } #endregion } #endregion #region ICarFuelProcessDetailItem Service public interface ICarFuelProcessDetailItemService { CarFuelProcessDetailItem Get(ID id); ObjectsTemplate Get(); ID Save(CarFuelProcessDetailItem item); void Delete(ID id); } #endregion }