public List <Supervision> GetAllSupervisors() { List <Supervision> supervisorList = new List <Supervision>(); // string query = "select dbo.activity.activityID, dbo.lecturer.lecturerID, dbo.activity.startDateTime,dbo.activity.endDateTime, dbo.lecturer.firstname, dbo.lecturer.lastname,dbo.lecturer.specialisation from dbo.activitySupervisorjoin dbo.activity on dbo.activitySupervisor.activityID = dbo.activity.activityIDjoin dbo.lecturer on dbo.lecturer.lecturerID = dbo.activitySupervisor.lecturerID;"; SqlCommand cmd = new SqlCommand("select a.activityID, a.[description],a.startdatetime,a.enddatetime,s.lecturerID,l.firstname,l.lastname,l.specialisation from activity as a join activitySupervisor as s on s.activityID=a.activityID join lecturer as l on l.lecturerID=s.lecturerID", conn); OpenConnection(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Supervision supervisor1 = ReadSupervisor(reader); supervisorList.Add(supervisor1); } reader.Close(); CloseConnection(); //read Lecturer //read dates //create a supervisor //add to supervisorList //return the list return(supervisorList); }
// // GET: /Supervisiones/Edit/5 public ActionResult Edit(int id) { Supervision supervision = db.Supervision.Find(id); ViewBag.RolID = new SelectList(db.Rol, "ID", "Comentarios", supervision.RolID); return(View(supervision)); }
//School supervision async private void UpdateSupervisionButton(object sender, EventArgs e) { try { supervisionPicker = SupervisionPicker as Picker; var supervision = new Supervision(); supervision.name = supervisionPicker.SelectedItem.ToString(); try { supervision.cost = int.Parse(SupervisionCost.Text); } catch (Exception) { DisplayAlert(alertTitle, notNumberErrorMessage, alertCheck); } await App.Database.SaveSupervisionAsync(supervision); toast.ShowToast(uploadSuccessfullMessage); } catch (Exception) { DisplayAlert(alertTitle, nullNameErrorMessage, alertCheck); } }
public ActionResult DeleteConfirmed(int id) { Supervision supervision = db.Supervision.Find(id); db.Supervision.Remove(supervision); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Supervision supervision) { if (ModelState.IsValid) { db.Entry(supervision).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RolID = new SelectList(db.Rol, "ID", "Comentarios", supervision.RolID); return(View(supervision)); }
private void Menu_Click(object sender, RoutedEventArgs e) { if ((Kosher.SelectedItem != null) && menu) { menu = false; sup = (Supervision)Kosher.SelectedItem; Window Menu = new Menu(); Menu.Topmost = true; Menu.Show(); } }
async private void DeleteSupervisionButton(object sender, EventArgs e) { try { supervisionPicker = SupervisionPicker as Picker; var supervision = new Supervision(); supervision.name = supervisionPicker.SelectedItem.ToString(); await App.Database.DeleteSupervisionAsync(supervision); toast.ShowToast(deleteMessage); } catch (Exception) { DisplayAlert(alertTitle, nullNameErrorMessage, alertCheck); } }
public ActionResult Create(Supervision supervision) { Rol Rol = (Rol)Session["Rol"]; supervision.RolID = Rol.ID; if (ModelState.IsValid) { db.Supervision.Add(supervision); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RolID = new SelectList(db.Rol, "ID", "Comentarios", supervision.RolID); return(View(supervision)); }
private void Add_super_Click(object sender, EventArgs e) { Supervisor_Service supervision_service_pipe = new Supervisor_Service(); if (lecturer_list.SelectedItems.Count < 1 || Supervisor_listview.SelectedItems.Count < 1) { MessageBox.Show("select a lecturer and activity to add to activity"); } else { Supervision Supervision = (Supervision)Supervisor_listview.SelectedItems[0].Tag; Lecturer lecturerid = (Lecturer)lecturer_list.SelectedItems[0].Tag; supervision_service_pipe.AddSupervisor(Supervision.ActivityId, lecturerid.number); MessageBox.Show("supervisor added"); } }
async public Task <int> SaveSupervisionAsync(Supervision supervision) { var checkIfexists = new Supervision(); checkIfexists = await GetSupervisionAsync(supervision.name); if (checkIfexists != null) { return(await _database.UpdateAsync(supervision)); } else { return(await _database.InsertAsync(supervision)); } }
public Branch byKoshers(Supervision kosher) { Branch tmp = new Branch() { Get_Branch_id = 0 }; foreach (var item in B_tList) { if (item.Get_kosher == kosher) { return(item); } } return(tmp); }
public List <Supervision> GetallsupervisorsByID(int id) { List <Supervision> supervisorList = new List <Supervision>(); SqlCommand cmd = new SqlCommand("select a.activityID,s.lecturerID,l.firstname,l.lastname,a.startdatetime,a.enddatetime,l.specialisation from activity as a join activitySupervisor as s on s.activityID=a.activityID join lecturer as l on l.lecturerID=s.lecturerID where a.activityID=@aID", conn); OpenConnection(); cmd.Parameters.AddWithValue("@aId", id); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Supervision supervisor1 = ReadSupervisor(reader); supervisorList.Add(supervisor1); } reader.Close(); CloseConnection(); return(supervisorList); }
/// <summary> ///gets a kosher's and returns a list of branches in that supervision /// </summary> /// <param name="sup"></param> /// <returns></returns> public List <Branch> find_by_kosher(Supervision sup)/*5*/ { XDal = FactorySingletonDal.getInstanceDal(); List <Branch> all_branches = new List <Branch>(XDal.get_branch_list()); List <Branch> available = new List <Branch>(); var avail = from branch in all_branches where branch.Get_kosher == sup select branch; foreach (var found in avail) { available.Add(found); } return(available); }
// set Supervision cost button async private void SetSupervision(object sender, EventArgs e) { int cost = 0; var supervision = new Supervision();; if (!(string.IsNullOrEmpty(SupervisionName.Text))) { try { cost = int.Parse(SupervisionCost.Text); errorSupervisionCostMessage.IsVisible = false; } catch (Exception) { DisplayAlert(alertTitle, notNumberErrorMessage, alertCheck); } try { supervision.name = SupervisionName.Text; await App.Database.SaveSupervisionAsync(supervision); supervision = await App.Database.GetSupervisionAsync(SupervisionName.Text); errorSupervisionCostMessage.IsVisible = false; supervision.cost = cost; await Navigation.PushAsync(new SetParameters()); toast.ShowToast(uploadSuccessfullMessage); } catch (Exception) { DisplayAlert(alertTitle, nullNameErrorMessage, alertCheck); } } else { DisplayAlert(alertTitle, nullNameErrorMessage, alertCheck); } }
private Supervision ReadSupervisor(SqlDataReader reader) { Lecturer lecturer1 = new Lecturer() { number = (int)reader["lecturerID"], firstName = (string)(reader["firstname"]), lastName = (string)(reader["lastname"]), specialisation = (string)(reader["specialisation"]) }; Supervision supervisor = new Supervision() { lecturer = lecturer1, ActivityId = (int)reader["activityID"], StartTime = (DateTime)reader["startDateTime"], EndTime = (DateTime)reader["endDateTime"], }; return(supervisor); }
public ActionResult Create(SupervisionCreateModel model) { var member = GetMyMembership(); if (member != null) { var supervision = new Supervision(); supervision.Name = model.Title; supervision.Description = model.Description; supervision.Owners.Add(new ActivityOwner { Member = member }); supervision.Occurrence = new Occurrence { Capacity = -1, }; Db.Activities.Add(supervision); Db.SaveChanges(); } return(RedirectToAction("Thesis", "Lecturer")); }
private void Remove_super_Click(object sender, EventArgs e) { Supervisor_Service supervision_service_pipe = new Supervisor_Service(); if (lecturer_list.SelectedItems.Count < 1 || Supervisor_listview.SelectedItems.Count < 1) { MessageBox.Show("select a lecturer and activity to delete lecturer"); // programmer blindness } else { DialogResult result = MessageBox.Show("confirmation", "are you sure you want to delete that?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { Supervision Supervision = (Supervision)Supervisor_listview.SelectedItems[0].Tag; Lecturer lecturerid = (Lecturer)lecturer_list.SelectedItems[0].Tag; supervision_service_pipe.DeleteSupervisor(Supervision.ActivityId, lecturerid.number); } else { return; } } }
public IActionResult Put(string id, Supervision data) { data.ImgUrl = FileOperation.FileImg(data.ImgFile, data.Id, rootPath, Path(data.ParentId)); return(Json(_col.UpData(id, data))); }
protected override void ParseLine(string line, SupervisionFloor dto) { var supervisionLine = Supervision.TryParse(line); if (supervisionLine.WasSuccessful) { foreach (var data in supervisionLine.Value) { if (string.IsNullOrEmpty(data.Teacher)) { var supervision = new Supervision { Day = data.Day, Lesson = data.Lesson, Teacher = data.Teacher }; dto.Supervisions.Add(supervision); } else { var unparsedData = data.UnparsedSupervisions.Substring(data.UnparsedSupervisions.LastIndexOf('~') + 1); foreach (var section in unparsedData.Split('*')) { var parts = section.Split(';'); if (parts.Length != 2 || string.IsNullOrEmpty(parts[0]) || string.IsNullOrEmpty(parts[1])) { continue; } var supervision = new Supervision { Day = data.Day, Lesson = data.Lesson, Teacher = parts[0] }; foreach (var weeks in parts[1].Split('/')) { var weekParts = weeks.Split('-').Select(x => int.Parse(x)); if (weekParts.Count() == 1) { supervision.Weeks.Add(weekParts.ElementAt(0)); } else if (weekParts.Count() == 2) { for (int week = weekParts.ElementAt(0); week <= weekParts.ElementAt(1); week++) { supervision.Weeks.Add(week); } } } dto.Supervisions.Add(supervision); } } } } }
async public void addSupervision(String name, int cost) { Supervision supervision = new Supervision(); supervision.name = name; supervision.cost = cost; await App.Database.SaveSupervisionAsync(supervision); }
public IActionResult Post(Supervision data) { data.Id = Guid.NewGuid().ToString(); data.ImgUrl = FileOperation.FileImg(data.ImgFile, data.Id, rootPath, Path(data.ParentId)); return(Json(_col.Insert(data))); }
//Calculate the total and display errors async void Button_Calculate(object sender, EventArgs e) { //scroll to the end await ChildScrollView.ScrollToAsync(ResultLabel, ScrollToPosition.End, true).ConfigureAwait(true); //set all pickers Picker yearPicker = YearPicker as Picker; Picker termDiscountPicker = TermDiscountPicker as Picker; Picker zonePicker = ZonePicker as Picker; Picker supervisionPicker = SupervisionPicker as Picker; Picker supportPicker = SupportPicker as Picker; //set all picked parameters string year; string zone; string assistanceDicountName; string siblingDicountName; string termDiscountName; string supervisionName; string supportName; child = (Child)BindingContext; try { year = yearPicker.SelectedItem.ToString(); if (year == "<Empty>") { child.yearName = null; child.tuitionFees = 0; child.fixedCharges = 0; child.externalExaminationFees = 0; child.schoolMeals = 0; child.wednesdayMeals = 0; } //Get all corresponding cost EnrolementFees enrolementFee = await App.Database.GetEnrolementFeesAsync(0); TuitionFees tuitionFees = await App.Database.GetTuitionFeesAsync(year); FixedCharges fixedCharges = await App.Database.GetFixedChargesAsync(year); ExternalExaminationFees examinationFees = await App.Database.GetExternalExaminationFeesAsync(year); //set mandatory fees Child with entries provided by user child.yearName = year; child.enrolementFee = enrolementFee.cost; child.tuitionFees = tuitionFees.cost; child.recalculatedTuitionFees = tuitionFees.cost; child.fixedCharges = fixedCharges.cost; child.externalExaminationFees = examinationFees.cost; // enrolementFeeValue.Text = n.ToNumberFormat() + devise; enrolementFeeValue.Text = n.ToNumberFormat(child.enrolementFee) + devise; tuitionFeesValue.Text = n.ToNumberFormat(child.tuitionFees) + devise; fixedChargesValue.Text = n.ToNumberFormat(child.fixedCharges) + devise; externalExaminationFeesValue.Text = n.ToNumberFormat(child.externalExaminationFees) + devise; } catch (Exception) { } // set Optionnal assistance discount try { assistanceDicountName = childrenNr[0]; if (assistanceDiscountCheckBox.IsChecked == false) { child.assistanceDiscountName = null; child.assistanceDiscount = 0; } else { AssistanceDiscount assistanceDiscount = await App.Database.GetAssistanceDiscountAsync(assistanceDicountName); child.assistanceDiscount = assistanceDiscount.discountPercentage; child.assistanceDiscountName = assistanceDicountName; } assistanceDiscountValue.Text = n.ToNumberFormat(child.assistanceDiscount * child.tuitionFees / 100) + devise; child.recalculatedTuitionFees = child.tuitionFees * (100 + child.assistanceDiscount) / 100; } catch (Exception) { } // set Optionnal sibling discount try { siblingDicountName = childrenNr[1]; if (siblingDiscountCheckBox.IsChecked == false) { child.siblingDiscountName = null; child.siblingDiscount = 0; } else { AssistanceDiscount siblingDiscount = await App.Database.GetAssistanceDiscountAsync(siblingDicountName); child.siblingDiscount = siblingDiscount.discountPercentage; child.siblingDiscountName = siblingDicountName; } siblingDiscountValue.Text = n.ToNumberFormat(child.siblingDiscount * (child.recalculatedTuitionFees) / 100) + devise; child.recalculatedTuitionFees = child.recalculatedTuitionFees * (100 + child.siblingDiscount) / 100; } catch (Exception) { } // set Optionnal term discount try { termDiscountName = termDiscountPicker.SelectedItem.ToString(); if (termDiscountName == "<Empty>") { child.termDiscountName = null; child.termDiscount = 0; } else { TermDiscount termDiscount = await App.Database.GetTermDiscountAsync(termDiscountName); child.termDiscount = termDiscount.discountPercentage; child.termDiscountName = termDiscountName; } termDiscountValue.Text = n.ToNumberFormat(child.termDiscount * (child.tuitionFees - child.assistanceDiscount) / 100) + devise; child.recalculatedTuitionFees = (child.recalculatedTuitionFees - child.assistanceDiscount - child.siblingDiscount) * (100 + child.termDiscount) / 100; } catch (Exception) { } // set Optionnal school meal try { if (schoolMealsCheckBox.IsChecked) { year = yearPicker.SelectedItem.ToString(); SchoolMeals schoolMeals = await App.Database.GetSchoolMealsAsync(year); child.schoolMeals = schoolMeals.cost; } else { child.schoolMeals = 0; } schoolMealsValue.Text = n.ToNumberFormat(child.schoolMeals) + devise; } catch (Exception) { } // set Optionnal wednesday meal try { if (wednesdayMealsCheckBox.IsChecked) { year = yearPicker.SelectedItem.ToString(); WednesdayMeals wednesdayMeals = await App.Database.GetWednesdayMealsAsync(year); child.wednesdayMeals = wednesdayMeals.cost; } else { child.wednesdayMeals = 0; } wednesdayMealsValue.Text = n.ToNumberFormat(child.wednesdayMeals) + devise; } catch (Exception) { } // set Optionnal school transport try { zone = zonePicker.SelectedItem.ToString(); if (zone == "<Empty>") { child.zoneName = null; child.schoolTransport = 0; } else { SchoolTransport schoolTransport = await App.Database.GetSchoolTransportAsync(zone); child.schoolTransport = schoolTransport.cost; child.zoneName = zone; } schoolTransportValue.Text = n.ToNumberFormat(child.schoolTransport) + devise; } catch (Exception) { } // set Optionnal supervision try { supervisionName = supervisionPicker.SelectedItem.ToString(); if (supervisionName == "<Empty>") { child.supervisionName = null; child.supervision = 0; } else { Supervision supervision = await App.Database.GetSupervisionAsync(supervisionName); child.supervision = supervision.cost; child.supervisionName = supervisionName; } supervisionValue.Text = n.ToNumberFormat(child.supervision) + devise; } catch (Exception) { } // set Optionnal support transport try { supportName = supportPicker.SelectedItem.ToString(); if (supportName == "<Empty>") { child.supportName = null; child.support = 0; } else { Support support = await App.Database.GetSupportAsync(supportName); child.support = support.cost; child.supportName = supportName; } supportValue.Text = n.ToNumberFormat(child.support) + devise; } catch (Exception) { } child.childName = ChildNameValue.Text; //set the child name if it has been modified //set total child cost child.cost = (child.fixedCharges + child.recalculatedTuitionFees + child.enrolementFee + child.externalExaminationFees + child.schoolMeals + child.schoolTransport + child.supervision + child.support); Family family = await App.Database.GetFamilyByIdAsync(child.familyId); family.totalCost = family.totalCost + child.cost; await App.Database.SaveFamilyAsync(family); //save child in database await App.Database.SaveChildAsync(child); //Display result ResultLabel.Text = n.ToNumberFormat(child.cost) + devise; }
public Task <int> DeleteSupervisionAsync(Supervision supervision) { return(_database.DeleteAsync(supervision)); }
// // GET: /Supervisiones/Details/5 public ViewResult Details(int id) { Supervision supervision = db.Supervision.Find(id); return(View(supervision)); }
public async Task <IActionResult> Asignacion(Personacausapenal personacausapenal, Supervision supervision, Suspensionseguimiento suspensionseguimiento, Aer aer, Planeacionestrategica planeacionestrategica, Cierredecaso cierredecaso, Cambiodeobligaciones cambiodeobligaciones, Revocacion revocacion, Fraccionesimpuestas fraccionesimpuestas, Victima victima, int id /*, int persona_idPersona*/) { string currentUser = User.Identity.Name; if (ModelState.IsValid) { if (selectedPersona.Count == 0) { return(RedirectToAction(nameof(Index))); } int idPersona = Int32.Parse(selectedPersona[0]); //int idPersona = persona_idPersona; //Por el la primera opcion vacia if (idPersona == 0) { return(RedirectToAction(nameof(Index))); } int idPersonaCausaPenal = ((from table in _context.Personacausapenal select table.IdPersonaCausapenal).Max()) + 1; personacausapenal.IdPersonaCausapenal = idPersonaCausaPenal; personacausapenal.PersonaIdPersona = idPersona; personacausapenal.CausaPenalIdCausaPenal = id; #region agregar 1 entrada a Supervision int idSupervision = ((from table in _context.Supervision select table.IdSupervision).Max()) + 1; supervision.IdSupervision = idSupervision; supervision.PersonaIdPersona = idPersona; supervision.CausaPenalIdCausaPenal = id; supervision.EstadoSupervision = "VIGENTE"; #endregion #region agregar 1 entrada a Suspensionseguimiento int idSuspensionSeguimiento = ((from table in _context.Suspensionseguimiento select table.IdSuspensionSeguimiento).Max()) + 1; suspensionseguimiento.IdSuspensionSeguimiento = idSuspensionSeguimiento; suspensionseguimiento.SupervisionIdSupervision = idSupervision; #endregion #region agregar 1 entrada a Aer int idAer = ((from table in _context.Aer select table.IdAer).Max()) + 1; aer.IdAer = idAer; aer.SupervisionIdSupervision = idSupervision; #endregion #region agregar 1 entrada a Planeacionestrategica int idPlaneacionestrategica = ((from table in _context.Planeacionestrategica select table.IdPlaneacionEstrategica).Max()) + 1; planeacionestrategica.IdPlaneacionEstrategica = idPlaneacionestrategica; planeacionestrategica.SupervisionIdSupervision = idSupervision; #endregion #region agregar 1 entrada a Cierredecaso int idCierredecaso = ((from table in _context.Cierredecaso select table.IdCierreDeCaso).Max()) + 1; cierredecaso.IdCierreDeCaso = idCierredecaso; cierredecaso.SupervisionIdSupervision = idSupervision; #endregion #region agregar 1 entrada a Cambiodeobligaciones int idCambiodeobligaciones = ((from table in _context.Cambiodeobligaciones select table.IdCambiodeObligaciones).Max()) + 1; cambiodeobligaciones.IdCambiodeObligaciones = idCambiodeobligaciones; cambiodeobligaciones.SupervisionIdSupervision = idSupervision; #endregion #region agregar 1 entrada a Revocacion int idRevocacion = ((from table in _context.Revocacion select table.IdRevocacion).Max()) + 1; revocacion.IdRevocacion = idRevocacion; revocacion.SupervisionIdSupervision = idSupervision; #endregion _context.Add(personacausapenal); _context.Add(supervision); await _context.SaveChangesAsync(null, 1); //Guardar en 2 partes para satisfacer la restriccion de las llaves foraneas _context.Add(suspensionseguimiento); _context.Add(aer); _context.Add(planeacionestrategica); _context.Add(cierredecaso); _context.Add(cambiodeobligaciones); _context.Add(revocacion); await _context.SaveChangesAsync(null, 1); return(RedirectToAction(nameof(Index))); } return(View(personacausapenal)); }
/// <summary> /// אין אפשרות להכניס להזמנה מנה שאיננה עם הכשר מסוים /// we didnt use it beacuse we did another protection /// </summary> public bool unqualified_kosher(Dish ko, Supervision sher) { return(ko.get_sup == sher); }