protected void Page_Load(object sender, EventArgs e) { presenter = new AssignedItemsPresenter(this, new WebSessionProvider()); if (!IsPostBack) { Session["PreviousPageUrl"] = null; Session.Remove("DocCaseFilter"); presenter.Initialize(); } //LoadDocCaseList(); }
//private void LoadDocCaseList() //{ // XmlDataSource xds = new XmlDataSource(); // ActionDAO ad = new ActionDAO(); // using (XmlReader xdr = ad.GetDocCaseFullList()) // { // if (xdr.Read()) // xds.Data = xdr.ReadOuterXml(); // else // xds.Data = string.Empty; // xds.EnableCaching = false; // gvCaseDocList.DataSource = null; // if (xds.Data != "") // { // xds.XPath = "/zadania/zadanie"; // if (Session["DocCaseFilter"] != null) // xds.XPath += Session["DocCaseFilter"].ToString(); // gvCaseDocList.DataSource = xds; // } // } // gvCaseDocList.DataBind(); //} protected void filtruj(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); if (!ckbDokumenty.Checked) { sb.Append("[typ!='Dokument'"); sb2.Append("typ <> 'Dokument'"); } if (!ckbSprawy.Checked) { if (sb.Length > 0 && sb2.Length > 0) { sb.Append(" and "); sb2.Append(" AND "); } else { sb.Append("["); } sb.Append("typ!='Sprawa'"); sb2.Append(" typ <> 'Sprawa'"); } if (sb.Length > 0) { sb.Append("]"); } Session["DocCaseFilter"] = sb2.ToString(); ////////////////////////////////////////////////////// //if (!ckbWszystkie.Checked) //{ // sb.Append(string.Format("[doPracownika='{0}'", ckbMoje.Checked ? "1" : "0")); // sb2.Append(string.Format("doPracownika={0}", ckbMoje.Checked ? "1" : "0")); //} //else //{ // sb.Append(string.Format("[(doPracownika='0' or doPracownika='1')")); // sb2.Append(string.Format("(doPracownika=1 OR doPracownika=0)")); //} //if (!ckbDokumenty.Checked) //{ // sb.Append(" and typ!='Dokument'"); // sb2.Append(" AND typ <> 'Dokument' "); //} //if (!ckbSprawy.Checked) //{ // sb.Append(" and typ!='Sprawa'"); // sb2.Append(" and typ <> 'Sprawa'"); //} //if (ddlTypInteresanta.SelectedValue != "-1") //{ // sb2.Append(" and idTypuInteresanta=" + ddlTypInteresanta.SelectedValue); //} //sb.Append("]"); //Session["taskFilter"] = sb.ToString(); //Session["taskFilter2"] = sb2.ToString(); //presenter.Initialize(); ////////////////////////////////////////////////////// //LoadDocCaseList(); presenter.Initialize(); }