/// <summary> /// Load Munities and Amount /// </summary> public ObservableCollection <ModelBillConfig> LoadBillConfig() { try { string billXmlPath = Path.Combine(GetTempFolder(CvVariables.SOFTWARE_NAME), CvVariables.MUNITIES_FILE); if (File.Exists(billXmlPath)) { XElement billConfigXml = XElement.Load(billXmlPath); return(new ObservableCollection <ModelBillConfig>(from bilinginfo in billConfigXml.Elements("Rate") select new ModelBillConfig { Minutes = bilinginfo.Element("Minutes").Value, Amount = bilinginfo.Element("Bill").Value })); } else { return(new ObservableCollection <ModelBillConfig>()); } } catch (Exception ErrorException) { LogFileWriter.ErrorToLog("Loading Bill Configuration File", ErrorException); return(default(ObservableCollection <ModelBillConfig>)); } }
/// <summary> /// Check Cash Date /// </summary> public void CheckCashDate() { try { using (Cafeteria_Vernier_dbEntities cvDatabase = new Cafeteria_Vernier_dbEntities()) { if (cvDatabase.Cashes.FirstOrDefault(x => x.EntryDate == DateTime.Today) == null) { cvDatabase.AddToCashes(new Cash { EntryDate = DateTime.Today, Amount = 0 }); cvDatabase.SaveChanges(); } } } catch (Exception ErrorException) { LogFileWriter.ErrorToLog("Loading Bill Configuration File", ErrorException); } }