Esempio n. 1
0
 private static string GetFormatedText(EF6.FepBatchHeader target, string[] textField, string textFormatString)
 {
     for (int i = 0; i < textField.Length; i++)
     {
         PropertyInfo pi = target.GetType().GetProperty(textField[i]);
         textFormatString = textFormatString.Replace("{" + i.ToString() + "}", pi != null ? pi.GetValue(target, null).ToString() : string.Empty);
     }
     return(textFormatString);
 }
Esempio n. 2
0
        /// <summary>
        /// Get a EF6.FepBatchHeader object from the database using the given HeaderId
        /// </summary>
        /// <param name="headerId">The primary key value</param>
        /// <returns>A EF6.FepBatchHeader object</returns>
        public static EF6.FepBatchHeader Get(Guid headerId)
        {
            EF6.FepBatchHeader result = null;

            using (var ctx = new EF6.RT2020Entities())
            {
                result = ctx.FepBatchHeader.Where(x => x.HeaderId == headerId).AsNoTracking().FirstOrDefault();
            }

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Get a EF6.FepBatchHeader object from the database using the given QueryString
        /// </summary>
        /// <param name="headerId">The primary key value</param>
        /// <returns>A EF6.FepBatchHeader object</returns>
        public static EF6.FepBatchHeader Get(string whereClause)
        {
            EF6.FepBatchHeader result = null;

            using (var ctx = new EF6.RT2020Entities())
            {
                result = ctx.FepBatchHeader
                         .SqlQuery(string.Format("Select * from FepBatchHeader Where {0}", whereClause))
                         .AsNoTracking()
                         .FirstOrDefault();
            }

            return(result);
        }