public StudentInfoWindow(string fullname, string group, Faculties faculty, string telephone, string email, string address, double averageMark) { InitializeComponent(); PIB.Text = fullname; GroupText.Text = group; FacultyText.Text = faculty.ToString(); TelephoneText.Text = telephone; EmailText.Text = email; Email.NavigateUri = new Uri(string.Concat("mailto:", email, "?subject=Лист згенеровано програмно")); AdressText.Text = address; AverageMarkText.Text = Math.Round(averageMark, 2).ToString(); }
public static bool AddFacilityAdmin(SystemAdmin assigner, string useridToAssign, Faculties f) { if (assigner.UserID == useridToAssign) { throw new FaultException<SException>(new SException(), new FaultReason("You cannot Remove your own role!")); } else { RemoveAllRoles(useridToAssign); //Remove existing role DAL dalDataContext = new DAL(); try { FacilityAdmin fa = (from facAdm in dalDataContext.facAdmins where facAdm.Faculty == f select facAdm).FirstOrDefault<FacilityAdmin>(); if (fa == null) { Table<FacilityAdmin> sTable = dalDataContext.facAdmins; fa = new FacilityAdmin(useridToAssign, f); sTable.InsertOnSubmit(fa); sTable.Context.SubmitChanges(); } else { fa.UserID = useridToAssign; dalDataContext.SubmitChanges(); } string msg = assigner.Name + " has assigned you to the role of Facility Admin for " + f.ToString().Replace("_", " "); string title = "You have been Added to the System Group - Facility Administrator"; NotificationController.sendNotification(assigner.UserID, useridToAssign, title, msg); return true; } catch (Exception) { throw new FaultException<SException>(new SException(), new FaultReason("An Error occured while the system is Adding the user's role, Please Try Again!")); } } }