Esempio n. 1
0
 private void attach_USERs(USER entity)
 {
     this.SendPropertyChanging();
     entity.CERTIFICATE = this;
 }
Esempio n. 2
0
 private void detach_USERs(USER entity)
 {
     this.SendPropertyChanging();
     entity.CERTIFICATE = (CERTIFICATE)null;
 }
Esempio n. 3
0
        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);
            }
        }