public async Task <ActionResult> GroupStadistics(Guid?GroupId) { if (GroupId == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Group group = await Db.Groups.Where(x => x.Id == GroupId).FirstOrDefaultAsync(); if (group == null) { return(HttpNotFound()); } ViewBag.GroupName = group.Name; ViewBag.SectionId = group.SectionId; Section section = group.Section; StadisticsBL stadistics = new StadisticsBL(); ResultBL results = new ResultBL(); ViewBag.PeriodNumber = section.CaseStudy.Periods; StadisticsViewModel stadisticsViewModel = new StadisticsViewModel(); stadisticsViewModel.TotalCost = stadistics.GetTotalCost(group); stadisticsViewModel.DemandCost = stadistics.GetDemandCost(group); stadisticsViewModel.OrderCost = stadistics.GetOrderCost(group); stadisticsViewModel.StockCost = stadistics.GetStockCost(group); stadisticsViewModel.AverageTotalCost = stadistics.GetAverageTotalCost(section); stadisticsViewModel.AverageDemandCost = stadistics.GetAverageDemandCost(section); stadisticsViewModel.AverageOrderCost = stadistics.GetAverageOrderCost(section); stadisticsViewModel.AverageStockCost = stadistics.GetAverageStockCost(section); stadisticsViewModel.Groups = results.GetRanking(section); return(View(stadisticsViewModel)); }
public void GetGroupResultsTest() { Group group = Db.Groups.FirstOrDefault(); ResultBL resultBL = new ResultBL(); List <GroupDetailedResultViewModel> result = resultBL.GetGroupResults(group); PrintGroupDetail(result); }
public void GetGroupsResultTest() { Section section = Db.Sections.Where(x => x.Number == "1001").FirstOrDefault(); ResultBL resultBL = new ResultBL(); List <GroupResultViewModel> groupsResult = (List <GroupResultViewModel>)resultBL.GetGroupsResult(section); PrintGroupsDetails(groupsResult); }
public void PopulateDataGrideview() { DataTable dt = new DataTable(); ResultBL ResultBLOBJ = new ResultBL(); dt = ResultBLOBJ.GetExistingResultBL(); ResultdataGridView1.DataSource = dt; }
public void GetRanking() { Section section = Db.Sections.Where(x => x.Number == "1001").FirstOrDefault(); ResultBL resultBL = new ResultBL(); List <GroupRankingViewModel> groups = resultBL.GetRanking(section); foreach (var group in groups) { Console.WriteLine("=========================================="); Console.WriteLine("Nombre Grupo: " + group.GroupName); Console.WriteLine("Puntaje Total: " + group.Score); } }
public async Task <ActionResult> Results(bool IsReadyToOrder = true) { ViewBag.IsReadyToOrder = IsReadyToOrder; Group group = await Db.Groups.Where(x => x.Users.Select(t => t.Id).Contains(CurrentUser.Id)).FirstOrDefaultAsync(); if (group == null) { return(HttpNotFound()); } ResultBL resultBL = new ResultBL(); List <GroupDetailedResultViewModel> results = resultBL.GetGroupResults(group); ViewBag.Section = group.Section; return(View("IndexStudents", results)); }
private void coursecodetextBox_TextChanged(object sender, EventArgs e) { try { Result aResult = new Result(); aResult.CourseCode = coursecodetextBox.Text; ResultBL ResultBLOBJ = new ResultBL(); DataTable dt = new DataTable(); dt = ResultBLOBJ.GetExistingCourseTitle(aResult); coursetitletextBox.Text = dt.Rows[0][0].ToString(); } catch { } }
private void saveresultbutton_Click(object sender, EventArgs e) { Result aResult = new Result(); aResult.ID = sidtextBox.Text; aResult.Name = nametextBox.Text; aResult.Depertment = depertmenttextBox.Text; aResult.CourseTitle = coursetitletextBox.Text; aResult.CourseCode = coursecodetextBox.Text; aResult.Gread = greadcomboBox.Text; aResult.SGPA = 0; float.TryParse(sgpatextBox.Text, out aResult.SGPA); //aResult.SGPA= 0; //float.TryParse(sgpatextBox.Text, out aResult.SGPA); //aResult.SGPA = sgpatextBox.Text; ResultBL ResultBLOBJ = new ResultBL(); bool result = ResultBLOBJ.ValidANewResultAndSendToDA(aResult); if (result) { MessageBox.Show("Result Has Been Saved"); this.PopulateDataGrideview(); saveresultbutton.Enabled = true; updateresultbutton.Enabled = true; deleteresultbutton.Enabled = true; clearresultbutton.Enabled = true; sidtextBox.Text = " "; nametextBox.Text = " "; depertmenttextBox.Text = " "; coursetitletextBox.Text = " "; coursecodetextBox.Text = " "; greadcomboBox.Text = " "; sgpatextBox.Text = " "; } else { MessageBox.Show("RESULT:" + ResultBLOBJ.Message); } }
public void GetDetailedGroupResultTest() { Group group = Db.Groups.FirstOrDefault(); Period period = Db.Periods.OrderBy(x => x.Created).Where(x => x.SectionId == group.SectionId).FirstOrDefault(); ResultBL resultBL = new ResultBL(); DetailedGroupResultViewModel result = resultBL.GetDetailedGroupResult(group, period); Console.WriteLine("Periodio:" + result.PeriodNumber); Console.WriteLine("=========================================="); foreach (var item in result.Results) { Console.WriteLine("Nombre de Producto: " + item.ProductName); Console.WriteLine("Número de Producto: " + item.ProductNumber); Console.WriteLine("Costo de inventario Final: " + item.FinalStockCost); Console.WriteLine("Costo de Demanda Insatisfecha: " + item.UnsatisfiedDemandCost); Console.WriteLine("Costo de Orden: " + item.OrderCost); Console.WriteLine("-------------------------------------"); } }
public ActionResult StudentStadistics() { Section section = CurrentUser.Section; if (section.CaseStudy == null) { Flash.Error("Error", "No existe un modelo de gestión asignado para esta sección"); return(RedirectToAction("Index", "Home")); } Group group = CurrentUser.Group; if (group == null) { Flash.Error("Error", "No pertenece a ningún grupo para poder visualizar estadisticas"); return(RedirectToAction("Index", "Home")); } if (group.IsInSimulation == false) { Flash.Error("Error", "No participa en el modelo de gestión para poder visualizar estadisticas"); return(RedirectToAction("Index", "Home")); } if (section.Periods.Count() == 0) { Flash.Warning("Adventencia", "No hay datos para mostrar"); } StadisticsBL stadistics = new StadisticsBL(); ResultBL results = new ResultBL(); ViewBag.PeriodNumber = section.CaseStudy.Periods; StadisticsViewModel stadisticsViewModel = new StadisticsViewModel(); stadisticsViewModel.TotalCost = stadistics.GetTotalCost(group); stadisticsViewModel.DemandCost = stadistics.GetDemandCost(group); stadisticsViewModel.OrderCost = stadistics.GetOrderCost(group); stadisticsViewModel.StockCost = stadistics.GetStockCost(group); stadisticsViewModel.AverageTotalCost = stadistics.GetAverageTotalCost(section); stadisticsViewModel.AverageDemandCost = stadistics.GetAverageDemandCost(section); stadisticsViewModel.AverageOrderCost = stadistics.GetAverageOrderCost(section); stadisticsViewModel.AverageStockCost = stadistics.GetAverageStockCost(section); stadisticsViewModel.Groups = results.GetRanking(section); return(View(stadisticsViewModel)); }
public async Task <ActionResult> Details(Guid?PeriodId) { if (PeriodId == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Group group = await Db.Groups.Where(x => x.Users.Select(t => t.Id).Contains(CurrentUser.Id)).FirstOrDefaultAsync(); Period period = await Db.Periods.Where(x => x.Id == PeriodId).FirstOrDefaultAsync(); if (group == null || period == null) { return(HttpNotFound()); } ResultBL resultBL = new ResultBL(); ViewBag.Section = period.Section; ViewBag.Group = group; ViewBag.PeriodNumber = group.Section.Periods.OrderBy(x => x.Created).ToList().IndexOf(period); DetailedGroupResultViewModel detailedResult = resultBL.GetDetailedGroupResult(group, period); return(View("DetailsStudents", detailedResult)); }
public ResultsController() { this.ResultBL = new ResultBL(); }
internal static bool Delete(ResultBL resultBL) { OnlineExamHelper.Context.sp_OnlineResultNewDeleteCommand(resultBL.ResultId); return true; }
internal static bool Update(ResultBL resultBL) { OnlineExamHelper.Context.sp_OnlineResultNewUpdateCommand(resultBL.TotalMark, resultBL.FK_UserId, resultBL.ResultId, resultBL.ResultId); return true; }
internal static bool Insert(ResultBL resultBL) { OnlineExamHelper.Context.sp_OnlineResultNewInsertCommand(resultBL.TotalMark, resultBL.FK_UserId); return true; }