protected void OnUpdate(object sender, EventArgs e) { //Find the reference of the Repeater Item. RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem; int ID = int.Parse((item.FindControl("lblID") as Label).Text); string subject = (item.FindControl("txtSubj") as TextBox).Text.Trim(); string homework = (item.FindControl("txtHomework") as TextBox).Text.Trim(); var checkHomework = (from c in db.Homeworks where c.ID.Equals(ID) select c).FirstOrDefault(); checkHomework.Subject = subject; checkHomework.Homework1 = homework; db.SubmitChanges(); Repeater1.DataBind(); Repeater2.DataBind(); Repeater3.DataBind(); Repeater4.DataBind(); Repeater5.DataBind(); Repeater6.DataBind(); Repeater7.DataBind(); Repeater8.DataBind(); Repeater8.DataBind(); Repeater9.DataBind(); Repeater10.DataBind(); Repeater11.DataBind(); Repeater12.DataBind(); Repeater13.DataBind(); Repeater14.DataBind(); Repeater15.DataBind(); }
protected void OnDelete(object sender, EventArgs e) { //Find the reference of the Repeater Item. RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem; int ID = int.Parse((item.FindControl("lblID") as Label).Text); var checkHomework = (from c in db.Homeworks where c.ID.Equals(ID) select c).FirstOrDefault(); db.Homeworks.DeleteOnSubmit(checkHomework); db.SubmitChanges(); Repeater1.DataBind(); Repeater2.DataBind(); Repeater3.DataBind(); Repeater4.DataBind(); Repeater5.DataBind(); Repeater6.DataBind(); Repeater7.DataBind(); Repeater8.DataBind(); Repeater8.DataBind(); Repeater9.DataBind(); Repeater10.DataBind(); Repeater11.DataBind(); Repeater12.DataBind(); Repeater13.DataBind(); Repeater14.DataBind(); Repeater15.DataBind(); }
/// <summary> /// 工程项目考核汇总表 /// </summary> private void Bindgcxmkhhzb() { string strsql = "select * from tunnel_newstype where IsDel=0 and parentid=21"; DataSet das = Tunnel.Data.DbHelperSQL.Query(strsql); if (das.Tables[0].Rows.Count > 0) { Repeater10.DataSource = das; Repeater10.DataBind(); Repeater10.Visible = true; string strsql2 = "select top " + gettop(8 - das.Tables[0].Rows.Count) + " * from tunnel_index where typeid=21 and del=0 and IsDel=0 order by setdate desc "; DataSet das2 = Tunnel.Data.DbHelperSQL.Query(strsql2); Repeater3.DataSource = das2; Repeater3.DataBind(); } else { string strsql2 = "select top 8 * from tunnel_index where typeid=21 and del=0 and IsDel=0 order by setdate desc"; DataSet das2 = Tunnel.Data.DbHelperSQL.Query(strsql2); Repeater3.DataSource = das2; Repeater3.DataBind(); Repeater3.Visible = true; Repeater10.Visible = false; } }
protected void bindRepeater10() { DataTable dt = b_Ask.GetTopUser(); Repeater10.DataSource = dt; Repeater10.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { //last week SqlDataSource2.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource3.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource4.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource5.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource6.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; //this week SqlDataSource7.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource8.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource9.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource10.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource11.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; //next week SqlDataSource12.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource13.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource14.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource15.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; SqlDataSource16.SelectParameters["UserClass"].DefaultValue = RadioButtonList1.SelectedValue; Repeater1.DataBind(); Repeater2.DataBind(); Repeater3.DataBind(); Repeater4.DataBind(); Repeater5.DataBind(); Repeater6.DataBind(); Repeater7.DataBind(); Repeater8.DataBind(); Repeater8.DataBind(); Repeater9.DataBind(); Repeater10.DataBind(); Repeater11.DataBind(); Repeater12.DataBind(); Repeater13.DataBind(); Repeater14.DataBind(); Repeater15.DataBind(); }
protected void btnAddHomework10_Click(object sender, EventArgs e) { Homework homework = new Homework(); homework.Class = Convert.ToInt32(RadioButtonList1.SelectedValue); homework.Subject = txtAddSubj10.Text; homework.Homework1 = txtAddHomework10.Text; string[] test = date10.Text.Split('/'); string ss = test[1] + "/" + test[0]; homework.Date = Convert.ToDateTime(ss); db.Homeworks.InsertOnSubmit(homework); db.SubmitChanges(); txtAddSubj10.Text = ""; txtAddHomework10.Text = ""; Repeater10.DataBind(); }
protected void FillInvoicesList(DataTable dt_invoices) { Invoice[] invoices = new Invoice[dt_invoices.Rows.Count]; int[] invoiceIDs = new int[dt_invoices.Rows.Count]; int countShowing = 0; dt_invoices.Columns.Add("message_reversed_wiped", typeof(string)); dt_invoices.Columns.Add("td_name", typeof(string)); // for use of td 'name' tag to hide all reversed or hide all rejected dt_invoices.Columns.Add("style_display", typeof(string)); // to set initially reversed and/or rejected as hidden dt_invoices.Columns.Add("inv_debtor", typeof(string)); dt_invoices.Columns.Add("inv_total_due", typeof(decimal)); for (int i = 0; i < dt_invoices.Rows.Count; i++) { Invoice invoice = InvoiceDB.LoadAll(dt_invoices.Rows[i]); invoiceIDs[i] = invoice.InvoiceID; invoices[i] = invoice; if (invoice.ReversedBy != null) { dt_invoices.Rows[i]["message_reversed_wiped"] = "Reversed"; dt_invoices.Rows[i]["td_name"] = "td_reversed"; dt_invoices.Rows[i]["style_display"] = "none"; } else if (invoice.PayerOrganisation != null && (invoice.PayerOrganisation.OrganisationID == -1 || invoice.PayerOrganisation.OrganisationID == -2) && invoice.Total > 0 && invoice.CreditNotesTotal >= invoice.Total) { dt_invoices.Rows[i]["message_reversed_wiped"] = "Rejected"; dt_invoices.Rows[i]["td_name"] = "td_rejected"; dt_invoices.Rows[i]["style_display"] = "none"; } else { countShowing++; } if (invoice.PayerOrganisation != null) { dt_invoices.Rows[i]["inv_debtor"] = invoice.PayerOrganisation.Name; } else if (invoice.PayerPatient != null) { dt_invoices.Rows[i]["inv_debtor"] = invoice.PayerPatient.Person.FullnameWithoutMiddlename; } else { dt_invoices.Rows[i]["inv_debtor"] = invoice.Booking != null && invoice.Booking.Patient != null && invoice.Booking.Patient.Person != null ? invoice.Booking.Patient.Person.FullnameWithoutMiddlename : string.Empty; // empty for invoices without bookings } dt_invoices.Rows[i]["inv_total_due"] = invoice.TotalDue.ToString(); } // single db call to get invoicelines into hashtable lookup by invoice Hashtable invoiceLinesHash = InvoiceLineDB.GetBulkInvoiceLinesByInvoiceID(invoices); dt_invoices.Columns.Add("inv_lines_text", typeof(string)); for (int i = 0; i < dt_invoices.Rows.Count; i++) { Invoice invoice = InvoiceDB.LoadAll(dt_invoices.Rows[i]); InvoiceLine[] invLines = (InvoiceLine[])invoiceLinesHash[invoice.InvoiceID]; bool showAreaTreated = invoice.PayerOrganisation != null && (invoice.PayerOrganisation.OrganisationID == -2 || invoice.PayerOrganisation.OrganisationType.OrganisationTypeID == 150); bool showServiceReference = invoice.PayerOrganisation != null && invoice.PayerOrganisation.OrganisationType.OrganisationTypeID == 150; string output = "<ul style=\"padding-left:14px;\">"; foreach (InvoiceLine invLine in invLines) { string extras = string.Empty; if (showAreaTreated || showServiceReference) { string linkAreaTreated = "<a title=\"Edit\" onclick=\"javascript:window.showModalDialog('Invoice_UpdateAreaTreatedV2.aspx?inv_line=" + invLine.InvoiceLineID + "', '', 'dialogWidth:600px;dialogHeight:275px;center:yes;resizable:no; scroll:no');window.location.href=window.location.href;return false;\" href=\"#\">Edit</a>"; string linkServiceReference = "<a title=\"Edit\" onclick=\"javascript:window.showModalDialog('Invoice_UpdateServiceReferenceV2.aspx?inv_line=" + invLine.InvoiceLineID + "', '', 'dialogWidth:600px;dialogHeight:275px;center:yes;resizable:no; scroll:no');window.location.href=window.location.href;return false;\" href=\"#\">Edit</a>"; extras += "<table>"; if (showAreaTreated) { extras += "<tr><td>Area Treated</td><td style=\"min-width:10px;\"></td><td>" + (invLine.AreaTreated.Length == 0 ? "[EMPTY]" : invLine.AreaTreated) + "</td><td style=\"min-width:10px;\"></td><td>" + linkAreaTreated + "</td></tr>"; } if (showServiceReference) { extras += "<tr><td>Service Reference</td><td style=\"min-width:10px;\"></td><td>" + (invLine.ServiceReference.Length == 0 ? "[EMPTY]" : invLine.ServiceReference) + "</td><td style=\"min-width:10px;\"></td><td>" + linkServiceReference + "</td></tr>"; } extras += "</table>"; } string itemDescr = string.Empty; if (invLine.Offering != null) { itemDescr = invLine.Offering.Name; } if (invLine.Credit != null) { itemDescr = "Voucher: <i>" + invLine.Credit.VoucherDescr + "</i>"; } output += "<li>" + itemDescr + " x " + ((invLine.Quantity % 1) == 0 ? Convert.ToInt32(invLine.Quantity) : invLine.Quantity) + " = " + invLine.Price + (invLine.Tax == 0 ? "" : " (<i>Inc GST</i>)") + (invLine.Patient.Person == null ? "" : " [" + invLine.Patient.Person.FullnameWithoutMiddlename + "]") + extras + "</li>"; } output += "</ul>"; dt_invoices.Rows[i]["inv_lines_text"] = output; if (countShowing == 0) { dt_invoices.Rows[i]["style_display"] = ""; } } //get approximate page width... // 194 = row titles // average row = 340 px (about 220-440) // add 70px for good measure int pageWidth = 194 + 365 * (countShowing == 0 ? 1 : countShowing) + 120; Page.ClientScript.RegisterStartupScript(this.GetType(), "resize_window", "<script language=javascript>window.resizeTo( (" + pageWidth + "+ window.outerWidth - window.innerWidth) < screen.width ? (" + pageWidth + " + window.outerWidth - window.innerWidth) : screen.width , window.outerHeight);</script>"); if (dt_invoices.Rows.Count <= 1) { divToggleShowReversedRejected.Visible = false; } else if (countShowing == 0) { chkShowReversed.Checked = true; chkShowRejected.Checked = true; } // now databind Repeater1.DataSource = dt_invoices; Repeater1.DataBind(); Repeater2.DataSource = dt_invoices; Repeater2.DataBind(); Repeater3.DataSource = dt_invoices; Repeater3.DataBind(); Repeater4.DataSource = dt_invoices; Repeater4.DataBind(); Repeater5.DataSource = dt_invoices; Repeater5.DataBind(); Repeater6.DataSource = dt_invoices; Repeater6.DataBind(); Repeater7.DataSource = dt_invoices; Repeater7.DataBind(); Repeater8.DataSource = dt_invoices; Repeater8.DataBind(); Repeater9.DataSource = dt_invoices; Repeater9.DataBind(); Repeater10.DataSource = dt_invoices; Repeater10.DataBind(); Repeater11.DataSource = dt_invoices; Repeater11.DataBind(); Repeater12.DataSource = dt_invoices; Repeater12.DataBind(); Repeater13.DataSource = dt_invoices; Repeater13.DataBind(); Repeater14.DataSource = dt_invoices; Repeater14.DataBind(); Repeater15.DataSource = dt_invoices; Repeater15.DataBind(); Repeater16.DataSource = dt_invoices; Repeater16.DataBind(); Repeater17.DataSource = dt_invoices; Repeater17.DataBind(); Repeater18.DataSource = dt_invoices; Repeater18.DataBind(); Repeater19.DataSource = dt_invoices; Repeater19.DataBind(); // non booking invoices (ie standard invoices) will not have a booking Booking booking = invoices[0].Booking; if (booking != null) { string patientText = string.Empty; if (booking != null && booking.Patient != null) { patientText = booking.Patient.Person.FullnameWithoutMiddlename; } else if (invoices[0].PayerPatient != null) { patientText = invoices[0].PayerPatient.Person.FullnameWithoutMiddlename; } else { patientText = "< No patient >"; } // show booking info lblBooking_Org.Text = booking.Organisation.Name; lblBooking_Provider.Text = booking.Provider.Person.FullnameWithoutMiddlename; lblBooking_Patient.Text = patientText; // booking.Patient.Person.FullnameWithoutMiddlename; lblBooking_Offering.Text = booking.Offering == null ? "< No service >" : booking.Offering.Name; lblBooking_BookingStatus.Text = booking.BookingStatus.Descr; lblBooking_Time.Text = booking.DateStart.Date.ToString("dd MMM yyyy") + " - " + booking.DateStart.ToString("h:mm") + (booking.DateStart.Hour < 12 ? "am" : "pm") + "-" + booking.DateEnd.ToString("h:mm") + (booking.DateEnd.Hour < 12 ? "am" : "pm"); lblBooking_PatientMissedAppt.Text = booking.IsPatientMissedAppt ? "Yes" : "No"; lblBooking_ProviderMissedAppt.Text = booking.IsProviderMissedAppt ? "Yes" : "No"; lblBooking_Emergency.Text = booking.IsEmergency ? "Yes" : "No"; lblBooking_Notes.Text = Note.GetPopupLinkTextV2(15, booking.EntityID, booking.NoteCount > 0, true, 1050, 530, "images/notes-bw-24.jpg", "images/notes-24.png"); } else { booking_space.Visible = false; booking_title.Visible = false; booking_offering.Visible = false; booking_patient.Visible = false; booking_provider.Visible = false; booking_org.Visible = false; booking_status.Visible = false; booking_apptmt_time.Visible = false; booking_patiemt_missed_apptmt.Visible = false; booking_provider_missed_apptmt.Visible = false; booking_isemergency.Visible = false; booking_notes.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var db = new oucITEntities(); if (Request.QueryString["type"] != "组织机构") { Response.Redirect("index.aspx"); } string item = "党委团委"; if (Request.QueryString["item"] != null) { item = Request.QueryString["item"]; } // 绑定组织结构列表 if (item == "党委团委") { // 显示党委团委对应Panel,下同 Panel1.Visible = true; Panel2.Visible = false; Panel3.Visible = false; // 绑定右侧列表,下同 var ITgroup = GroupHelper.Select("学院党委"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater1.DataSource = xydwlist.ToList(); Repeater1.DataBind(); } ITgroup = GroupHelper.Select("学院团委"); if (ITgroup != null) { var xytwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater2.DataSource = xytwlist.ToList(); Repeater2.DataBind(); } ITgroup = GroupHelper.Select("教工党支部"); if (ITgroup != null) { var jgdzblist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class, a.Job select a; Repeater3.DataSource = jgdzblist.ToList(); Repeater3.DataBind(); } ITgroup = GroupHelper.Select("学生党支部"); if (ITgroup != null) { var xsdzblist = from a in db.Connection where a.GroupID == ITgroup.GroupID select new { Job = a.Job }; Repeater4.DataSource = xsdzblist.ToList(); Repeater4.DataBind(); } } else if (item == "院行政") { Panel1.Visible = false; Panel2.Visible = true; Panel3.Visible = false; var ITgroup = GroupHelper.Select("院行政"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater5.DataSource = xydwlist.ToList(); Repeater5.DataBind(); } ITgroup = GroupHelper.Select("院办公室"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater6.DataSource = xydwlist.ToList(); Repeater6.DataBind(); } ITgroup = GroupHelper.Select("物理系"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater7.DataSource = xydwlist.ToList(); Repeater7.DataBind(); } ITgroup = GroupHelper.Select("电子工程系"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater8.DataSource = xydwlist.ToList(); Repeater8.DataBind(); } ITgroup = GroupHelper.Select("计算机科学与技术系"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater9.DataSource = xydwlist.ToList(); Repeater9.DataBind(); } ITgroup = GroupHelper.Select("海洋技术系"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater10.DataSource = xydwlist.ToList(); Repeater10.DataBind(); } ITgroup = GroupHelper.Select("信息工程中心"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater11.DataSource = xydwlist.ToList(); Repeater11.DataBind(); } } else if (item == "院工会妇委会") { Panel1.Visible = false; Panel2.Visible = false; Panel3.Visible = true; var ITgroup = GroupHelper.Select("院工会"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater12.DataSource = xydwlist.ToList(); Repeater12.DataBind(); } ITgroup = GroupHelper.Select("院妇女委员会"); if (ITgroup != null) { var xydwlist = from a in db.Connection where a.GroupID == ITgroup.GroupID orderby a.Class select a; Repeater13.DataSource = xydwlist.ToList(); Repeater13.DataBind(); } } else { Response.Redirect("index.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { List <Tin> ds = new List <Tin>(); TinBLL tbll = new TinBLL(); ds = tbll.LayMaLoaiTin2("LT04"); this.rpt.DataSource = ds; rpt.DataBind(); List <Tin> ds9 = new List <Tin>(); TinBLL tbll9 = new TinBLL(); ds9 = tbll9.LayMaLoaiTin2benphai("LT05"); this.Repeater9.DataSource = ds9; Repeater9.DataBind(); List <Tin> ds1 = new List <Tin>(); TinBLL tbll1 = new TinBLL(); ds1 = tbll.LayMaLoaiTin1("LT01"); this.Repeater1.DataSource = ds1; Repeater1.DataBind(); List <Tin> ds10 = new List <Tin>(); TinBLL tbll10 = new TinBLL(); ds10 = tbll10.LayMaLoaiTin1benphai("LT02"); this.Repeater10.DataSource = ds10; Repeater10.DataBind(); List <Tin> ds2 = new List <Tin>(); TinBLL tbll2 = new TinBLL(); ds2 = tbll.LayMaLoaiTin3("LT07"); this.Repeater2.DataSource = ds2; Repeater2.DataBind(); List <Tin> ds11 = new List <Tin>(); TinBLL tbll11 = new TinBLL(); ds11 = tbll11.LayMaLoaiTin3benphai("LT08"); this.Repeater11.DataSource = ds11; Repeater11.DataBind(); List <Tin> ds3 = new List <Tin>(); TinBLL tbll3 = new TinBLL(); ds3 = tbll.LayMaLoaiTin4("LT11"); this.Repeater3.DataSource = ds3; Repeater3.DataBind(); List <Tin> ds12 = new List <Tin>(); TinBLL tbll12 = new TinBLL(); ds12 = tbll12.LayMaLoaiTin4benphai("LT12"); this.Repeater12.DataSource = ds12; Repeater12.DataBind(); List <Tin> ds4 = new List <Tin>(); TinBLL tbll4 = new TinBLL(); ds4 = tbll.LayMaLoaiTin5("LT13"); this.Repeater4.DataSource = ds4; Repeater4.DataBind(); List <Tin> ds13 = new List <Tin>(); TinBLL tbll13 = new TinBLL(); ds13 = tbll13.LayMaLoaiTin5benphai("LT13"); this.Repeater13.DataSource = ds13; Repeater13.DataBind(); List <Tin> ds5 = new List <Tin>(); TinBLL tbll5 = new TinBLL(); ds5 = tbll.LayMaLoaiTin6("LT14"); this.Repeater5.DataSource = ds5; Repeater5.DataBind(); List <Tin> ds14 = new List <Tin>(); TinBLL tbll14 = new TinBLL(); ds14 = tbll13.LayMaLoaiTin6benphai("LT15"); this.Repeater14.DataSource = ds14; Repeater14.DataBind(); List <Tin> ds6 = new List <Tin>(); TinBLL tbll6 = new TinBLL(); ds6 = tbll.LayMaLoaiTin7("LT17"); this.Repeater6.DataSource = ds6; Repeater6.DataBind(); List <Tin> ds15 = new List <Tin>(); TinBLL tbll15 = new TinBLL(); ds15 = tbll15.LayMaLoaiTin7benphai("LT17"); this.Repeater15.DataSource = ds15; Repeater15.DataBind(); List <Tin> ds7 = new List <Tin>(); TinBLL tbll7 = new TinBLL(); ds7 = tbll.LayMaLoaiTin8("LT18"); this.Repeater7.DataSource = ds7; Repeater7.DataBind(); List <Tin> ds16 = new List <Tin>(); TinBLL tbll16 = new TinBLL(); ds16 = tbll16.LayMaLoaiTin8benphai("LT19"); this.Repeater16.DataSource = ds16; Repeater16.DataBind(); List <Tin> ds8 = new List <Tin>(); TinBLL tbll8 = new TinBLL(); ds8 = tbll.LayMaLoaiTin9("LT20"); this.Repeater8.DataSource = ds8; Repeater8.DataBind(); List <Tin> ds17 = new List <Tin>(); TinBLL tbll17 = new TinBLL(); ds17 = tbll17.LayMaLoaiTin9benphai("LT21"); this.Repeater17.DataSource = ds17; Repeater17.DataBind(); }
protected void Button2_click(object sender, EventArgs e) { DateTime d1 = new DateTime(); // d1 = Convert.ToDateTime(TextBox1.Text); if (!DateTime.TryParseExact(TextBox1.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1)) { } Label2.Text = d1.ToString("dd/MM/yyyy"); TransitionLogic ol = new TransitionLogic(); DataTable dt1 = ol.SelectOrderStatus("Order Created", d1); DataTable dt2 = ol.SelectOrderStatus("Performa invoice generated", d1); DataTable dt3 = ol.SelectOrderStatus("Performa invoice approved", d1); DataTable dt4 = ol.SelectOrderStatus("Cylinder requested", d1); DataTable dt5 = ol.SelectOrderStatus("Cylinder received", d1); DataTable dt6 = ol.SelectOrderStatus("Print pending", d1); DataTable dt7 = ol.SelectOrderStatus("Converting", d1); DataTable dt8 = ol.SelectOrderStatus("Ready", d1); DataTable dt9 = ol.SelectOrderStatus("Dispached", d1); DataTable dt10 = ol.SelectOrderStatus("Closed", d1); int max = findMax(dt1.Rows.Count, dt2.Rows.Count, dt3.Rows.Count, dt4.Rows.Count, dt5.Rows.Count, dt6.Rows.Count, dt7.Rows.Count, dt8.Rows.Count, dt9.Rows.Count, dt10.Rows.Count); if (dt1.Rows.Count < max) { for (int i = dt1.Rows.Count; i < max; i++) { dt1.Rows.Add("-"); } } if (dt2.Rows.Count < max) { for (int i = dt2.Rows.Count; i < max; i++) { dt2.Rows.Add("-"); } } if (dt3.Rows.Count < max) { for (int i = dt3.Rows.Count; i < max; i++) { dt3.Rows.Add("-"); } } if (dt4.Rows.Count < max) { for (int i = dt4.Rows.Count; i < max; i++) { dt4.Rows.Add("-"); } } if (dt5.Rows.Count < max) { for (int i = dt5.Rows.Count; i < max; i++) { dt5.Rows.Add("-"); } } if (dt6.Rows.Count < max) { for (int i = dt6.Rows.Count; i < max; i++) { dt6.Rows.Add("-"); } } if (dt7.Rows.Count < max) { for (int i = dt7.Rows.Count; i < max; i++) { dt7.Rows.Add("-"); } } if (dt8.Rows.Count < max) { for (int i = dt8.Rows.Count; i < max; i++) { dt8.Rows.Add("-"); } } if (dt9.Rows.Count < max) { for (int i = dt9.Rows.Count; i < max; i++) { dt9.Rows.Add("-"); } } if (dt10.Rows.Count < max) { for (int i = dt10.Rows.Count; i < max; i++) { dt10.Rows.Add("-"); } } Repeater1.DataSource = dt1; Repeater2.DataSource = dt2; Repeater3.DataSource = dt3; Repeater4.DataSource = dt4; Repeater5.DataSource = dt5; Repeater6.DataSource = dt6; Repeater7.DataSource = dt7; Repeater8.DataSource = dt8; Repeater9.DataSource = dt9; Repeater10.DataSource = dt10; Repeater1.DataBind(); Repeater2.DataBind(); Repeater3.DataBind(); Repeater4.DataBind(); Repeater5.DataBind(); Repeater6.DataBind(); Repeater7.DataBind(); Repeater8.DataBind(); Repeater9.DataBind(); Repeater10.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Label2.Text = DateTime.Today.ToString("dd/MM/yyyy"); TransitionLogic ol = new TransitionLogic(); DataTable dt1 = ol.SelectOrderStatus("Order Created", DateTime.Today); DataTable dt2 = ol.SelectOrderStatus("Performa invoice generated", DateTime.Today); DataTable dt3 = ol.SelectOrderStatus("Performa invoice approved", DateTime.Today); DataTable dt4 = ol.SelectOrderStatus("Cylinder requested", DateTime.Today); DataTable dt5 = ol.SelectOrderStatus("Cylinder received", DateTime.Today); DataTable dt6 = ol.SelectOrderStatus("Print pending", DateTime.Today); DataTable dt7 = ol.SelectOrderStatus("Converting", DateTime.Today); DataTable dt8 = ol.SelectOrderStatus("Ready", DateTime.Today); DataTable dt9 = ol.SelectOrderStatus("Dispached", DateTime.Today); DataTable dt10 = ol.SelectOrderStatusClosed("Closed", DateTime.Today); int max = findMax(dt1.Rows.Count, dt2.Rows.Count, dt3.Rows.Count, dt4.Rows.Count, dt5.Rows.Count, dt6.Rows.Count, dt7.Rows.Count, dt8.Rows.Count, dt9.Rows.Count, dt10.Rows.Count); if (dt1.Rows.Count < max) { for (int i = dt1.Rows.Count; i < max; i++) { dt1.Rows.Add("-"); } } if (dt2.Rows.Count < max) { for (int i = dt2.Rows.Count; i < max; i++) { dt2.Rows.Add("-"); } } if (dt3.Rows.Count < max) { for (int i = dt3.Rows.Count; i < max; i++) { dt3.Rows.Add("-"); } } if (dt4.Rows.Count < max) { for (int i = dt4.Rows.Count; i < max; i++) { dt4.Rows.Add("-"); } } if (dt5.Rows.Count < max) { for (int i = dt5.Rows.Count; i < max; i++) { dt5.Rows.Add("-"); } } if (dt6.Rows.Count < max) { for (int i = dt6.Rows.Count; i < max; i++) { dt6.Rows.Add("-"); } } if (dt7.Rows.Count < max) { for (int i = dt7.Rows.Count; i < max; i++) { dt7.Rows.Add("-"); } } if (dt8.Rows.Count < max) { for (int i = dt8.Rows.Count; i < max; i++) { dt8.Rows.Add("-"); } } if (dt9.Rows.Count < max) { for (int i = dt9.Rows.Count; i < max; i++) { dt9.Rows.Add("-"); } } if (dt10.Rows.Count < max) { for (int i = dt10.Rows.Count; i < max; i++) { dt10.Rows.Add("-"); } } Repeater1.DataSource = dt1; Repeater2.DataSource = dt2; Repeater3.DataSource = dt3; Repeater4.DataSource = dt4; Repeater5.DataSource = dt5; Repeater6.DataSource = dt6; Repeater7.DataSource = dt7; Repeater8.DataSource = dt8; Repeater9.DataSource = dt9; Repeater10.DataSource = dt10; Repeater1.DataBind(); Repeater2.DataBind(); Repeater3.DataBind(); Repeater4.DataBind(); Repeater5.DataBind(); Repeater6.DataBind(); Repeater7.DataBind(); Repeater8.DataBind(); Repeater9.DataBind(); Repeater10.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string major = "physics"; if (Request.QueryString["type"] != "师资队伍") { Response.Redirect("index.aspx"); } if (Request.QueryString["item"] != null) { major = Request.QueryString["item"]; } panel1.Visible = true; panel2.Visible = false; panel3.Visible = false; panel4.Visible = false; //panel5.Visible = false; if (major == "physics") { lblMajor.Text = "物理系"; lblEnglishMajor.Text = "physics"; var db = new oucITEntities(); // 绑定教授 var list = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 1 orderby a.Birthday select a).ToList(); Repeater1.DataSource = list; Repeater1.DataBind(); if (list.Count == 0) { Panel6.Visible = false; } // 绑定博士生导师 var list2 = (from a in db.Teacher where a.Department == "物理系" && a.Tutor == 1 orderby a.Job, a.Birthday select a).ToList(); Repeater3.DataSource = list2; Repeater3.DataBind(); if (list2.Count == 0) { Panel7.Visible = false; } // 绑定硕士生导师 var list3 = (from a in db.Teacher where a.Department == "物理系" && (a.Tutor == 1 || a.Tutor == 2) orderby a.Job, a.Tutor, a.Birthday select a).ToList(); Repeater4.DataSource = list3; Repeater4.DataBind(); // 绑定信息工程中心 var list4 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 2 orderby a.Birthday select a).ToList(); Repeater2.DataSource = list4; Repeater2.DataBind(); // 绑定高级工程师 var list5 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 3 orderby a.Birthday select a).ToList(); Repeater5.DataSource = list5; Repeater5.DataBind(); if (list5.Count == 0) { Panel5.Visible = false; } // 绑定高级实验师 var list6 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 4 orderby a.Birthday select a).ToList(); Repeater6.DataSource = list6; Repeater6.DataBind(); if (list6.Count == 0) { Panel8.Visible = false; } // 绑定讲师 var list7 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 5 orderby a.Birthday select a).ToList(); Repeater7.DataSource = list7; Repeater7.DataBind(); if (list7.Count == 0) { Panel9.Visible = false; } // 绑定助理工程师 var list8 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 6 orderby a.Birthday select a).ToList(); Repeater8.DataSource = list8; Repeater8.DataBind(); if (list8.Count == 0) { Panel10.Visible = false; } // 绑定助理实验师 var list9 = (from a in db.Teacher where a.Department == "物理系" && a.JobTitle == 7 orderby a.Birthday select a).ToList(); Repeater9.DataSource = list9; Repeater9.DataBind(); if (list9.Count == 0) { Panel11.Visible = false; } } else if (major == "electron") { panel1.Visible = true; panel4.Visible = false; lblMajor.Text = "电子工程系"; lblEnglishMajor.Text = "electronic engineering"; var db = new oucITEntities(); var list = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 1 orderby a.Birthday select a).ToList(); Repeater1.DataSource = list; Repeater1.DataBind(); if (list.Count == 0) { Panel6.Visible = false; } var list2 = (from a in db.Teacher where a.Department == "电子工程系" && a.Tutor == 1 orderby a.Job, a.Birthday select a).ToList(); Repeater3.DataSource = list2; Repeater3.DataBind(); if (list2.Count == 0) { Panel7.Visible = false; } var list3 = (from a in db.Teacher where a.Department == "电子工程系" && (a.Tutor == 1 || a.Tutor == 2) orderby a.Job, a.Tutor, a.Birthday select a).ToList(); Repeater4.DataSource = list3; Repeater4.DataBind(); var list4 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 2 orderby a.UserID select a).ToList(); Repeater2.DataSource = list4; Repeater2.DataBind(); var list5 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 3 orderby a.Birthday select a).ToList(); Repeater5.DataSource = list5; Repeater5.DataBind(); if (list5.Count == 0) { Panel5.Visible = false; } var list6 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 4 orderby a.Birthday select a).ToList(); Repeater6.DataSource = list6; Repeater6.DataBind(); if (list6.Count == 0) { Panel8.Visible = false; } var list7 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 5 orderby a.Birthday select a).ToList(); Repeater7.DataSource = list7; Repeater7.DataBind(); if (list7.Count == 0) { Panel9.Visible = false; } var list8 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 6 orderby a.Birthday select a).ToList(); Repeater8.DataSource = list8; Repeater8.DataBind(); if (list8.Count == 0) { Panel10.Visible = false; } var list9 = (from a in db.Teacher where a.Department == "电子工程系" && a.JobTitle == 7 orderby a.Birthday select a).ToList(); Repeater9.DataSource = list9; Repeater9.DataBind(); if (list9.Count == 0) { Panel11.Visible = false; } } else if (major == "computer") { lblMajor.Text = "计算机科学与技术系"; lblEnglishMajor.Text = "computer science and technology"; var db = new oucITEntities(); var list = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 1 orderby a.Birthday select a).ToList(); Repeater1.DataSource = list; Repeater1.DataBind(); if (list.Count == 0) { Panel6.Visible = false; } var list2 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.Tutor == 1 orderby a.Job, a.Birthday select a).ToList(); Repeater3.DataSource = list2; Repeater3.DataBind(); if (list2.Count == 0) { Panel7.Visible = false; } var list3 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && (a.Tutor == 1 || a.Tutor == 2) orderby a.Job, a.Tutor, a.Birthday select a).ToList(); Repeater4.DataSource = list3; Repeater4.DataBind(); var list4 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 2 orderby a.UserID select a).ToList(); Repeater2.DataSource = list4; Repeater2.DataBind(); var list5 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 3 orderby a.Birthday select a).ToList(); Repeater5.DataSource = list5; Repeater5.DataBind(); if (list5.Count == 0) { Panel5.Visible = false; } var list6 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 4 orderby a.Birthday select a).ToList(); Repeater6.DataSource = list6; Repeater6.DataBind(); if (list6.Count == 0) { Panel8.Visible = false; } var list7 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 5 orderby a.Birthday select a).ToList(); Repeater7.DataSource = list7; Repeater7.DataBind(); if (list7.Count == 0) { Panel9.Visible = false; } var list8 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 6 orderby a.Birthday select a).ToList(); Repeater8.DataSource = list8; Repeater8.DataBind(); if (list8.Count == 0) { Panel10.Visible = false; } var list9 = (from a in db.Teacher where a.Department == "计算机科学与技术系" && a.JobTitle == 7 orderby a.Birthday select a).ToList(); Repeater9.DataSource = list9; Repeater9.DataBind(); if (list9.Count == 0) { Panel11.Visible = false; } } else if (major == "ocean") { lblMajor.Text = "海洋技术系"; lblEnglishMajor.Text = "marine technology"; var db = new oucITEntities(); var list = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 1 orderby a.Birthday select a).ToList(); Repeater1.DataSource = list; Repeater1.DataBind(); if (list.Count == 0) { Panel6.Visible = false; } var list2 = (from a in db.Teacher where a.Department == "海洋技术系" && a.Tutor == 1 orderby a.Job, a.Birthday select a).ToList(); Repeater3.DataSource = list2; Repeater3.DataBind(); if (list2.Count == 0) { Panel7.Visible = false; } var list3 = (from a in db.Teacher where a.Department == "海洋技术系" && (a.Tutor == 1 || a.Tutor == 2) orderby a.Job, a.Tutor, a.Birthday select a).ToList(); Repeater4.DataSource = list3; Repeater4.DataBind(); var list4 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 2 orderby a.UserID select a).ToList(); Repeater2.DataSource = list4; Repeater2.DataBind(); var list5 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 3 orderby a.Birthday select a).ToList(); Repeater5.DataSource = list5; Repeater5.DataBind(); if (list5.Count == 0) { Panel5.Visible = false; } var list6 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 4 orderby a.Birthday select a).ToList(); Repeater6.DataSource = list6; Repeater6.DataBind(); if (list6.Count == 0) { Panel8.Visible = false; } var list7 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 5 orderby a.Birthday select a).ToList(); Repeater7.DataSource = list7; Repeater7.DataBind(); if (list7.Count == 0) { Panel9.Visible = false; } var list8 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 6 orderby a.Birthday select a).ToList(); Repeater8.DataSource = list8; Repeater8.DataBind(); if (list8.Count == 0) { Panel10.Visible = false; } var list9 = (from a in db.Teacher where a.Department == "海洋技术系" && a.JobTitle == 7 orderby a.Birthday select a).ToList(); Repeater9.DataSource = list9; Repeater9.DataBind(); if (list9.Count == 0) { Panel11.Visible = false; } } //else if (major == "it") //{ // lblMajor.Text = "行政人员"; // lblEnglishMajor.Text = "administrative staff"; // var db = new oucITEntities(); // var list10 = (from a in db.Teacher // where a.Department == "行政人员" // orderby a.JobTitle, a.UserID // select a).ToList(); // Repeater10.DataSource = list10; // Repeater10.DataBind(); // panel1.Visible = false; // panel4.Visible = true; // panelChoose.Visible = false; //} else if (major == "it") { lblMajor.Text = "信息工程中心"; lblEnglishMajor.Text = "information engineering center"; var db = new oucITEntities(); var list10 = (from a in db.Teacher where a.Department == "信息工程中心" orderby a.JobTitle, a.UserID select a).ToList(); Repeater10.DataSource = list10; Repeater10.DataBind(); panel1.Visible = false; panel4.Visible = true; panelChoose.Visible = false; } else { Response.Redirect("Index.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["DoctorGUID"] == null) { Util.ShowMessage("用户登录超时,请重新登录!", "Login.aspx"); Response.End(); } else { if (Request.QueryString["GUID"] != null) { using (SqlConnection conn = new DB().GetConnection()) { GUIDS = Request.QueryString["GUID"].ToString(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "select * from Patient where GUID=@GUID"; cmd.Parameters.AddWithValue("@GUID", Request.QueryString["GUID"].ToString()); conn.Open(); SqlDataReader rd = cmd.ExecuteReader(); if (rd.Read()) { Patient.Text = rd["PatientName"].ToString(); GUID.Text = rd["GUID"].ToString(); Sex.Text = rd["Sex"].ToString(); Birthday.Text = String.Format("{0:yyyy-MM-dd}", rd["Birthday"]); Num1.Text = rd["Num1"].ToString(); Phone1.Text = rd["Phone1"].ToString(); } rd.Close(); DoctorGUID.Text = Session["DoctorGUID"].ToString(); cmd.CommandText = "select * from Doctor where GUID=@DoctorGUID"; cmd.Parameters.AddWithValue("@DoctorGUID", DoctorGUID.Text); rd = cmd.ExecuteReader(); if (rd.Read()) { DoctorName.Text = rd["DoctorName"].ToString(); } rd.Close(); // T1 cmd.CommandText = "select GUID,EndDT from T1 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater1.DataSource = rd; Repeater1.DataBind(); rd.Close(); // T2 cmd.CommandText = "select GUID,EndDT from T2 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater2.DataSource = rd; Repeater2.DataBind(); rd.Close(); // T3 cmd.CommandText = "select GUID,EndDT from T3 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater3.DataSource = rd; Repeater3.DataBind(); rd.Close(); // T4 cmd.CommandText = "select GUID,EndDT from T4 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater4.DataSource = rd; Repeater4.DataBind(); rd.Close(); // T5 cmd.CommandText = "select GUID,EndDT from T5 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater5.DataSource = rd; Repeater5.DataBind(); rd.Close(); // T6 cmd.CommandText = "select GUID,EndDT from T6 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater6.DataSource = rd; Repeater6.DataBind(); rd.Close(); // T7 cmd.CommandText = "select GUID,EndDT from T7 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater7.DataSource = rd; Repeater7.DataBind(); rd.Close(); //T8 cmd.CommandText = "select GUID,EndDT from T8 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater8.DataSource = rd; Repeater8.DataBind(); rd.Close(); // T9 cmd.CommandText = "select GUID,EndDT from T9 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater9.DataSource = rd; Repeater9.DataBind(); rd.Close(); // T10 cmd.CommandText = "select GUID,EndDT from T10 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater10.DataSource = rd; Repeater10.DataBind(); rd.Close(); // T11 cmd.CommandText = "select GUID,EndDT from T11 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater11.DataSource = rd; Repeater11.DataBind(); rd.Close(); // T12 cmd.CommandText = "select GUID,EndDT from T12 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater12.DataSource = rd; Repeater12.DataBind(); rd.Close(); // T13 cmd.CommandText = "select GUID,EndDT from T13 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater13.DataSource = rd; Repeater13.DataBind(); rd.Close(); // T14 cmd.CommandText = "select GUID,EndDT from T14 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater14.DataSource = rd; Repeater14.DataBind(); rd.Close(); // T15 cmd.CommandText = "select GUID,EndDT from T15 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater15.DataSource = rd; Repeater15.DataBind(); rd.Close(); // T16 cmd.CommandText = "select GUID,EndDT from T16 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater16.DataSource = rd; Repeater16.DataBind(); rd.Close(); // T17 cmd.CommandText = "select GUID,EndDT from T17 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater17.DataSource = rd; Repeater17.DataBind(); rd.Close(); // T18 cmd.CommandText = "select GUID,EndDT from T18 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater18.DataSource = rd; Repeater18.DataBind(); rd.Close(); // T19 cmd.CommandText = "select GUID,EndDT from T19 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater19.DataSource = rd; Repeater19.DataBind(); rd.Close(); // T20 cmd.CommandText = "select GUID,EndDT from T20 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater20.DataSource = rd; Repeater20.DataBind(); rd.Close(); // T21 cmd.CommandText = "select GUID,EndDT from T21 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater21.DataSource = rd; Repeater21.DataBind(); rd.Close(); // T22 cmd.CommandText = "select GUID,EndDT from T22 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater22.DataSource = rd; Repeater22.DataBind(); rd.Close(); // T23 cmd.CommandText = "select GUID,EndDT from T23 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater23.DataSource = rd; Repeater23.DataBind(); rd.Close(); // T24 cmd.CommandText = "select GUID,EndDT from T24 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater24.DataSource = rd; Repeater24.DataBind(); rd.Close(); // T25 cmd.CommandText = "select GUID,EndDT from T25 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater25.DataSource = rd; Repeater25.DataBind(); rd.Close(); // T26 cmd.CommandText = "select GUID,EndDT from T26 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater26.DataSource = rd; Repeater26.DataBind(); rd.Close(); // T27 cmd.CommandText = "select GUID,EndDT from T27 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater27.DataSource = rd; Repeater27.DataBind(); rd.Close(); // T28 cmd.CommandText = "select GUID,EndDT from T28 where PatientGUID=@GUID Order by EndDT Desc"; rd = cmd.ExecuteReader(); Repeater28.DataSource = rd; Repeater28.DataBind(); rd.Close(); conn.Close(); } } else { Response.Write(" <script> alert(\"请先选择测试对象,再选择其完成的测试进行打印!\");;window.location='Patient_List.aspx'; </script> "); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand komenda = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '1' and '6'", polaczenie); SqlCommand komendaDruga = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '7' and '12'", polaczenie); SqlCommand komendaTrzecia = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '13' and '16'", polaczenie); SqlCommand komendaCzwarta = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '17' and '20'", polaczenie); SqlCommand komendaPiata = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '21' and '23'", polaczenie); SqlCommand komendaSzosta = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '24' and '26'", polaczenie); SqlCommand komendaSiodma = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '27' and '30'", polaczenie); SqlCommand komendaOsma = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '31' and '34'", polaczenie); SqlCommand komendaDziewiata = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '35' and '38'", polaczenie); SqlCommand komendaDziesiata = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '39' and '42'", polaczenie); SqlCommand komendaJedenasta = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '43' and '47'", polaczenie); SqlCommand komendaDwunasta = new SqlCommand(" SELECT g.IDgodziny,g.godzinyPoranne,g.godzinyWieczorne,t.TypPołączenia,m.miasto FROM GodzinyRozkladowLotow g INNER JOIN TypyPołączenia t on g.IDTypyPołączenia=t.IDTypyPołączenia INNER JOIN MIASTA m on g.IDmiasta=m.IDmiasta WHERE IDgodziny between '48' and '52'", polaczenie); SqlCommand komendaTrzynasta = new SqlCommand(" SELECT IDMiasWyl, MiasWyl FROM MiasWylo ", polaczenie); // SqlCommand komendaCzternasta = new SqlCommand("SELECT IDMiasPrz, MiasPrz FROM MiasPrzy", polaczenie); try { polaczenie.Open(); odczytaj = komenda.ExecuteReader(); Repeater1.DataSource = odczytaj; Repeater1.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaDruga.ExecuteReader(); Repeater2.DataSource = odczytaj; Repeater2.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaTrzecia.ExecuteReader(); Repeater3.DataSource = odczytaj; Repeater3.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaCzwarta.ExecuteReader(); Repeater4.DataSource = odczytaj; Repeater4.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaPiata.ExecuteReader(); Repeater5.DataSource = odczytaj; Repeater5.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaSzosta.ExecuteReader(); Repeater6.DataSource = odczytaj; Repeater6.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaSiodma.ExecuteReader(); Repeater7.DataSource = odczytaj; Repeater7.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaOsma.ExecuteReader(); Repeater8.DataSource = odczytaj; Repeater8.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaDziewiata.ExecuteReader(); Repeater9.DataSource = odczytaj; Repeater9.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaDziesiata.ExecuteReader(); Repeater10.DataSource = odczytaj; Repeater10.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaJedenasta.ExecuteReader(); Repeater11.DataSource = odczytaj; Repeater11.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaDwunasta.ExecuteReader(); Repeater12.DataSource = odczytaj; Repeater12.DataBind(); odczytaj.Close(); polaczenie.Close(); polaczenie.Open(); odczytaj = komendaTrzynasta.ExecuteReader(); MW.DataValueField = "IDMiasWyl"; MW.DataTextField = "MiasWyl"; MW.DataSource = odczytaj; MW.DataBind(); odczytaj.Close(); polaczenie.Close(); /* * polaczenie.Open(); * odczytaj = komendaCzternasta.ExecuteReader(); * MP.DataValueField = "IDMiasPrz"; * MP.DataTextField = "MiasPrz"; * MP.DataSource = odczytaj; * MP.DataBind(); * odczytaj.Close(); * polaczenie.Close(); */ } catch { Response.Write("Błąd pobierania danych"); } finally { polaczenie.Close(); } } }