public ActionResult PrenotaSala(DateTime giorno, Int32 oraI, Int32 oraF, Int32 idSala) { string messaggio = ""; try { DateTime dataOraInizio = giorno.AddHours(oraI); DateTime dataOraFine = giorno.AddHours(oraF); Boolean esito = DB_Manager.sala_prenota(dataOraInizio, dataOraFine, idSala); if (esito) { messaggio = "<p style='color:green'>Salvataggio prenotazione avvenuto con successo</p>"; } else { messaggio = "<p style='color:red'>Si è verificato un errore</p>"; } } catch (Exception e) { } return(Content(messaggio)); }
public void getMonthlyPlanner(string date) { IList <Activity> activities = new DB_Manager().GetMonthlyActivities(date); IList <Birthdate> childData = new DB_Manager().GetMonthlyBirthdays(date); IList <CourtOrderDates> courtDate = new DB_Manager().GetMonthlyCourtDates(date); if (activities.Count > 0) { txtActivities.Text = activities.Count.ToString(); } else { txtActivities.Text = "No Activities Available for this Month"; } if (childData.Count > 0) { txtBirthdays.Text = childData.Count.ToString(); } else { txtBirthdays.Text = "No Birthdays for this Month"; } if (courtDate.Count > 0) { txtCourtDates.Text = courtDate.Count.ToString(); } else { txtCourtDates.Text = "No Court Dates for this Month"; } }
private void textBoxBD_TextChanged(object sender, EventArgs ev, DB_Manager dB_Manager, string dB_Name) { // llena el cuadro de tablas con las tablas de una bd SqlConnection conexion = DB_Connection.DB_Connexion_Open(dB_Name); try { // recogemos los nombres de las tablas en un objeto DataTable dt = conexion.GetSchema("Tables"); // eliminamos el contenido de la lista dB_Manager.listBoxTabla.Items.Clear(); // por cada nombre en el objeto foreach (DataRow row in dt.Rows) { // printamos dB_Manager.listBoxTabla.Items.Add((string)row[2]); } } catch (Exception e) { MessageBox.Show(Convert.ToString(e)); } finally { conexion.Close(); } }
protected void gv_books_RowDeleting(object sender, GridViewDeleteEventArgs e) { DB_Manager.deleteBook(gv_books.Rows[e.RowIndex].Cells[1].Text); ViewState["books"] = DB_Manager.getAllBooks(); gv_books.DataSource = ViewState["books"]; DataBind(); }
protected void Calendar1_SelectionChanged(object sender, EventArgs e) { DateTime myDate = new DateTime(); myDate = Calendar1.SelectedDate; selectDate = myDate.ToString("yyyy/MM/dd"); lblDate.Text = null; lblLocation.Text = null; lblTime.Text = null; IList <Activity> activities = new DB_Manager().GetDailyActivities(selectDate); IList <Birthdate> childData = new DB_Manager().GetDailyBirthdays(selectDate); IList <CourtOrderDates> courtDate = new DB_Manager().GetDailyCourtDates(selectDate); if (activities.Count > 0) { lblDate.Text = null; foreach (Activity activityList in activities) { DateTime startdate = Convert.ToDateTime(activityList.ActivityDate); startdate.ToString("dddd, dd MMMM yyyy"); lblDate.Text += activityList.ActivityDescription + " " + startdate.ToString("dddd, dd MMMM yyyy") + " " + activityList.ActivityTime + "<br/>"; } } else { lblDate.Text = "No Activities for this day!"; } if (childData.Count > 0) { lblLocation.Text = null; foreach (Birthdate child in childData) { DateTime startdate = Convert.ToDateTime(child.Dob); startdate.ToString("dddd, dd MMMM yyyy"); lblLocation.Text += child.FirstName + " " + child.Surname + " " + startdate.ToString("dddd, dd MMMM yyyy") + "\n"; } } else { lblLocation.Text = "No Birthdays for today"; } if (courtDate.Count > 0) { lblTime.Text = null; foreach (CourtOrderDates court in courtDate) { DateTime date = Convert.ToDateTime(court.CourtOrderDate); date.ToString("dddd, dd MMMM yyyy"); lblTime.Text += court.FirstName + " , " + court.Surname + " , " + date.ToString("dddd, dd MMMM yyyy"); } } else { lblTime.Text = "No Court Date"; } }
public void FillComboBox() { updating = true; IList <Facility> facilities = new DB_Manager().GetFacicilities(); if (facilities != null) { cbFacilities.DataSource = facilities; cbFacilities.DataTextField = "FacilityName"; cbFacilities.DataValueField = "FacilityID"; cbFacilities.DataBind(); } IList <JobRole> role = new DB_Manager().GetJobRole(); if (role != null) { cbJobRole.DataSource = role; cbJobRole.DataTextField = "JobRoleDescription"; cbJobRole.DataValueField = "JobRoleID"; cbJobRole.DataBind(); } IList <Employee_Status> status = new DB_Manager().GetEmployeeStatus(); if (status != null) { cbStatus.DataSource = status; cbStatus.DataTextField = "EmployeeDescription"; cbStatus.DataValueField = "EmployeeStatusID"; cbStatus.DataBind(); } IList <Gender> gender = new DB_Manager().GetGender(); if (gender != null) { cbGender.DataSource = gender; cbGender.DataTextField = "GenderDescription"; cbGender.DataValueField = "GenderID"; cbGender.DataBind(); } IList <Nationality> nationality = new DB_Manager().GetNationality(); if (nationality != null) { cbNationality.DataSource = nationality; cbNationality.DataTextField = "NationalityDesc"; cbNationality.DataValueField = "NationalityID"; cbNationality.DataBind(); } updating = false; }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (DB_Manager.bookIsLiked(lbl_isbn.Text, user)) { DB_Manager.dislikeBook(lbl_isbn.Text, user); } else { DB_Manager.likeBook(lbl_isbn.Text, user); } }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
public void getChildNames() { IList <ChildFullName> childnames = new DB_Manager().GetChildNames(); if (childnames != null) { cbChildNames.DataSource = childnames; cbChildNames.DataTextField = "childFullname"; cbChildNames.DataValueField = "childID"; cbChildNames.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["books"] = DB_Manager.getAllBooks(); ListView1.DataSource = ViewState["books"]; DataBind(); } else { ListView1.DataSource = ViewState["books"]; DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { IList <ChildFullName> childnames = new DB_Manager().GetChildNames(); if (childnames != null) { cbNames.DataSource = childnames; cbNames.DataTextField = "childFullname"; cbNames.DataValueField = "childID"; cbNames.DataBind(); } } }
protected void btn_filter_Click(object sender, EventArgs e) { if (rbl_category.SelectedValue == "Authors") { ViewState["books"] = DB_Manager.getBooksByAuthor(int.Parse(ddl_category.SelectedValue)); ListView1.DataSource = ViewState["books"]; DataBind(); } else if (rbl_category.SelectedValue == "Genres") { ViewState["books"] = DB_Manager.getBooksByGenre(int.Parse(ddl_category.SelectedValue)); ListView1.DataSource = ViewState["books"]; DataBind(); } }
public ActionResult Index() { CorsiModel model = new CorsiModel(); try { List <CorsoModel> corsi = DB_Manager.corsi_getList(); model.Corsi = corsi; }catch (Exception e) { } return(View(model)); }
protected void Page_Load(object sender, EventArgs e) { var q = (string)Request.QueryString["ISBN"]; if (q != null) { UC_Book.isbn = q; book = DB_Manager.getBookByISBN(q); lbl_description.Text = book.description; var r = DB_Manager.getReviews((string)Request.QueryString["ISBN"]); r.Reverse(); ListView1.DataSource = r; DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { IList <Facility> facilities = new DB_Manager().GetFacicilities(); if (facilities != null) { cbFalicities.DataSource = facilities; cbFalicities.DataTextField = "FacilityName"; cbFalicities.DataValueField = "FacilityID"; cbFalicities.DataBind(); } } Session["facility"] = Convert.ToInt32(cbFalicities.SelectedValue); }
public void dB_Manager_Controller(DB_Manager dB_Manager) { // Controlador principal, aplica los eventos en los botones y ejecuta la ventana. //EVENTOS dB_Manager.buttonListarTablas.Click += (sender, EventArgs) => { textBoxBD_TextChanged(sender, EventArgs, dB_Manager, dB_Manager.textBoxBD.Text); }; dB_Manager.boton_verTabla.Click += (sender, EventArgs) => { verTabla_Click(sender, EventArgs, dB_Manager.textBoxBD.Text, Convert.ToString(dB_Manager.listBoxTabla.SelectedItem), dB_Manager); }; dB_Manager.boton_verRegistros.Click += (sender, EventArgs) => { verRegistros_Click(sender, EventArgs, dB_Manager.textBoxBD.Text, Convert.ToString(dB_Manager.listBoxTabla.SelectedItem), dB_Manager); }; dB_Manager.boton_actualizar.Click += (sender, EventArgs) => { insertar_Click(sender, EventArgs, dB_Manager.textBoxBD.Text, Convert.ToString(dB_Manager.listBoxTabla.SelectedItem), dB_Manager); }; dB_Manager.boton_eliminar.Click += (sender, EventArgs) => { eliminar_Click(sender, EventArgs, dB_Manager.textBoxBD.Text, Convert.ToString(dB_Manager.listBoxTabla.SelectedItem), dB_Manager); }; dB_Manager.boton_editar.Click += (sender, EventArgs) => { editarRegistro_Click(sender, EventArgs, dB_Manager.textBoxBD.Text, Convert.ToString(dB_Manager.listBoxTabla.SelectedItem), dB_Manager); }; // ejecutamos y abrimos la ventana del programa Application.Run(dB_Manager); }
public ActionResult CercaSale(DateTime giorno, Int32 oraI, Int32 oraF) { List <SalaModel> saleDisponibili = new List <SalaModel>(); try { DateTime dataOraInizio = giorno.AddHours(oraI); DateTime dataOraFine = giorno.AddHours(oraF); saleDisponibili = DB_Manager.saleDisponibili_getList(dataOraInizio, dataOraFine); }catch (Exception e) { } return(View("~/Views/Prenota/SaleDisponibili.cshtml", saleDisponibili)); }
protected void rbl_category_SelectedIndexChanged(object sender, EventArgs e) { if (rbl_category.SelectedValue == "Authors") { ddl_category.DataSource = DB_Manager.getAllAuthors(); ddl_category.DataValueField = "id"; ddl_category.DataTextField = "Name"; DataBind(); } else if (rbl_category.SelectedValue == "Genres") { ddl_category.DataSource = DB_Manager.getAllGenres(); ddl_category.DataValueField = "id"; ddl_category.DataTextField = "Name"; DataBind(); } }
//__________________________________________Initialize_____________________________________________ void Start() { DB_Manager sm = DB_Manager.Instance; for (int i = 0; i < DB_Manager.RANGE_CCN_chart; ++i) { UICountings[i].Init(i + DB_Manager.MIN_CCN_chart); } worldOfScreenMinimum = UICamera.mainCamera.ScreenToWorldPoint(Vector3.zero); UIGrid situationGrid = transform.GetChild(0).GetComponent <UIGrid>(); situationSize = new Vector2( situationMaximum.position.x - situationMinimum.position.x, situationMaximum.position.y - situationMinimum.position.y); popUpUI.OnExit = DisHighlight; }
protected void img_Like_PreRender(object sender, EventArgs e) { if (Request.IsAuthenticated && _isbn != null) { if (DB_Manager.bookIsLiked(_isbn, user)) { img_Like.ImageUrl = "~/imgs/liked.png"; } else { img_Like.ImageUrl = "~/imgs/like.png"; } lbl_NumofLikes.Text = DB_Manager.getBookViewByISBN(_isbn).NumOfLikes.ToString(); } else { img_Like.Visible = false; } }
protected void ShowDiv(object sender, EventArgs e) { schedule.Visible = true; DateTime today = DateTime.Today; selectDate = today.ToString("yyyy/MM/dd"); IList <Activity> activities = new DB_Manager().GetMonthlyActivities(selectDate); IList <Birthdate> childData = new DB_Manager().GetMonthlyBirthdays(selectDate); IList <CourtOrderDates> courtDate = new DB_Manager().GetMonthlyCourtDates(selectDate); if (activities.Count > 0) { txtActivities.Text = null; foreach (Activity activityList in activities) { DateTime startdate = Convert.ToDateTime(activityList.ActivityDate); startdate.ToString("dddd, dd MMMM yyyy"); txtActivities.Text += activityList.ActivityDescription + " " + startdate.ToString("dddd, dd MMMM yyyy") + " " + activityList.ActivityTime + "<br/>"; } } if (childData.Count > 0) { txtBirthdays.Text = null; foreach (Birthdate child in childData) { DateTime startdate = Convert.ToDateTime(child.Dob); startdate.ToString("dddd, dd MMMM yyyy"); txtBirthdays.Text += child.FirstName + " " + child.Surname + " " + startdate.ToString("dddd, dd MMMM yyyy") + "<br/>"; } } if (courtDate.Count > 0) { txtCourtDates.Text = null; foreach (CourtOrderDates court in courtDate) { DateTime date = Convert.ToDateTime(court.CourtOrderDate); date.ToString("dddd, dd MMMM yyyy"); txtCourtDates.Text += court.FirstName + " " + court.Surname + " , " + date.ToString("dddd, dd MMMM yyyy") + "<br/>"; } } }
public ActionResult Index() { if (SessionObjects.LoggedUser == null) { return(RedirectToAction("Login", "Login")); } RiepilogoModel model = new RiepilogoModel(); try { model.Corsi = DB_Manager.corsi_getListByUser(); model.Lezione = DB_Manager.prossimaLezione_get(); model.Prenotazioni = DB_Manager.prenotazioni_geList(); }catch (Exception e) { } return(View(model)); }
protected void submitReview_Click(object sender, EventArgs e) { var txt_Review = loginView1.FindControl("txt_Review") as TextBox; var txt_HeadLine = loginView1.FindControl("txt_HeadLine") as TextBox; DB_Manager.addReview( new Review { bookId = (string)Request.QueryString["ISBN"], details = txt_Review.Text, headLine = txt_HeadLine.Text, userId = DB_Manager.getUserByName(HttpContext.Current.User.Identity.Name).Id }); txt_HeadLine.Text = txt_Review.Text = ""; var r = DB_Manager.getReviews((string)Request.QueryString["ISBN"]); r.Reverse(); ListView1.DataSource = r; DataBind(); }
public ActionResult Login(LoginViewModel model) { if (!ModelState.IsValid) { return(View(model)); } Utente utente = DB_Manager.utente_login(model.Email, model.Password); if (utente != null) { SessionObjects.LoggedUser = utente; return(RedirectToAction("Index", "Riepilogo")); } ModelState.AddModelError("", "Tentativo di accesso non valido."); return(View(model)); }
protected void addAuthor_Click(object sender, EventArgs e) { if (!cancelEditing.Visible) { DB_Manager.addAuthor(new Author { Name = AuthorName.Text, description = description.Text }); } else { DB_Manager.updateAuthor(new Author { id = int.Parse(gv_Authors.SelectedRow.Cells[2].Text), Name = AuthorName.Text, description = description.Text }); } bindAuthors(); addAuthor.Text = "Add Author"; cancelEditing.Visible = false; AuthorName.Text = ""; description.Text = ""; }
protected void addGenre_Click(object sender, EventArgs e) { if (!cancelEditing.Visible) { DB_Manager.addGenre(new Genre { Name = genreName.Text, description = description.Text }); } else { DB_Manager.updateGenre(new Genre { id = int.Parse(gv_genres.SelectedRow.Cells[2].Text), Name = genreName.Text, description = description.Text }); } bindGenres(); addGenre.Text = "Add Genre"; cancelEditing.Visible = false; genreName.Text = ""; description.Text = ""; }
protected void Log_In(object sender, EventArgs e) { string pattern = null; pattern = "^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$"; if (txtUsername.Text != "" && txtPassword.Text != "") { if (Regex.IsMatch(txtUsername.Text, pattern)) { IList <Employee> logIn = new DB_Manager().userLogIn(txtUsername.Text, txtPassword.Text); if (logIn.Count > 0) { foreach (Employee employeeDetails in logIn) { if (employeeDetails.EmployeeStatusID.Equals(1)) { Response.Redirect("HOME_PAGE.aspx"); } } } else { txtErrorMessage.Visible = true; txtErrorMessage.Text = "Incorrect username or Password"; } } else { txtErrorMessage.Visible = true; txtErrorMessage.Text = "Incorrect/Invalid Email"; } } else { txtErrorMessage.Visible = true; txtErrorMessage.Text = "Please input username or password"; } }
protected void Page_Load(object sender, EventArgs e) { Page.Form.Attributes.Add("enctype", "multipart/form-data"); Page.MaintainScrollPositionOnPostBack = true; if (!IsPostBack) { ViewState["books"] = DB_Manager.getAllBooks(); gv_books.DataSource = ViewState["books"]; ddl_authors.DataSource = DB_Manager.getAllAuthors(); ddl_authors.DataValueField = "id"; ddl_authors.DataTextField = "Name"; ddl_genres.DataSource = DB_Manager.getAllGenres(); ddl_genres.DataValueField = "id"; ddl_genres.DataTextField = "Name"; DataBind(); } else { gv_books.DataSource = ViewState["books"]; } }
protected void addBook_Click(object sender, EventArgs e) { Book bk = new Book { ISBN = txt_ISBN.Text, title = txt_title.Text, authorId = int.Parse(ddl_authors.SelectedValue), genreId = int.Parse(ddl_genres.SelectedValue), date = calendar.SelectedDate, description = txt_description.Text }; if (fileUpload.HasFile) { string img = "~/imgs/" + bk.ISBN + ".png"; fileUpload.SaveAs(Server.MapPath(img)); bk.image = img; } if (!cancelEditing.Visible) { DB_Manager.addBook(bk); } else { DB_Manager.updateBook(bk); } ViewState["books"] = DB_Manager.getAllBooks(); gv_books.DataSource = ViewState["books"]; DataBind(); addBook.Text = "Add Book"; cancelEditing.Visible = false; img_cover.ImageUrl = "~/imgs/cover.png"; txt_ISBN.Text = ""; txt_title.Text = ""; txt_description.Text = ""; calendar.SelectedDate = DateTime.Now; }
IEnumerator PreloadMenu() { yield return(new WaitForSeconds(0.3f)); manager = GameObject.Find("MySqlManager").GetComponent <DB_Manager>(); // managerEvent = GameObject.Find("MySqlManager").GetComponent<EVENTCREATOR_Manager>(); cadenas = GameObject.FindGameObjectsWithTag("Cadenas"); currentStagePlayer = 1; if (cadenas.Length > 0) { foreach (GameObject cadena in cadenas) { cadena.SetActive(false); } } CheckLogin(); infosTransition = GameObject.Find("InfosStock").GetComponent <InfosTransition>(); choixManette = GameObject.Find("Stages").GetComponent <ChoixManette>(); infosTransition.CheckManette(); choixManette.MenuPrincipal(); }