protected void Page_Load(object sender, EventArgs e) { localhost.WebService1 ws = new localhost.WebService1(); string courseID = Session["coursedetail"].ToString(); string[] courseDetailArray = ws.getCourseDetails(courseID); lblCourseID.Text = lblCourseID.Text + "" + courseID; lblCourseName.Text = lblCourseName.Text + "" + courseDetailArray[1].ToString(); lblCourseSemester.Text = lblCourseSemester.Text + "" + courseDetailArray[3].ToString(); lblProfessor.Text = lblProfessor.Text + "" + courseDetailArray[4].ToString(); if (courseDetailArray[7].ToString() == "Online") { lblTiming.Visible = false; lblClassroom.Visible = false; } else { lblTiming.Text = lblTiming.Text + "" + courseDetailArray[5].ToString(); lblClassroom.Text = lblClassroom.Text + "" + courseDetailArray[6].ToString(); } lblCourseType.Text = lblCourseType.Text + "" + courseDetailArray[7].ToString(); if (Convert.ToBoolean(courseDetailArray[8].ToString())) { lblPrereqcourseID.Visible = true; lblPrereqcourseID.Text = lblPrereqcourseID.Text + "" + courseDetailArray[9].ToString(); } else { lblPrereqcourseID.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { localhost.WebService1 ws = new localhost.WebService1(); string courseID=Session["coursedetail"].ToString(); string[] courseDetailArray=ws.getCourseDetails(courseID); lblCourseID.Text = lblCourseID.Text+""+ courseID; lblCourseName.Text = lblCourseName.Text+""+ courseDetailArray[1].ToString(); lblCourseSemester.Text = lblCourseSemester.Text + "" + courseDetailArray[3].ToString(); lblProfessor.Text = lblProfessor.Text + "" + courseDetailArray[4].ToString(); if(courseDetailArray[7].ToString()=="Online") { lblTiming.Visible = false; lblClassroom.Visible = false; } else { lblTiming.Text = lblTiming.Text + "" + courseDetailArray[5].ToString(); lblClassroom.Text = lblClassroom.Text + "" + courseDetailArray[6].ToString(); } lblCourseType.Text= lblCourseType.Text + "" + courseDetailArray[7].ToString(); if (Convert.ToBoolean(courseDetailArray[8].ToString())) { lblPrereqcourseID.Visible = true; lblPrereqcourseID.Text = lblPrereqcourseID.Text + "" + courseDetailArray[9].ToString(); } else { lblPrereqcourseID.Visible = false; } }
public static List <Car> GetCarsFromWebServer() { localhost.WebService1 proxy = new localhost.WebService1(); var jsonAvailableCars = proxy.AvalialbleCars(); return(JsonConvert.DeserializeObject <List <Car> >(jsonAvailableCars)); }
public ActionResult Index() { var calc = new localhost.WebService1(); var result = calc.Add(8, 7); ViewBag.result = result; return(View()); }
public ActionResult GraficaWebService() { localhost.WebService1 service1 = new localhost.WebService1(); List <GraficaJs> proList = JsonConvert.DeserializeObject <List <GraficaJs> >(service1.getProveedoresCategorias()); List <GraficaJs> lista = new List <GraficaJs>(); foreach (var item in proList) { lista.Add(new GraficaJs(item.Label, (double)item.Y)); } ViewBag.DataPoints = JsonConvert.SerializeObject(lista); return(View()); }
protected void SemesterRadioButton_SelectedIndexChanged(object sender, EventArgs e) { if (Session["email"] != null) { CourseListTable.Visible = true; localhost.WebService1 ws = new localhost.WebService1(); string semester = SemesterRadioButton.SelectedItem.Value; //localhopstList<Course> cl = (ws.getCourseList(semester)); localhost.Course[] cllist = ws.getCourseList(semester); foreach (localhost.Course c in cllist) { TableRow tr = new TableRow(); CourseListTable.Rows.Add(tr); //To fetch the courseid TableCell tc1 = new TableCell(); //HyperLink hl = new HyperLink(); //hl.ID = c.courseID.ToString(); //hl.NavigateUrl = "~/CourseWizard/CourseDetails"; //hl.Text = c.courseID.ToString(); //Session["coursedetail"] = hl.ID.ToString(); LinkButton lb = new LinkButton(); lb.Text = c.courseID.ToString(); lb.ID = c.courseID.ToString(); lb.Click += new System.EventHandler(lb_Onclick); tc1.Controls.Add(lb); //tc1.Text = c.courseID.ToString(); tr.Cells.Add(tc1); //To fetch the course name TableCell tc2 = new TableCell(); tc2.Text = c.courseName.ToString(); tr.Cells.Add(tc2); } } else { ErrorMessageCourseList.Visible = true; ErrorTextCourseList.Visible = true; ErrorTextCourseList.Text = "You are not a logged in user. Please log in."; } }
private void FtoC_Click(object sender, EventArgs e) { double op = 0; localhost.WebService1 ws2 = new localhost.WebService1(); bool isNum = double.TryParse(txtF.Text, out op); if (isNum) { txtRezultat.Text = ws2.FtoC(op).ToString(); } else { MessageBox.Show("Temperatura inserata in grade Farenheit trebuie sa fie numar real!"); txtRezultat.Clear(); txtF.Clear(); } }
protected void Page_Load(object sender, EventArgs e) { localhost.WebService1 ws = new localhost.WebService1(); string email = Session["email"].ToString(); string userid = ws.getuserid(email); string[] student = ws.getStudentInfo(userid); string name = student[2] + " " + student[3]; string studentid = student[1].ToString(); if (Session["email"] != null) { SuccessMessage.Visible = true; SuccessText.Visible = true; SuccessText.Text = "You have successfully logged in."; lblStudentName.Text = "Welcome " + name; lblStudentID.Text = "Student ID: " + studentid; } }
protected void btnAddCourse_Click(object sender, EventArgs e) { string semester = SemesterRadioButton.SelectedItem.Value; if (semester == "Spring 2016") { localhost.WebService1 ws = new localhost.WebService1(); string userid = ws.getuserid(Session["email"].ToString()); string email = Session["email"].ToString(); string[] studentinfo = ws.getStudentInfo(userid); string studentid = studentinfo[1].ToString(); bool flag = false; if (txtCourseSelection.Text != null) { localhost.Course[] cllist = ws.getCourseList(semester); foreach (localhost.Course c in cllist) { if (c.courseID == txtCourseSelection.Text) { flag = true; break; } } if (flag) { Session["courseid"] = txtCourseSelection.Text; Session["returnmessage"] = ws.dropCourse(txtCourseSelection.Text, semester, studentid ); } else { Session["returnmessage"] = "You have entered an incorrect courseid. Please try again."; } } } else { Session["returnmessage"] = "You are not allowed to drop courses for Fall 2015 at this time."; } Response.Redirect("~/CourseWizard/CourseEnrollmentMessage"); }
protected void btnAddCourse_Click(object sender, EventArgs e) { string semester = SemesterRadioButton.SelectedItem.Value; if (semester == "Spring 2016") { localhost.WebService1 ws = new localhost.WebService1(); string userid = ws.getuserid(Session["email"].ToString()); string email = Session["email"].ToString(); string[] studentinfo = ws.getStudentInfo(userid); string studentid = studentinfo[1].ToString(); bool flag = false; if (txtCourseSelection.Text != null) { localhost.Course[] cllist = ws.getCourseList(semester); foreach (localhost.Course c in cllist) { if (c.courseID == txtCourseSelection.Text) { flag = true; break; } } if (flag) { Session["courseid"] = txtCourseSelection.Text; Session["returnmessage"] = ws.dropCourse(txtCourseSelection.Text, semester, studentid); } else { Session["returnmessage"] = "You have entered an incorrect courseid. Please try again."; } } } else { Session["returnmessage"] = "You are not allowed to drop courses for Fall 2015 at this time."; } Response.Redirect("~/CourseWizard/CourseEnrollmentMessage"); }
public ActionResult DownloadViewPDF(int idProveedor) { localhost.WebService1 service1 = new localhost.WebService1(); List <GraficaJs> proList = JsonConvert.DeserializeObject <List <GraficaJs> >(service1.getProveedoresCategorias()); List <GraficaJs> lista = new List <GraficaJs>(); foreach (var item in proList) { lista.Add(new GraficaJs(item.Label, (double)item.Y)); } ViewBag.DataPoints = JsonConvert.SerializeObject(lista); //Code to get content return(new Rotativa.MVC.PartialViewAsPdf("_DescargaProveedor", db.proveedor.Find(idProveedor)) { FileName = "TestViewAsPdf.pdf" }); }
protected void LogIn(object sender, EventArgs e) { localhost.WebService1 ws = new localhost.WebService1(); if (IsValid) { // Validate the user password string email = Email.Text; string pass = Password.Text; string returnPass = ws.validateUserAccountWS(email); if (pass.Equals(returnPass)) { Session["email"] = Email.Text; Response.Redirect("~/Account/LoginSuccess"); } else { ErrorMessage.Visible = true; FailureText.Visible = true; FailureText.Text = "Invalid Credentials. Please try again!"; } } }
protected void SemesterRadioButton_SelectedIndexChanged(object sender, EventArgs e) { if (Session["email"] != null) { ClassScheduleTable.Visible = true; localhost.WebService1 ws = new localhost.WebService1(); string semester = SemesterRadioButton.SelectedItem.Value; string email = Session["email"].ToString(); string userid = ws.getuserid(email); string[] studentinfo = ws.getStudentInfo(userid); string studentid = studentinfo[1].ToString(); //localhopstList<Course> cl = (ws.getCourseList(semester)); localhost.Course[] cllist = ws.getCourseHistory(semester, studentid); if (cllist.Length != 0) { foreach (localhost.Course c in cllist) { TableRow tr = new TableRow(); ClassScheduleTable.Rows.Add(tr); //To fetch the courseid TableCell tc1 = new TableCell(); tc1.Text = c.courseID.ToString(); tr.Cells.Add(tc1); //To fetch the course name TableCell tc2 = new TableCell(); tc2.Text = c.courseName.ToString(); tr.Cells.Add(tc2); //To fetch Professor TableCell tc3 = new TableCell(); tc3.Text = c.prof.ToString(); tr.Cells.Add(tc3); //To fetch Classroom Details TableCell tc4 = new TableCell(); tc4.Text = c.classroom.ToString(); tr.Cells.Add(tc4); //To fetch Timings TableCell tc5 = new TableCell(); tc5.Text = c.schedule.ToString(); tr.Cells.Add(tc5); //To fetch the enrollment History TableCell tc6 = new TableCell(); tc6.Text = c.status.ToString(); tr.Cells.Add(tc6); } } else { NotRegisteredlbl.Visible = true; NotRegisteredlbl.Text = "You do not have any classes registered."; ClassScheduleTable.Visible = false; } } else { ErrorMessageClassSchedule.Visible = true; ErrorTextClassSchedule.Visible = true; ErrorTextClassSchedule.Text = "You are not a logged in user. Please log in."; } }
protected void btnTest_Click(object sender, EventArgs e) { String[] n = new String[10]; localhost.WebService1 servizioSoap = new localhost.WebService1(); servizioSoap.LeggiUtenti(); }
protected void SemesterRadioButton_SelectedIndexChanged(object sender, EventArgs e) { if (Session["email"] != null) { CourseListTable.Visible = true; btnAddCourse.Visible = true; txtCourseSelection.Visible = true; lblCourseSelection.Visible = true; localhost.WebService1 ws = new localhost.WebService1(); string semester = SemesterRadioButton.SelectedItem.Value; string email = Session["email"].ToString(); string userid = ws.getuserid(email); string[] studentinfo = ws.getStudentInfo(userid); string studentid = studentinfo[1].ToString(); localhost.Course[] cllist = ws.getEnrolledCourses(semester, studentid); if (cllist.Length != 0) { foreach (localhost.Course c in cllist) { TableRow tr = new TableRow(); CourseListTable.Rows.Add(tr); //To fetch the courseid TableCell tc1 = new TableCell(); tc1.Text = c.courseID.ToString(); tr.Cells.Add(tc1); //To fetch the course name TableCell tc2 = new TableCell(); tc2.Text = c.courseName.ToString(); tr.Cells.Add(tc2); //To fetch Professor TableCell tc3 = new TableCell(); tc3.Text = c.prof.ToString(); tr.Cells.Add(tc3); //To fetch Classroom Details TableCell tc4 = new TableCell(); tc4.Text = c.classroom.ToString(); tr.Cells.Add(tc4); //To fetch Timings TableCell tc5 = new TableCell(); tc5.Text = c.schedule.ToString(); tr.Cells.Add(tc5); } } else { ErrorMessageCourseList.Visible = true; ErrorTextCourseList.Visible = true; ErrorTextCourseList.Text = "You are not a logged in user. Please log in."; } } }
protected void SemesterRadioButton_SelectedIndexChanged(object sender, EventArgs e) { if (Session["email"] != null) { CourseListTable.Visible = true; btnAddCourse.Visible = true; txtCourseSelection.Visible = true; lblCourseSelection.Visible = true; localhost.WebService1 ws = new localhost.WebService1(); string semester = SemesterRadioButton.SelectedItem.Value; localhost.Course[] cllist = ws.getCourseList(semester); foreach (localhost.Course c in cllist) { string[] courseDetails = ws.getCourseDetails(c.courseID.ToString()); TableRow tr = new TableRow(); CourseListTable.Rows.Add(tr); //To fetch the courseid TableCell tc1 = new TableCell(); tc1.ID = c.courseID.ToString(); tc1.Text = c.courseID.ToString(); tr.Cells.Add(tc1); //To fetch the course name TableCell tc2 = new TableCell(); tc2.Text = c.courseName.ToString(); tr.Cells.Add(tc2); //To fetch the professor TableCell tc3 = new TableCell(); tc3.Text = courseDetails[4].ToString(); tr.Cells.Add(tc3); //To fetch the timings TableCell tc4 = new TableCell(); tc4.Text = courseDetails[5].ToString(); tr.Cells.Add(tc4); //To fetch the prerequisite course id TableCell tc5 = new TableCell(); if (courseDetails[9].ToString() != null) { tc5.Text = courseDetails[9].ToString(); } else { tc5.Text = ""; } tr.Cells.Add(tc5); } } else { ErrorMessageCourseList.Visible = true; ErrorTextCourseList.Visible = true; ErrorTextCourseList.Text = "You are not a logged in user. Please log in."; } }