Beispiel #1
0
 public IActionResult OnPostStempeln(int?Pid)
 {
     ControllerZeit.SetStempel(Pid);
     SetPropAnwStatusColor(ControllerZeit.GetStatusAnwesendheit(Pid));
     dtZeiten = ControllerZeit.GetZeitnachweise(HttpContext.Session.GetInt32("Pid"));
     return(Page());
 }
Beispiel #2
0
        private bool AuthenticationSuccess()
        {
            List <object> par = new List <object>()
            {
                Login.Kurzzeichen
            };
            List <string> col = new List <string>()
            {
                "Kz"
            };

            DataTable dt = TR_SQL_Commands.ReturnStoredProcedureValue("Select_PData_ByKz", par, col);

            if (dt.Rows.Count != 0)
            {
                if (Crypto.EncryptString(dt.Rows[0]["UserPassword"].ToString()) == Login.Passwort)
                {
                    HttpContext.Session.SetInt32("IsAdmin",
                                                 (dt.Rows[0]["IsAdmin"].ToString() == "1") ? 1 : 0);
                    HttpContext.Session.SetString("LayoutPage",
                                                  (dt.Rows[0]["IsAdmin"].ToString() == "1") ? "~/Pages/Shared/_LayoutAdmin.cshtml" : "~/Pages/Shared/_Layout.cshtml");
                    HttpContext.Session.SetInt32("Pid",
                                                 Convert.ToInt32((dt.Rows[0]["idPersonal"].ToString())));
                    HttpContext.Session.SetString("AnwStatusColor",
                                                  ControllerZeit.GetStatusAnwesendheit(HttpContext.Session.GetInt32("Pid")) == 0 ? "red" : "green");
                    HttpContext.Session.SetString("AnwStatus",
                                                  ControllerZeit.GetStatusAnwesendheit(HttpContext.Session.GetInt32("Pid")) == 0 ? "Abwesend" : "Anwesend");


                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
 public void OnGet()
 {
     dtZeiten = ControllerZeit.GetZeitnachweise(HttpContext.Session.GetInt32("Pid"));
 }