protected void TextBox1_TextChanged(object sender, EventArgs e) { List <HelpClassWebServices> institutionsPermissions = new WebservicesDAL().GetWebServicesInstitutionsPermissions(true); List <HelpClassWebServices> list = new List <HelpClassWebServices>(); IEnumerable <HelpClassWebServices> source = Enumerable.Where <HelpClassWebServices>((IEnumerable <HelpClassWebServices>)institutionsPermissions, (Func <HelpClassWebServices, bool>)(p => p.Tittle.ToUpper().Contains(this.TextBox1.Text.ToUpper()))); if (Enumerable.Count <HelpClassWebServices>(source) != 0) { list.Clear(); foreach (HelpClassWebServices classWebServices in source) { list.Add(classWebServices); } } if (list.Count == 0) { list.AddRange((IEnumerable <HelpClassWebServices>)institutionsPermissions); } this.Application["ListWebServices"] = (object)list; this.WSGridView.DataSource = (object)list; this.WSGridView.DataBind(); }
protected void TextBox1_TextChanged(object sender, EventArgs e) { this.DropDownList3.SelectedIndex = 0; List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, (USER)this.Session["user"]); List <HelpClassWebServices> list = new List <HelpClassWebServices>(); IEnumerable <HelpClassWebServices> source = Enumerable.Where <HelpClassWebServices>((IEnumerable <HelpClassWebServices>)servicesPermissions, (Func <HelpClassWebServices, bool>)(p => p.Tittle.ToUpper().Contains(this.TextBox1.Text.ToUpper()))); if (Enumerable.Count <HelpClassWebServices>(source) != 0) { list.Clear(); foreach (HelpClassWebServices classWebServices in source) { list.Add(classWebServices); } } if (list.Count == 0) { list.AddRange((IEnumerable <HelpClassWebServices>)servicesPermissions); } this.Session["PanelWSHelp"] = (object)list; this.WSGridView.DataSource = (object)list; this.WSGridView.DataBind(); }
protected void btn_ServiceLogLocalAdmin_Click(object sender, EventArgs e) { List <SearchLog> logForLocalAdmin = new InteropDAL().GetTop50SearchLogForLocalAdmin((INSTITUTION)this.Session["UserInstitution"]); this.Session["BigList"] = (object)logForLocalAdmin; List <SearchLog> list1 = new List <SearchLog>(); list1.AddRange((IEnumerable <SearchLog>)logForLocalAdmin); this.Session["BigListFilter"] = (object)list1; this.Session["ListLogU"] = (object)new UsersDAL().GetUsersByWSLogForLocalAdmin((INSTITUTION)this.Session["UserInstitution"]); this.Session["ListLogI"] = (object)new InstitutionsDAL().GetAllActiveDeleted(true); List <WEBSERVICE> list2 = new List <WEBSERVICE>(); foreach (string tittle in Enumerable.Distinct <string>(Enumerable.Select <SearchLog, string>((IEnumerable <SearchLog>)logForLocalAdmin, (Func <SearchLog, string>)(p => p.WSTitle)))) { if (tittle != null) { WEBSERVICE byTittle = new WebservicesDAL().GetByTittle(tittle); list2.Add(byTittle); } } this.Session["ListLogWS"] = (object)list2; this.fillControl1("LocalAdminPanel/WebServicesLog.ascx", this.btn_ServiceLog); }
protected void TextBox1_TextChanged(object sender, EventArgs e) { USER user = (USER)this.Session["user"]; List <PERMISSION> permisionsByUser = new PermissionsDAL().GetPermisionsByUser(user); List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, user, permisionsByUser[0].INSTITUTION); List <HelpClassWebServices> list = new List <HelpClassWebServices>(); IEnumerable <HelpClassWebServices> source = Enumerable.Where <HelpClassWebServices>((IEnumerable <HelpClassWebServices>)servicesPermissions, (Func <HelpClassWebServices, bool>)(p => p.Tittle.ToUpper().Contains(this.TextBox1.Text.ToUpper()))); if (Enumerable.Count <HelpClassWebServices>(source) != 0) { list.Clear(); foreach (HelpClassWebServices classWebServices in source) { list.Add(classWebServices); } } if (list.Count == 0) { list.AddRange((IEnumerable <HelpClassWebServices>)servicesPermissions); } this.Application["ListUserWebServices"] = (object)list; this.WSGridView.DataSource = (object)list; this.WSGridView.DataBind(); }
protected void IGridView_SelectedIndexChanged(object sender, EventArgs e) { Guid row = (Guid)this.IGridView.SelectedDataKey.Value; HelpClassUsers helpClassUsers = Enumerable.First <HelpClassUsers>((IEnumerable <HelpClassUsers>) this.Application["ListUsersPermissionsPerm"], (Func <HelpClassUsers, bool>)(p => p.ID == row)); this.Application["UserPermission"] = (object)helpClassUsers; this.Application["SelectedUser"] = (object)row; List <WEBSERVICE> list1 = new List <WEBSERVICE>(); List <WEBSERVICE> list2 = new List <WEBSERVICE>(); INSTITUTION byId = new InstitutionsDAL().GetByID(helpClassUsers.IDInstitution); List <WEBSERVICE> otherWebServices = new WebservicesDAL().GetAllOtherWebServices(byId); List <WEBSERVICE> servicesByIstitution = new WebservicesDAL().GetServicesByIstitution(byId); this.Session["ListAllWSInst"] = (object)servicesByIstitution; this.Session["ListAllWS"] = (object)otherWebServices; this.CheckBoxListOwner.DataSource = (object)servicesByIstitution; this.CheckBoxListOwner.DataBind(); this.CheckBoxListUser.DataSource = (object)otherWebServices; this.CheckBoxListUser.DataBind(); foreach (PERMISSION permission in Enumerable.Where <PERMISSION>((IEnumerable <PERMISSION>)helpClassUsers.PermissionList, (Func <PERMISSION, bool>)(p => p.Usage == 1 && p.Active))) { list1.Add(permission.WEBSERVICE); for (int index = 0; index < this.CheckBoxListOwner.Items.Count; ++index) { if (this.CheckBoxListOwner.Items[index].Value == permission.WEBSERVICE.ID.ToString()) { this.CheckBoxListOwner.Items[index].Selected = true; this.CheckBoxListOwner.Items[index].Attributes.Add("Style", "color: red;"); break; } } } foreach (PERMISSION permission in Enumerable.Where <PERMISSION>((IEnumerable <PERMISSION>)helpClassUsers.PermissionList, (Func <PERMISSION, bool>)(p => p.Usage == 2 && p.Active))) { for (int index = 0; index < this.CheckBoxListUser.Items.Count; ++index) { if (this.CheckBoxListUser.Items[index].Value == permission.WEBSERVICE.ID.ToString()) { this.CheckBoxListUser.Items[index].Selected = true; break; } } } foreach (PERMISSION permission in new PermissionsDAL().GetPermisionsByUser(new UsersDAL().GetByID(helpClassUsers.ID))) { if (permission.Active) { list2.Add(permission.WEBSERVICE); } } this.Application["ListWSOwner"] = (object)list1; this.Application["ListWSUser"] = (object)list2; this.lblName.Text = helpClassUsers.NameSurname; this.lblDescr.Text = helpClassUsers.InstitutionName; this.lblstatus.Text = !helpClassUsers.Active ? "Неактивен" : "Активен"; this.DisableTxtBox(); this.ClearStylePermbmeni(); this.lblinfo.Text = ""; if (this.CheckBoxListUser.Visible) { this.ClearStylePermbmeni(); this.btnUsage.CssClass = "default-tab current"; } else if (this.CheckBoxListOwner.Visible) { this.ClearStylePermbmeni(); this.btnOwner.CssClass = "default-tab current"; } this.PanelInfoInst.Visible = true; this.btnOwner.CssClass = "default-tab current"; this.Gridview2.DataSource = (object)otherWebServices; this.Gridview2.DataBind(); this.Gridview1.DataSource = (object)servicesByIstitution; this.Gridview1.DataBind(); this.Gridview1.Visible = true; this.Gridview2.Visible = false; }
protected void LinkButtonPromeni_Click(object sender, EventArgs e) { bool flag = false; for (int index = 0; index < this.CheckBoxListOwner.Items.Count; ++index) { if (this.CheckBoxListOwner.Items[index].Selected) { flag = true; break; } } if (!flag) { return; } List <WEBSERVICE> list1 = (List <WEBSERVICE>) this.Application["ListWSOwner"]; List <WEBSERVICE> list2 = (List <WEBSERVICE>) this.Application["ListWSUser"]; HelpClassUsers helpClassUsers = (HelpClassUsers)this.Application["UserPermission"]; INSTITUTION byId1 = new InstitutionsDAL().GetByID(helpClassUsers.IDInstitution); USER byId2 = new UsersDAL().GetByID(helpClassUsers.ID); WEBSERVICE webservice; KeyValuePair <int, string> keyValuePair; for (int i = 0; i < this.CheckBoxListOwner.Items.Count; ++i) { if (this.CheckBoxListOwner.Items[i].Selected) { try { webservice = Enumerable.First <WEBSERVICE>((IEnumerable <WEBSERVICE>)list1, (Func <WEBSERVICE, bool>)(p => p.ID == Convert.ToInt64(this.CheckBoxListOwner.Items[i].Value))); } catch { WEBSERVICE byId3 = new WebservicesDAL().GetByID(Convert.ToInt64(this.CheckBoxListOwner.Items[i].Value)); long num = new PermissionsDAL().Insert(byId1, byId2, byId3, 1, true, DateTime.Now); string old = ""; string newone = ""; keyValuePair = Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")); new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone); } } else { try { WEBSERVICE ws = Enumerable.First <WEBSERVICE>((IEnumerable <WEBSERVICE>)list1, (Func <WEBSERVICE, bool>)(p => p.ID == Convert.ToInt64(this.CheckBoxListOwner.Items[i].Value))); PERMISSION permission = Enumerable.First <PERMISSION>((IEnumerable <PERMISSION>)helpClassUsers.PermissionList, (Func <PERMISSION, bool>)(p => p.ID_WS == ws.ID && p.Usage == 1)); new PermissionsDAL().Update((INSTITUTION)null, (USER)null, (WEBSERVICE)null, new int?(), new bool?(false), new DateTime?(), permission.ID); string old = ""; string newone = ""; keyValuePair = Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")); new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], permission.ID.ToString(), 2, DateTime.Now, old, newone); } catch { } } } for (int i = 0; i < this.CheckBoxListUser.Items.Count; ++i) { if (this.CheckBoxListUser.Items[i].Selected) { try { webservice = Enumerable.First <WEBSERVICE>((IEnumerable <WEBSERVICE>)list2, (Func <WEBSERVICE, bool>)(p => p.ID == Convert.ToInt64(this.CheckBoxListUser.Items[i].Value))); } catch { WEBSERVICE byId3 = new WebservicesDAL().GetByID(Convert.ToInt64(this.CheckBoxListUser.Items[i].Value)); long num = new PermissionsDAL().Insert(byId1, byId2, byId3, 2, true, DateTime.Now); string old = ""; string newone = ""; keyValuePair = Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")); new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone); } } else { try { WEBSERVICE ws = Enumerable.First <WEBSERVICE>((IEnumerable <WEBSERVICE>)list2, (Func <WEBSERVICE, bool>)(p => p.ID == Convert.ToInt64(this.CheckBoxListUser.Items[i].Value))); PERMISSION permission = Enumerable.First <PERMISSION>((IEnumerable <PERMISSION>)helpClassUsers.PermissionList, (Func <PERMISSION, bool>)(p => p.ID_WS == ws.ID && p.Usage == 2)); new PermissionsDAL().Update((INSTITUTION)null, (USER)null, (WEBSERVICE)null, new int?(), new bool?(false), new DateTime?(), permission.ID); string old = ""; string newone = ""; keyValuePair = Enumerable.First <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")); new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], permission.ID.ToString(), 2, DateTime.Now, old, newone); } catch { } } } }
protected void Page_Load(object sender, EventArgs e) { this.Session["HelpMenu3"] = (object)"Help/korisnik/Help_pocetna_obicen.aspx"; this.Session["HelpMenu2"] = (object)"Help/admin/Help_Pocetna_Admin.aspx"; this.Session["HelpMenu1"] = (object)"Help/superadmin/Help_pocetna_super.aspx"; HttpBrowserCapabilities browser = this.Request.Browser; if (browser.Browser == "IE" && browser.MajorVersion <= 6) { HtmlHead header = this.Page.Header; HtmlLink htmlLink = new HtmlLink(); htmlLink.Attributes.Add("href", this.Page.ResolveClientUrl("~/rerources/css/IE6Style.css")); htmlLink.Attributes.Add("type", "text/css"); htmlLink.Attributes.Add("rel", "stylesheet"); header.Controls.Add((Control)htmlLink); } if (browser.Browser == "IE" && browser.MajorVersion == 7) { HtmlHead header = this.Page.Header; HtmlLink htmlLink = new HtmlLink(); htmlLink.Attributes.Add("href", this.Page.ResolveClientUrl("~/rerources/css/IEStyle.css")); htmlLink.Attributes.Add("type", "text/css"); htmlLink.Attributes.Add("rel", "stylesheet"); header.Controls.Add((Control)htmlLink); } if (browser.Browser == "IE" && browser.MajorVersion == 9) { HtmlHead header = this.Page.Header; HtmlLink htmlLink = new HtmlLink(); htmlLink.Attributes.Add("href", this.Page.ResolveClientUrl("~/rerources/css/IEStyle.css")); htmlLink.Attributes.Add("type", "text/css"); htmlLink.Attributes.Add("rel", "stylesheet"); header.Controls.Add((Control)htmlLink); } if (browser.Browser == "IE" && browser.MajorVersion == 8) { this.ControlInstitutions.Width = (Unit)150; this.ControlServices.Width = (Unit)150; HtmlHead header = this.Page.Header; HtmlLink htmlLink = new HtmlLink(); htmlLink.Attributes.Add("href", this.Page.ResolveClientUrl("~/rerources/css/IE8Style.css")); htmlLink.Attributes.Add("type", "text/css"); htmlLink.Attributes.Add("rel", "stylesheet"); header.Controls.Add((Control)htmlLink); } else if (browser.Browser != "IE") { this.ControlInstitutions.Width = (Unit)150; this.ControlServices.Width = (Unit)150; HtmlHead header = this.Page.Header; HtmlLink htmlLink = new HtmlLink(); htmlLink.Attributes.Add("href", this.Page.ResolveClientUrl("~/rerources/css/Style.css")); htmlLink.Attributes.Add("type", "text/css"); htmlLink.Attributes.Add("rel", "stylesheet"); header.Controls.Add((Control)htmlLink); } List <Opstini> list1 = new List <Opstini>(); List <KatOpstini> list2 = new List <KatOpstini>(); List <KatOpstini> list3 = new List <KatOpstini>(); InteropDAL interopDal = new InteropDAL(); this.Session["Grad"] = (object)list1; this.Session["Opstini"] = (object)list2; list3.AddRange((IEnumerable <KatOpstini>)list2); this.Session["OpstiniFilter"] = (object)list3; if (this.Session["user"] != null && this.Session["CertificateName"] != null) { USER user = (USER)this.Session["user"]; if (this.Session["Login_" + (object)user.ID] == this.Application.Get("Login_" + (object)user.ID)) { if (user.Type == 1) { this.SysSettings.Visible = true; if (!this.IsPostBack) { List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true); allActiveDeleted.AddRange((IEnumerable <INSTITUTION>) new InstitutionsDAL().GetAllActiveDeleted(false)); this.Application["DropDownInstitutions"] = (object)allActiveDeleted; if (user.Type == 1) { this.Application["ListInstitutions"] = (object)new InstitutionsDAL().GetAllActiveDeleted(true); this.Application["ListWebServices"] = (object)new WebservicesDAL().GetWebServicesInstitutionsPermissions(true); this.Application["ListUsersPermissions"] = (object)new UsersDAL().GetUsersInstitutionsPermissions(2, true); this.Application["ListUsersPermissionsPerm"] = (object)new UsersDAL().GetUsersInstitutionsPermissions(2, true); this.Application["ListBasis"] = (object)new BasisDAL().GetAllByStatus(true); } } this.AdminPanelMenu.Visible = true; if (this.ctr1ID.Text != "") { this.fillControl1("AdminPanel/" + this.ctr1ID.Text + ".ascx", (LinkButton)this.FindControl("btn_" + this.ctr1ID.Text)); } else if (this.Session["AdminInstitution"] != null) { this.fillControl1("AdminPanel/institutions.ascx", this.btn_ws); } else if (this.Session["AdminWS"] != null) { this.fillControl1("AdminPanel/ws.ascx", this.btn_ws); } else if (this.Session["AdminUser"] != null) { this.fillControl1("AdminPanel/users.ascx", this.btn_ws); } else if (this.Session["AdminPermisions"] != null) { this.fillControl1("AdminPanel/permissions.ascx", this.btn_ws); } else if (this.Session["AdminValidate"] != null) { this.fillControl1("AdminPanel/validatea.ascx", this.btn_ws); } else if ((INSTITUTION)this.Session["AdminSelectedInstitution"] != null) { this.fillControl1("AdminPanel/instinfoa.ascx", this.btn_ws); } else if ((HelpClassWebServices)this.Session["AdminSelectedWS"] != null) { this.fillControl1("AdminPanel/wsusagea.ascx", this.btn_ws); } else if ((HelpClassUsers)this.Session["AdminSelectedUser"] != null) { this.fillControl1("AdminPanel/users.ascx", this.btn_users); } else { this.fillControl1("AdminPanel/indexa.ascx", this.btn_users); } } if (user.Type == 2) { if (!this.IsPostBack && user.Type == 2) { List <PERMISSION> permisionsByUser = new PermissionsDAL().GetPermisionsByUser(user); this.Application["DropDownInstitutions"] = (object)new List <INSTITUTION>() { permisionsByUser[0].INSTITUTION }; List <WEBSERVICE> list4 = new List <WEBSERVICE>(); foreach (PERMISSION permission in permisionsByUser) { if (permission.Active) { list4.Add(permission.WEBSERVICE); } } this.Application["ListWebServices"] = (object)list4; this.Application["ListUserWebServices"] = (object)new WebservicesDAL().GetUsersWebServicesPermissions(true, user, permisionsByUser[0].INSTITUTION); this.Application["ListUsersPermissions"] = (object)new UsersDAL().GetUsersPermissionsByInstitution(true, permisionsByUser[0].INSTITUTION); this.Application["ListUsersPermissionsPerm"] = (object)new UsersDAL().GetUsersPermissionsByInstitution(true, permisionsByUser[0].INSTITUTION); } this.LocalAdminPanelMenu.Visible = true; this.lblInstIfoUs.Text = user.PERMISSIONs[0].INSTITUTION.Tittle; this.Session["UserInstitution"] = (object)user.PERMISSIONs[0].INSTITUTION; if (this.ctr1ID.Text != "") { this.fillControl1("LocalAdminPanel/" + this.ctr1ID.Text + ".ascx", (LinkButton)this.FindControl("btn_" + this.ctr1ID.Text)); } else if (this.Session["LocalUser"] != null) { List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, (USER)this.Session["user"]); List <WEBSERVICE> list4 = new List <WEBSERVICE>(); foreach (HelpClassWebServices classWebServices in servicesPermissions) { list4.Add(classWebServices.WSObj); } List <WEBSERVICE> list5 = new List <WEBSERVICE>(); list5.AddRange((IEnumerable <WEBSERVICE>)list4); this.Session["ListWSAllInst"] = (object)list4; this.Session["ListWSInst"] = (object)list5; this.fillControl1("LocalAdminPanel/usersl.ascx", this.btn_ws); } else if (this.Session["LocalPermisions"] != null) { this.fillControl1("LocalAdminPanel/permissionsl.ascx", this.btn_ws); } else if ((INSTITUTION)this.Session["LocalSelectedInstitution"] != null) { this.fillControl1("LocalAdminPanel/instinfol.ascx", this.btn_ws); } else if ((HelpClassWebServices)this.Session["LocalSelectedWS"] != null) { this.fillControl1("LocalAdminPanel/wsusagel.ascx", this.btn_ws); } else if ((HelpClassUsers)this.Session["LocalSelectedUser"] != null) { this.fillControl1("LocalAdminPanel/usersl.ascx", this.btn_usersl); } else { this.fillControl1("LocalAdminPanel/indexl.ascx", this.btn_usersl); } } if (user.Type == 3) { this.UserPanelMenu.Visible = true; if (user.Type == 3) { List <PERMISSION> permisionsByUser = new PermissionsDAL().GetPermisionsByUser(user); List <WEBSERVICE> list4 = new List <WEBSERVICE>(); foreach (PERMISSION permission in permisionsByUser) { if (permission.Active) { list4.Add(permission.WEBSERVICE); } } this.Application["ListWebServices"] = (object)list4; this.Application["ListUserWebServices"] = (object)new WebservicesDAL().GetUsersWebServicesPermissions(true, user); } this.lblInstIfoUs.Text = user.PERMISSIONs[0].INSTITUTION.Tittle; this.Session["UserInstitution"] = (object)user.PERMISSIONs[0].INSTITUTION; if (this.ctr1ID.Text != "") { this.fillControl1("UserPanel/" + this.ctr1ID.Text + ".ascx", (LinkButton)this.FindControl("btn_" + this.ctr1ID.Text)); } else if ((HelpClassWebServices)this.Session["SelectedWS"] != null) { this.fillControl1("UserPanel/wsusage.ascx", this.btn_ws); } else if ((INSTITUTION)this.Session["SelectedInstitution"] != null) { this.fillControl1("UserPanel/instinfo.ascx", this.btn_ws); } else { this.fillControl1("UserPanel/indexu.ascx", this.btn_wsus); } } this.lbluserinfo.Text = user.Name + " " + user.Surname; this.LinkButton1.Visible = true; } else { this.Session["user"] = (object)null; this.Response.Redirect("Login.aspx"); } } else { this.Session["user"] = (object)null; this.Response.Redirect("Login.aspx"); } if (!new InteropDAL().GetSetting().CanCopyPrintScreen.Value) { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "setClipBoardData", "" + "function setClipBoardData(){" + "setInterval(\"window.clipboardData.setData('text','')\",20);" + "}" + "function blockError(){" + "window.location.reload(true);" + "return true;}", true); } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "setClipBoardData", "" + "function setClipBoardData(){" + "}", true); } }