protected void Page_Load(object sender, EventArgs e) { bll.clsUserFacade facade = new bll.clsUserFacade(); List <bll.clsUser> user = facade.UsersGetAll(); //bll.clsUser usr; bll.clsOrderFacade orfacade = new bll.clsOrderFacade(); List <bll.clsOrderExtended> orders; double[] sumUser; sumUser = new double[user.Count]; for (int i = 0; i < user.Count; i++) { orders = orfacade.OrdersGetByID(user.ElementAt(i).ID.ToString()); for (int j = 0; j < orders.Count; j++) { sumUser[i] = sumUser[i] + orders.ElementAt(j).OrderSum; } } double higest = 0; for (int i = 0; i < sumUser.Length; i++) { if (higest < sumUser.ElementAt(i)) { higest = sumUser.ElementAt(i); } } Label1.Text = higest.ToString(); }
protected void Page_Load(object sender, EventArgs e) { bll.clsUserFacade facade = new bll.clsUserFacade(); List<bll.clsUser> user = facade.UsersGetAll(); //bll.clsUser usr; bll.clsOrderFacade orfacade = new bll.clsOrderFacade(); List<bll.clsOrderExtended> orders; double[] sumUser; sumUser = new double[user.Count]; for(int i = 0; i < user.Count; i++) { orders =orfacade.OrdersGetByID(user.ElementAt(i).ID.ToString()); for (int j =0; j<orders.Count; j++) { sumUser[i] = sumUser[i] + orders.ElementAt(j).OrderSum; } } double higest = 0; for(int i = 0; i < sumUser.Length; i++) { if (higest < sumUser.ElementAt(i)) { higest = sumUser.ElementAt(i); } } Label1.Text = higest.ToString(); }
protected void btnUnregister_Click(object sender, EventArgs e) { int i = 0; bool found = false; bll.clsUserFacade Users = new bll.clsUserFacade(); List <bll.clsUser> List; List = Users.UsersGetAll(); while (i < List.Count && found == false) { if (inUsername.Text == List.ElementAt(i).Name) { found = true; } else { i = i + 1; } } if (found) { if (inPassword.Text == List.ElementAt(i).Password) { List.ElementAt(i).IsActive = false; Response.Redirect("Default.apsx"); } else { lblError.Visible = true; lblError.Text = "Das Passwort ist Falsch"; } } else { lblError.Visible = true; lblError.Text = "Das User ist Falsch"; } }
protected void btnUnregister_Click(object sender, EventArgs e) { int i = 0; bool found = false; bll.clsUserFacade Users = new bll.clsUserFacade(); List<bll.clsUser> List; List = Users.UsersGetAll(); while (i < List.Count && found == false) { if (inUsername.Text == List.ElementAt(i).Name) { found = true; } else { i = i + 1; } } if (found) { if (inPassword.Text == List.ElementAt(i).Password) { List.ElementAt(i).IsActive = false; Response.Redirect("Default.apsx"); } else { lblError.Visible = true; lblError.Text = "Das Passwort ist Falsch"; } } else { lblError.Visible = true; lblError.Text = "Das User ist Falsch"; } }
protected void Button1_Click(object sender, EventArgs e) { int i = 0; bool found = false; bll.clsUserFacade Users = new bll.clsUserFacade(); List <bll.clsUser> List; List = Users.UsersGetAll(); while (i < List.Count && found == false) { if (inUser.Text == List.ElementAt(i).Name) { found = true; } else { i = i + 1; } } if (found) { if (inPassword.Text == List.ElementAt(i).Password) { if (List.ElementAt(i).IsActive) { Session.RemoveAll(); Session.Add("Current User", List.ElementAt(i)); Response.Redirect("Redirect.aspx"); } //if(List.ElementAt(i).Role == 0) //{ // Response.Redirect("Costumer/CostumerDefault.aspx"); //} //else //{ // if (List.ElementAt(i).Role == 1) // { // Response.Redirect("Manager/ManagerDefault.aspx"); // } // else // { // Response.Redirect("Worker/WorkerDefault.aspx"); // } //} //Response.Redirect("default.aspx"); else { lblError.Visible = true; lblError.Text = "Sie sind als Inaktiv Makiert und dürfen sich desswegen nicht Anmelden, bitte kontaktiren sie uns wenn wir sie wieder aktiviren sollen."; } } else { lblError.Visible = true; lblError.Text = "Das Passwort ist nicht korrekt."; } } else { lblError.Visible = true; lblError.Text = "Dieser User existiert nicht."; } }
protected void Button1_Click(object sender, EventArgs e) { int i = 0; bool found = false; bll.clsUserFacade Users = new bll.clsUserFacade(); List<bll.clsUser> List; List = Users.UsersGetAll(); while (i < List.Count && found == false) { if (inUser.Text == List.ElementAt(i).Name) { found = true; } else { i = i + 1; } } if (found) { if (inPassword.Text == List.ElementAt(i).Password) { if (List.ElementAt(i).IsActive) { Session.RemoveAll(); Session.Add("Current User", List.ElementAt(i)); Response.Redirect("Redirect.aspx"); } //if(List.ElementAt(i).Role == 0) //{ // Response.Redirect("Costumer/CostumerDefault.aspx"); //} //else //{ // if (List.ElementAt(i).Role == 1) // { // Response.Redirect("Manager/ManagerDefault.aspx"); // } // else // { // Response.Redirect("Worker/WorkerDefault.aspx"); // } //} //Response.Redirect("default.aspx"); else { lblError.Visible = true; lblError.Text = "Sie sind als Inaktiv Makiert und dürfen sich desswegen nicht Anmelden, bitte kontaktiren sie uns wenn wir sie wieder aktiviren sollen."; } } else { lblError.Visible = true; lblError.Text = "Das Passwort ist nicht korrekt."; } } else { lblError.Visible = true; lblError.Text = "Dieser User existiert nicht."; } }