/// <summary> /// Gets the tarrif item code data. /// </summary> /// <param name="tariffs"> /// The tariffs. /// </param> /// <param name="fileItemCode"> /// The file item code. /// </param> /// <param name="practitionerType"> /// Type of the practitioner. /// </param> /// <returns> /// The <see cref="Tariff"/>. /// </returns> private static Tariff GetTarrifItemCodeData( IQueryable <Tariff> tariffs, string fileItemCode, PracType practitionerType) { var pracValue = (int)practitionerType; var values = tariffs.Where(t => t.ItemCode == fileItemCode && t.PractitionerType.IsSpecialist == pracValue).ToList(); return(values.FirstOrDefault()); }
public ResultWindow(int Right, int Wrong, PracType type, ref User user) { InitializeComponent(); Right_Label.Content = Right.ToString(); Wrong_Label.Content = Wrong.ToString(); Aps_Label.Content = Math.Round((Right + Wrong) / 180d, 2); Mark_Label.Content = (Right + Wrong != 0) ? (12 - (12 * Wrong) / (Right + Wrong)).ToString() : "1"; if (type == PracType.Math) { user.MathInfo.Score += Right - Wrong; } else { user.MemoryInfo.Score += Right - Wrong; } File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\QuickMath\user.json", JsonConvert.SerializeObject(user, Formatting.Indented)); }
public static ObservableCollection <PracType> GetAllPracType() { string strQuery = "SELECT typeID, typeName from pracType"; DataTable dt = new DataTable(); dt = _DB.executeSQL(strQuery); var pracTypes = new ObservableCollection <PracType>(); foreach (DataRow dr in dt.Rows) { PracType pracType = new PracType() { typeID = Convert.ToInt32(dr[0]), typeName = dr[1].ToString() }; pracTypes.Add(pracType); } return(pracTypes); }
/* private static string GetCorrectTbuc(IQueryable<Tariff> tariffs, * string fileItemCode) * { * * }**/ /// <summary> /// Gets the tarrif data. /// </summary> /// <param name="tariffs"> /// The tariffs. /// </param> /// <param name="fileItemCode"> /// The file item code. /// </param> /// <param name="correctName"> /// Name of the correct. /// </param> /// <param name="practitionerType"> /// Type of the practitioner. /// </param> /// <returns> /// The <see cref="Tariff"/>. /// </returns> private static Tariff GetTarrifData( IQueryable <Tariff> tariffs, string fileItemCode, string correctName, PracType practitionerType) { var pracValue = (int)practitionerType; var values = tariffs.Where(t => t.ItemCode == fileItemCode && t.PractitionerType.IsSpecialist == pracValue).ToList(); if (!values.Any()) { return(null); } return (values.FirstOrDefault( t => t.TariffBaseUnitCost.Name.Contains(correctName, StringComparison.InvariantCultureIgnoreCase) && correctName.Contains( t.TariffBaseUnitCost.Name.Substring(t.TariffBaseUnitCost.Name.IndexOf('-') + 2).Trim(), StringComparison.InvariantCultureIgnoreCase))); }
/* private static string GetCorrectTbuc(IQueryable<Tariff> tariffs, string fileItemCode) { }**/ /// <summary> /// Gets the tarrif data. /// </summary> /// <param name="tariffs"> /// The tariffs. /// </param> /// <param name="fileItemCode"> /// The file item code. /// </param> /// <param name="correctName"> /// Name of the correct. /// </param> /// <param name="practitionerType"> /// Type of the practitioner. /// </param> /// <returns> /// The <see cref="Tariff"/>. /// </returns> private static Tariff GetTarrifData( IQueryable<Tariff> tariffs, string fileItemCode, string correctName, PracType practitionerType) { var pracValue = (int)practitionerType; var values = tariffs.Where(t => t.ItemCode == fileItemCode && t.PractitionerType.IsSpecialist == pracValue).ToList(); if (!values.Any()) { return null; } return values.FirstOrDefault( t => t.TariffBaseUnitCost.Name.Contains(correctName, StringComparison.InvariantCultureIgnoreCase) && correctName.Contains( t.TariffBaseUnitCost.Name.Substring(t.TariffBaseUnitCost.Name.IndexOf('-') + 2).Trim(), StringComparison.InvariantCultureIgnoreCase)); }
/// <summary> /// Gets the tarrif item code data. /// </summary> /// <param name="tariffs"> /// The tariffs. /// </param> /// <param name="fileItemCode"> /// The file item code. /// </param> /// <param name="practitionerType"> /// Type of the practitioner. /// </param> /// <returns> /// The <see cref="Tariff"/>. /// </returns> private static Tariff GetTarrifItemCodeData( IQueryable<Tariff> tariffs, string fileItemCode, PracType practitionerType) { var pracValue = (int)practitionerType; var values = tariffs.Where(t => t.ItemCode == fileItemCode && t.PractitionerType.IsSpecialist == pracValue).ToList(); return values.FirstOrDefault(); }