Example #1
0
        /// <summary>
        /// Gets the medical items.
        /// </summary>
        public IQueryable <MedicalItem> GetMedicalItems()
        {
            this.entities = new UmehlukoEntities1();

            return(from medicalItem in this.entities.MedicalItems
                   //where medicalItem.ItemCode == itemCode
                   select medicalItem);
        }
        /// <summary>
        /// Gets the medical items.
        /// </summary>
       public IQueryable<MedicalItem> GetMedicalItems()
        {
            this.entities = new UmehlukoEntities1();

             return from medicalItem in this.entities.MedicalItems
                   //where medicalItem.ItemCode == itemCode
                   select medicalItem;
        }
        /// <summary>
        /// Gets the tariff.
        /// </summary>
        /// <param name="itemcode">The itemcode.</param>
        /// <returns></returns>
        public Tariff GetTariff(string itemcode)
        {
            if (this.entities == null)
            {
                this.entities = new UmehlukoEntities1();
            }

            return (from tariff in this.entities.Tariffs where tariff.ItemCode == itemcode select tariff).FirstOrDefault();
        }
        /// <summary>
        /// Determines whether [is tariff exists] [the specified item code].
        /// </summary>
        /// <param name="itemCode">The item code.</param>
        /// <param name="tariffBaseUnitCost">The tariff base unit cost.</param>
        /// <returns></returns>
        public static bool IsTariffExists(string itemCode, TariffBaseUnitCost  tariffBaseUnitCost)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            return entities.Tariffs.Any(t => t.ItemCode == itemCode && t.TariffBaseUnitCostID == tariffBaseUnitCost.TariffBaseUnitCostID);
        }
Example #5
0
        /// <summary>
        /// Gets the tariff.
        /// </summary>
        /// <param name="itemcode">The itemcode.</param>
        /// <returns></returns>
        public Tariff GetTariff(string itemcode)
        {
            if (this.entities == null)
            {
                this.entities = new UmehlukoEntities1();
            }

            return((from tariff in this.entities.Tariffs where tariff.ItemCode == itemcode select tariff).FirstOrDefault());
        }
        /// <summary>
        /// Determines whether [is tariff exists] [the specified item code].
        /// </summary>
        /// <param name="itemCode">The item code.</param>
        /// <param name="tariffBaseUnitCost">The tariff base unit cost.</param>
        /// <returns></returns>
        public static bool IsTariffExists(string itemCode, TariffBaseUnitCost tariffBaseUnitCost)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            return(entities.Tariffs.Any(t => t.ItemCode == itemCode && t.TariffBaseUnitCostID == tariffBaseUnitCost.TariffBaseUnitCostID));
        }
        /// <summary>
        /// Gets the tariff.
        /// </summary>
        /// <param name="startYearAndMonth">The start year and month.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="tariffAction">The tariff action.</param>
        /// <returns></returns>
        public IQueryable<Tariff> GetTariff(string startYearAndMonth, string fileName, TariffAction tariffAction)
        {
            this.entities = new UmehlukoEntities1();

            var startDate = DateTime.ParseExact(startYearAndMonth, Constant.DateFormat, null);

            return from tariff in this.entities.Tariffs
                   where tariff.ValidFrom == startDate && tariff.TariffTypeID == Constant.CoidTariffTypeId
                   select tariff;
        }
Example #8
0
        /// <summary>
        /// Gets the tariff.
        /// </summary>
        /// <param name="startYearAndMonth">The start year and month.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="tariffAction">The tariff action.</param>
        /// <returns></returns>
        public IQueryable <Tariff> GetTariff(string startYearAndMonth, string fileName, TariffAction tariffAction)
        {
            this.entities = new UmehlukoEntities1();

            var startDate = DateTime.ParseExact(startYearAndMonth, Constant.DateFormat, null);

            return(from tariff in this.entities.Tariffs
                   where tariff.ValidFrom == startDate && tariff.TariffTypeID == Constant.CoidTariffTypeId
                   select tariff);
        }
        /// <summary>
        /// The is medical item exists.
        /// </summary>
        /// <param name="itemCode">
        /// The item Code.
        /// </param>
        /// <param name="description">
        /// The description.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="source"/> or <paramref name="predicate"/> is null.
        /// </exception>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public static bool IsMedicalItemExists(string itemCode)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            return entities.MedicalItems.Any(m => (m.ItemCode == itemCode));

            /* return
                entities.MedicalItems.Any(
                    m =>
                    (m.ItemCode == itemCode)
                    && (m.Name.Equals(description, StringComparison.InvariantCultureIgnoreCase) || description.ToUpper().Contains(m.Name.ToUpper())));*/
        }
        /// <summary>
        /// The is medical item exists.
        /// </summary>
        /// <param name="itemCode">
        /// The item Code.
        /// </param>
        /// <param name="description">
        /// The description.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="source"/> or <paramref name="predicate"/> is null.
        /// </exception>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public static bool IsMedicalItemExists(string itemCode)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            return(entities.MedicalItems.Any(m => (m.ItemCode == itemCode)));

            /* return
             *  entities.MedicalItems.Any(
             *      m =>
             *      (m.ItemCode == itemCode)
             *      && (m.Name.Equals(description, StringComparison.InvariantCultureIgnoreCase) || description.ToUpper().Contains(m.Name.ToUpper())));*/
        }
Example #11
0
        /// <summary>
        /// The dispose.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (this.disposed)
            {
                return;
            }

            if (disposing)
            {
                this.entities.Dispose();
                this.entities = null;
            }

            // Free any unmanaged objects here.
            this.disposed = true;
        }
        /// <summary>
        /// Gets the tbuc.
        /// </summary>
        /// <param name="correctName">Name of the correct.</param>
        /// <param name="startYearAndMonth">The start year and month.</param>
        /// <returns></returns>
        public static TariffBaseUnitCost GetTbuc(string correctName, string startYearAndMonth)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            correctName = correctName.ToUpper();

            return
                entities.TariffBaseUnitCosts.FirstOrDefault(
                    baseUnitCost =>
                    (baseUnitCost.Name.ToUpper().Contains(correctName)
                     || correctName.Contains(
                         baseUnitCost.Name.Substring(baseUnitCost.Name.IndexOf('-') + 2).Trim().ToUpper())));

            // && baseUnitCost.ValidFrom.GetFormatedDate().Equals(startYearAndMonth));
        }
        /// <summary>
        /// Gets the tbuc.
        /// </summary>
        /// <param name="correctName">Name of the correct.</param>
        /// <param name="startYearAndMonth">The start year and month.</param>
        /// <returns></returns>
        public static TariffBaseUnitCost GetTbuc(string correctName, string startYearAndMonth)
        {
            if (entities == null)
            {
                entities = new UmehlukoEntities1();
            }

            correctName = correctName.ToUpper();

            return
                (entities.TariffBaseUnitCosts.FirstOrDefault(
                     baseUnitCost =>
                     (baseUnitCost.Name.ToUpper().Contains(correctName) ||
                      correctName.Contains(
                          baseUnitCost.Name.Substring(baseUnitCost.Name.IndexOf('-') + 2).Trim().ToUpper()))));

            // && baseUnitCost.ValidFrom.GetFormatedDate().Equals(startYearAndMonth));
        }
        /// <summary>
        /// The dispose.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (this.disposed)
            {
                return;
            }

            if (disposing)
            {
                this.entities.Dispose();
                this.entities = null;
            }

            // Free any unmanaged objects here.
            this.disposed = true;
        }