/// <summary> /// Calls window to edit entry /// </summary> private void EditTable_MouseDoubleClick(object sender, MouseButtonEventArgs e) { //string weekNr, string name, DateTime exTime, double lastCashDesks EditDataGrid ed = new EditDataGrid(); ed.Show(); ed.Closed += (x, y) => { string nr = CurrWeek.WeekNr; CurrWeek = new Week(nr); GenerateDaysOfThWeekAndAddToWeek(); GenerateWeek(nr); FillEntryTable(); ReCalcAndUpdateInfoLine(); }; }
public static string Username; //current username logged in #endregion #region Ctor´s /// <summary> /// Constructor if Week doesn´t exist /// </summary> /// <param name="weekNr">Week nr</param> /// <param name="name">Name of creator</param> /// <param name="exTime">exact time of week</param> /// <param name="lastCashDesk">last cash desk</param> /// <param name="username">Username of user</param> /// <param name="isAdmin">Is the user admin</param> public Buchhaltung(string weekNr, string name, DateTime exTime, double lastCashDesk, string username, int isAdmin) { InitializeComponent(); Username = username; IsAdmin = Convert.ToBoolean(isAdmin); LoadProducts(); CurrWeek = new Week(weekNr, exTime, name, lastCashDesk); //Selects the current week todo rewrite to sql GenerateDaysOfThWeekAndAddToWeek(); SaveEntrys(); //When generated a new week the file need to be generated DayOutput.Text = "Montag"; FillWeekInfo(); if (IsAdmin) { ShowAdminFeatures(); } }
/// <summary> /// Constructor if week does exist /// </summary> /// <param name="weekNr"></param> /// <param name="isAdmin"></param> public Buchhaltung(string weekNr, string username, int isAdmin) { InitializeComponent(); Username = username; IsAdmin = Convert.ToBoolean(isAdmin); LoadProducts(); CurrWeek = new Week(weekNr); //Selects the current week GenerateDaysOfThWeekAndAddToWeek(); LoadWeek(weekNr); //Needs to be loaded after Products ReCalcAndUpdateInfoLine(); DayOutput.Text = "Montag"; FillWeekInfo(); if (IsAdmin) { ShowAdminFeatures(); } }