protected void GridviewOsnoviNaBaranje_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteWS") { this.PanelNewUser.CssClass = "content-box column-left"; this.PanelEditUser.CssClass = "content-box column-right closed-box"; long num = Convert.ToInt64(((WebControl)e.CommandSource).Attributes["1"]); List <BASIS> list = (List <BASIS>) this.Session["ListOsnoviAll"]; foreach (BASIS basis in list) { if (basis.ID == num) { list.Remove(basis); break; } } this.Session["ListOsnoviSelected"] = (object)list; } else { if (!(e.CommandName == "InsertWS")) { return; } this.PanelNewUser.CssClass = "content-box column-left"; this.PanelEditUser.CssClass = "content-box column-right closed-box"; BASIS byId = new BasisDAL().GetByID(Convert.ToInt64(((WebControl)e.CommandSource).Attributes["1"])); List <BASIS> list = (List <BASIS>) this.Session["ListOsnoviSelected"]; list.Add(byId); this.Session["ListOsnoviSelected"] = (object)list; } }
protected void LinkButton5_Click(object sender, EventArgs e) { List <BASIS> allByStatus = new BasisDAL().GetAllByStatus(false); this.WSBasisGridView.DataSource = (object)allByStatus; this.WSBasisGridView.DataBind(); this.Application["ListBasis"] = (object)allByStatus; this.ClearStyleSubmeni(); }
protected void LinkButton1_Click1(object sender, EventArgs e) { List <BASIS> allByStatus = new BasisDAL().GetAllByStatus(true); this.WSBasisGridView.DataSource = (object)allByStatus; this.WSBasisGridView.DataBind(); this.Application["ListBasis"] = (object)allByStatus; this.WSBasisGridView.SelectedRowStyle.Reset(); this.WSBasisGridView.AlternatingRowStyle.CssClass = "AltRowStyle"; this.WSBasisGridView.RowStyle.CssClass = "RowStyle"; this.PanelEditUser.CssClass = "content-box column-left closed-box"; this.ClearTxtBoxChange(); }
protected void GridviewOsnoviNaBaranje_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteWS") { long num = Convert.ToInt64(((WebControl)e.CommandSource).Attributes["1"]); List <BASIS> list1 = (List <BASIS>) this.Session["ListOsnoviSelected"]; List <BASIS> list2 = (List <BASIS>) this.Session["ListOsnoviSelected"]; List <BASIS> list3 = new List <BASIS>(); foreach (BASIS basis in list1) { if (basis.ID == num) { list1.Remove(basis); using (List <WEBSERVICESBASIS> .Enumerator enumerator = new WSBasisDAL().GetActiveByInstitutionWebServiceAndBasis(Convert.ToInt64(this.DropDonwListInstitution.SelectedValue), Convert.ToInt64(this.DropDownListServis.SelectedValue), basis.ID).GetEnumerator()) { while (enumerator.MoveNext()) { WEBSERVICESBASIS current = enumerator.Current; new WSBasisDAL().Update(new long?(), new long?(), new DateTime?(), new bool?(false), current.ID); string old = ""; string newone = ""; new LOGDAL().Insert(Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICESBASIS")).Key, (USER)this.Session["user"], current.ID.ToString(), 2, DateTime.Now, old, newone); } break; } } } this.Session["ListOsnoviSelected"] = (object)list1; this.GridviewOsnoviNaBaranje.DataBind(); } else { if (!(e.CommandName == "InsertWS")) { return; } BASIS byId = new BasisDAL().GetByID(Convert.ToInt64(((WebControl)e.CommandSource).Attributes["1"])); List <BASIS> list = (List <BASIS>) this.Session["ListOsnoviSelected"]; list.Add(byId); foreach (PERMISSION permission in new PermissionsDAL().GetPermisionsByInstitutionandWebService(Convert.ToInt64(this.DropDonwListInstitution.SelectedValue), Convert.ToInt64(this.DropDownListServis.SelectedValue))) { long num = new WSBasisDAL().Insert(byId.ID, permission.ID, DateTime.Now, true); string old = ""; string newone = ""; new LOGDAL().Insert(Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(d => d.Value == "WEBSERVICESBASIS")).Key, (USER)this.Session["user"], num.ToString(), 2, DateTime.Now, old, newone); } this.Session["ListOsnoviSelected"] = (object)list; this.GridviewOsnoviNaBaranje.DataBind(); } }
protected void btn_vnesi_Click(object sender, EventArgs e) { long num = new BasisDAL().Insert(this.txtName.Text, this.CheckBoxTrue.Checked, DateTime.Now); string old = this.txtName.Text + ";" + true.ToString(); string newone = ""; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "BASIS")).Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone); this.ClearTxtBox(); this.Application["ListBasis"] = (object)new BasisDAL().GetAllByStatus(true); this.WSBasisGridView.DataSource = (object)(List <BASIS>) this.Application["ListBasis"]; this.WSBasisGridView.DataBind(); this.PanelEditUser.CssClass = "content-box column-right closed-box"; this.PanelNewUser.CssClass = "content-box column-left closed-box"; this.CheckBoxTrue.Checked = true; }
protected void DropDownListServis_SelectedIndexChanged(object sender, EventArgs e) { List <BASIS> allByStatus = new BasisDAL().GetAllByStatus(true); this.Session["ListOsnoviAll"] = (object)allByStatus; List <BASIS> institutionAndWebService = new BasisDAL().GetActiveByInstitutionAndWebService(Convert.ToInt64(this.DropDonwListInstitution.SelectedValue), Convert.ToInt64(this.DropDownListServis.SelectedValue)); if (institutionAndWebService != null) { this.Session["ListOsnoviSelected"] = (object)institutionAndWebService; } else { this.Session["ListOsnoviSelected"] = (object)new List <BASIS>(); } this.GridviewOsnoviNaBaranje.DataSource = (object)allByStatus; this.GridviewOsnoviNaBaranje.DataBind(); }
protected void TextBox1_TextChanged(object sender, EventArgs e) { List <BASIS> allByStatus = new BasisDAL().GetAllByStatus(true); List <BASIS> list = new List <BASIS>(); IEnumerable <BASIS> source = Enumerable.Where <BASIS>((IEnumerable <BASIS>)allByStatus, (Func <BASIS, bool>)(p => p.Tittle.ToUpper().Contains(this.TextBox1.Text.ToUpper()))); if (Enumerable.Count <BASIS>(source) != 0) { list.Clear(); foreach (BASIS basis in source) { list.Add(basis); } } if (list.Count == 0) { list.AddRange((IEnumerable <BASIS>)allByStatus); } this.Application["ListBasis"] = (object)list; this.WSBasisGridView.DataSource = (object)list; this.WSBasisGridView.DataBind(); }