Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        public Insurence Get(int Id)
        {
            List <Insurence> list          = new List <Insurence>();
            Insurence        returnProduct = new Insurence();

            list          = CreateMockData();
            returnProduct = list.Find(p => p.Id == Id);
            return(returnProduct);
        }
Ejemplo n.º 2
0
 protected override void Add()
 {
     IsValid = true;
     Entity  = new Insurence()
     {
         Name = "Enter Name",
     };
     base.Add();
 }
Ejemplo n.º 3
0
        protected override void Delete()
        {
            InsurenceUOW manager = new InsurenceUOW();
            Insurence    bank    = new Insurence();

            bank.Id = Convert.ToInt32(EventArgument);
            manager.Delete(bank);
            Get();
            base.Delete();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Update(Insurence entity)
        {
            bool returnValue = false;
            var  returnData  = Validate(entity);

            if (returnValue)
            {
                //Crete the update Code
            }
            return(returnValue);
        }
Ejemplo n.º 5
0
        public bool Insert(BaseEntity entity)
        {
            Insurence insurence = entity as Insurence;
            bool      ret       = false;

            ret = Validate(insurence);
            if (ret)
            {
                //Create Insert Statement
            }
            return(ret);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public List <Insurence> Get(Insurence entity)
        {
            List <Insurence> returnData = new List <Insurence>();

            returnData = GetData();

            if (entity != null && !string.IsNullOrEmpty(entity.Name))
            {
                returnData = returnData.FindAll(p => p.Name.ToLower().StartsWith(
                                                    entity.Name.ToLower()));
            }
            return(returnData);
        }
Ejemplo n.º 7
0
        public bool Validate(BaseEntity entity)
        {
            Insurence insurence = entity as Insurence;

            validationError.Clear();
            if (string.IsNullOrEmpty(insurence.Name))
            {
                if (insurence.Name.ToLower() == insurence.Name)
                {
                    validationError.Add(new KeyValuePair <string, string>("InsurenceName", "Insurence Name must not be all in Lower case"));
                }
            }
            return(validationError.Count == 0);
        }
Ejemplo n.º 8
0
 protected override void ResetSearch()
 {
     SearchENtity = new Insurence();
 }
Ejemplo n.º 9
0
 public InsurenceViewModel() : base()
 {
     Insurences = new List <Insurence>();
     Entity     = new Insurence();
     Get();
 }