Пример #1
0
 private static string GetFormatedText(EF6.FepBatchDetail 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);
 }
Пример #2
0
        /// <summary>
        /// Get a EF6.FepBatchDetail object from the database using the given DetailsId
        /// </summary>
        /// <param name="detailsId">The primary key value</param>
        /// <returns>A EF6.FepBatchDetail object</returns>
        public static EF6.FepBatchDetail Get(Guid detailsId)
        {
            EF6.FepBatchDetail result = null;

            using (var ctx = new EF6.RT2020Entities())
            {
                result = ctx.FepBatchDetail.Where(x => x.DetailsId == detailsId).AsNoTracking().FirstOrDefault();
            }

            return(result);
        }
Пример #3
0
        /// <summary>
        /// Get a EF6.FepBatchDetail object from the database using the given QueryString
        /// </summary>
        /// <param name="detailsId">The primary key value</param>
        /// <returns>A EF6.FepBatchDetail object</returns>
        public static EF6.FepBatchDetail Get(string whereClause)
        {
            EF6.FepBatchDetail result = null;

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

            return(result);
        }