public ActionResult principal() { ViewBag.tipousuario = Session["Tipousuario"]; TotalDao Tdao = new TotalDao(); ViewBag.totalexercicioscorretos = Tdao.TotalexercicioscertosProfessor(Convert.ToString(Session["Loginusuario"])); ViewBag.totalexercicioserrados = Tdao.TotalexercicioserradosProfessor(Convert.ToString(Session["Loginusuario"])); ViewBag.totalexercicios = Tdao.TotalexerciciosProfessor(Convert.ToString(Session["Loginusuario"])); ViewBag.totalexerciciosrespondidos = Tdao.TotalexerciciosrespondidosProfessor(Convert.ToString(Session["Loginusuario"])); ViewBag.totalexerciciossemresposta = Tdao.TotalexerciciosNovosProfessor(Convert.ToString(Session["Loginusuario"])); ViewBag.Percentualrealizado = 0; if (ViewBag.totalexercicios > 0) { ViewBag.Percentualrealizado = Convert.ToInt32((ViewBag.totalexerciciosrespondidos / ViewBag.totalexercicios) * 100); } ViewBag.Percentualcerto = 0; if (ViewBag.totalexercicios > 0) { ViewBag.Percentualcerto = Convert.ToInt32((ViewBag.totalexercicioscorretos / ViewBag.totalexercicios) * 100); } ViewBag.Percentualincorreto = 0; if (ViewBag.totalexercicios > 0) { ViewBag.Percentualincorreto = Convert.ToInt32((ViewBag.totalexercicioserrados / ViewBag.totalexercicios) * 100); } return(View()); }
private void Name_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { string item = Name.SelectedItem.ToString(); TotalDao totalDao = new TotalDao(); totalDao.QueryName(item, DataGrid_StockView); } catch (Exception) { } }
//click context open table #region tableclick private void tsm_table_Click(object sender, EventArgs e) { table.Waiter = (Waiter)((ToolStripMenuItem)sender).Tag; TotalDao totalDao = new TotalDao(); MessageBox.Show("table open table id : " + table.Id + " name:" + table.Name + " waiter id: " + table.Waiter.Id); int returnId = totalDao.insertTotal(table.Id, table.Waiter.Id); MessageBox.Show("returnId open table: " + returnId); if (returnId != 0 && returnId != null) { tableListOnInterface(); lbl_table_name.Text = table.Name; lbl_waiter_name.Text = table.Waiter.Name; } }