Пример #1
0
        protected void PanelInstitucii_Load(object sender, EventArgs e)
        {
            List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, (USER)this.Session["user"]);
            List <INSTITUTION>          list = new List <INSTITUTION>();

            foreach (long id in Enumerable.Distinct <long>(Enumerable.Select <HelpClassWebServices, long>((IEnumerable <HelpClassWebServices>)servicesPermissions, (Func <HelpClassWebServices, long>)(p => p.IDInstitution))))
            {
                INSTITUTION byId = new InstitutionsDAL().GetByID(id);
                if (byId != null)
                {
                    list.Add(byId);
                }
            }
            this.PanelInstitucii.Controls.Clear();
            foreach (INSTITUTION institution in list)
            {
                Label label = new Label();
                this.PanelInstitucii.Controls.Add((Control) new LiteralControl("<p>"));
                label.ID       = "LabelInst" + (object)institution.ID;
                label.Text     = institution.Tittle;
                label.CssClass = "lblpanelsinfo";
                this.PanelInstitucii.Controls.Add((Control)label);
                LinkButton linkButton = new LinkButton();
                linkButton.ID       = "LinkInst" + (object)institution.ID;
                linkButton.Text     = "Повеќе...";
                linkButton.CssClass = "linkpanelsinfo";
                linkButton.Click   += new EventHandler(this.LinkInst_Click);
                this.PanelInstitucii.Controls.Add((Control)linkButton);
                this.PanelInstitucii.Controls.Add((Control) new LiteralControl("</p>"));
            }
        }
Пример #2
0
 public void PageLoadStaf()
 {
     if (this.Session["ListOsnoviSelected"] == null)
     {
         this.Session["ListOsnoviSelected"] = (object)new List <BASIS>();
     }
     if (this.DropDonwListInstitution.SelectedValue == "0" || this.DropDonwListInstitution.SelectedValue == string.Empty)
     {
         List <INSTITUTION> list             = new List <INSTITUTION>();
         List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);
         list.Add(new INSTITUTION()
         {
             ID     = 0L,
             Tittle = "-- Институции --"
         });
         list.AddRange((IEnumerable <INSTITUTION>)allActiveDeleted);
         this.DropDonwListInstitution.DataTextField  = "Tittle";
         this.DropDonwListInstitution.DataValueField = "ID";
         this.DropDonwListInstitution.DataSource     = (object)list;
         this.DropDonwListInstitution.DataBind();
     }
     else
     {
         this.GridviewOsnoviNaBaranje.DataSource = this.Session["ListOsnoviAll"];
         this.GridviewOsnoviNaBaranje.DataBind();
     }
 }
Пример #3
0
        protected void LinkInst_Click(object sender, EventArgs e)
        {
            INSTITUTION byId = new InstitutionsDAL().GetByID(Convert.ToInt64(((Control)sender).ID.Remove(0, 8)));

            this.Session["AdminSelectedInstitution"] = (object)byId;
            this.FillPanelUsers(byId);
            this.FillPanelServices(byId);
        }
Пример #4
0
        protected void LinkButton1_Click1(object sender, EventArgs e)
        {
            List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);

            this.InstitutionsGridView.DataSource = (object)allActiveDeleted;
            this.InstitutionsGridView.DataBind();
            this.Application["ListInstitutions"] = (object)allActiveDeleted;
        }
Пример #5
0
        protected void LinkButtonPromeni_Click(object sender, EventArgs e)
        {
            bool flag = false;

            for (int index = 0; index < this.CheckBoxListUser.Items.Count; ++index)
            {
                if (this.CheckBoxListUser.Items[index].Selected)
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                return;
            }
            List <WEBSERVICE> list           = (List <WEBSERVICE>) this.Session["ListWSUser"];
            HelpClassUsers    helpClassUsers = (HelpClassUsers)this.Application["UserPermission"];
            INSTITUTION       byId1          = new InstitutionsDAL().GetByID(helpClassUsers.IDInstitution);
            USER byId2 = new UsersDAL().GetByID(helpClassUsers.ID);
            KeyValuePair <int, string> keyValuePair;

            for (int i = 0; i < this.CheckBoxListUser.Items.Count; ++i)
            {
                if (this.CheckBoxListUser.Items[i].Selected)
                {
                    try
                    {
                        Enumerable.Single <WEBSERVICE>((IEnumerable <WEBSERVICE>)list, (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.Single <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.Single <WEBSERVICE>((IEnumerable <WEBSERVICE>)list, (Func <WEBSERVICE, bool>)(p => p.ID == Convert.ToInt64(this.CheckBoxListUser.Items[i].Value)));
                        PERMISSION permission = Enumerable.Single <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.Single <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
                    {
                    }
                }
            }
        }
Пример #6
0
        protected void LinkInst_Click(object sender, EventArgs e)
        {
            INSTITUTION byId = new InstitutionsDAL().GetByID(Convert.ToInt64(((Control)sender).ID.Remove(0, 8)));

            this.Session["SelectedInstitution"] = (object)byId;
            this.Label1.Text = byId.Tittle;
            this.Label2.Text = byId.Description;
            this.FillPanelServices(byId);
        }
Пример #7
0
        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);

            allActiveDeleted.AddRange((IEnumerable <INSTITUTION>) new InstitutionsDAL().GetAllActiveDeleted(false));
            this.InstitutionsGridView.DataSource = (object)allActiveDeleted;
            this.InstitutionsGridView.DataBind();
            this.Application["ListInstitutions"] = (object)allActiveDeleted;
            this.ClearStyleSubmeni();
        }
Пример #8
0
        protected void LinkInst_Click(object sender, EventArgs e)
        {
            INSTITUTION byId = new InstitutionsDAL().GetByID(Convert.ToInt64(((Control)sender).ID.Remove(0, 8)));

            this.Session["LocalSelectedInstitution"] = (object)byId;
            List <PERMISSION> permisionsByUser = new PermissionsDAL().GetPermisionsByUser((USER)this.Session["user"]);

            if (byId.ID == permisionsByUser[0].INSTITUTION.ID)
            {
                this.FillPanelUsers(byId);
            }
            this.FillPanelServices(byId);
        }
Пример #9
0
        protected void btn_vnesi_Click(object sender, EventArgs e)
        {
            long   num    = new InstitutionsDAL().Insert(this.txtName.Text, this.txtDescription.Text, true, DateTime.Now);
            string old    = this.txtName.Text + ";" + this.txtDescription.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 == "INSTITUTIONS")).Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone);
            this.ClearTxtBox();
            this.Application["ListInstitutions"] = (object)new InstitutionsDAL().GetAllActiveDeleted(true);
            this.InstitutionsGridView.DataSource = (object)(List <INSTITUTION>) this.Application["ListInstitutions"];
            this.InstitutionsGridView.DataBind();
            this.PanelEditUser.CssClass = "content-box column-right closed-box";
            this.PanelNewUser.CssClass  = "content-box column-left closed-box";
        }
Пример #10
0
 protected void btn_vnesi_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.DropDownList2.SelectedValue != "0")
         {
             bool   active  = true;
             long   id      = new WebservicesDAL().Insert(this.txtPName.Text, this.txtPDescription.Text, this.txtPNote.Text, this.txtPURL.Text, active, DateTime.Now);
             string old1    = this.txtPName.Text + ";" + this.txtPDescription.Text + ";" + this.txtPNote.Text + ";" + this.txtPURL.Text + ";" + active.ToString();
             string newone1 = "";
             new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICES")).Key, (USER)this.Session["user"], id.ToString(), 1, DateTime.Now, old1, newone1);
             USER        user    = (USER)this.Session["user"];
             INSTITUTION byId1   = new InstitutionsDAL().GetByID((long)Convert.ToInt32(this.DropDownList2.SelectedValue));
             WEBSERVICE  byId2   = new WebservicesDAL().GetByID(id);
             long        num1    = new PermissionsDAL().Insert(byId1, user, byId2, 1, true, DateTime.Now);
             string      old2    = "";
             string      newone2 = "";
             new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")).Key, (USER)this.Session["user"], num1.ToString(), 1, DateTime.Now, old2, newone2);
             List <PARAM> list = (List <PARAM>) this.Application["Params"];
             KeyValuePair <int, string> keyValuePair = Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS"));
             foreach (PARAM obj in list)
             {
                 long   num2    = new ParamsDAL().Insert(obj.Tittle, obj.Description, obj.MaxLength, obj.Type, byId2, true);
                 string old3    = obj.Tittle + (object)";" + obj.Description + ";" + (string)(object)obj.MaxLength + ";" + (string)(object)obj.Type + ";" + true.ToString();
                 string newone3 = "";
                 new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], num2.ToString(), 1, DateTime.Now, old3, newone3);
             }
             foreach (BASIS basis in (List <BASIS>) this.Session["ListOsnoviSelected"])
             {
                 Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICESBASIS"));
             }
             this.ClearTxtBoxChange();
             this.Application["Params"]          = (object)null;
             this.Application["ListWebServices"] = (object)new WebservicesDAL().GetWebServicesInstitutionsPermissions(true);
             this.WSGridView.DataSource          = (object)(List <HelpClassWebServices>) this.Application["ListWebServices"];
             this.WSGridView.DataBind();
             this.DropDownList3.SelectedIndex = -1;
         }
         this.PanelNewUser.CssClass  = "content-box column-left closed-box";
         this.PanelEditUser.CssClass = "content-box column-right closed-box";
     }
     catch
     {
     }
 }
Пример #11
0
        protected void ControlInstitutions_Load(object sender, EventArgs e)
        {
            USER user = (USER)this.Session["user"];

            if (user == null)
            {
                return;
            }
            if (user.Type == 1)
            {
                List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);
                this.Session["PanelInstitutions"] = (object)allActiveDeleted;
                this.FillControlInstitutions(allActiveDeleted);
            }
            else if (user.Type == 2)
            {
                List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, user);
                List <INSTITUTION>          List = new List <INSTITUTION>();
                foreach (long id in Enumerable.Distinct <long>(Enumerable.Select <HelpClassWebServices, long>((IEnumerable <HelpClassWebServices>)servicesPermissions, (Func <HelpClassWebServices, long>)(p => p.IDInstitution))))
                {
                    INSTITUTION byId = new InstitutionsDAL().GetByID(id);
                    if (byId != null)
                    {
                        List.Add(byId);
                    }
                }
                this.Session["PanelInstitutions"] = (object)List;
                this.FillControlInstitutions(List);
            }
            else if (user.Type == 3)
            {
                List <HelpClassWebServices> servicesPermissions = new WebservicesDAL().GetUsersWebServicesPermissions(true, user);
                List <INSTITUTION>          List = new List <INSTITUTION>();
                foreach (long id in Enumerable.Distinct <long>(Enumerable.Select <HelpClassWebServices, long>((IEnumerable <HelpClassWebServices>)servicesPermissions, (Func <HelpClassWebServices, long>)(p => p.IDInstitution))))
                {
                    INSTITUTION byId = new InstitutionsDAL().GetByID(id);
                    if (byId != null)
                    {
                        List.Add(byId);
                    }
                }
                this.Session["PanelInstitutions"] = (object)List;
                this.FillControlInstitutions(List);
            }
        }
Пример #12
0
        protected void btn_vnesi_Click(object sender, EventArgs e)
        {
            if (this.lblUserExist.Visible)
            {
                return;
            }
            bool flag = false;

            if (((List <interop.WEBSERVICE>) this.Session["ListWSInst"]).Count != 0)
            {
                flag = true;
            }
            if (flag)
            {
                bool   active  = true;
                string pass    = new Crypto().EncryptStringAES(this.txtPassword.Text, ConfigurationManager.AppSettings["PssCrypto"]);
                Guid   id      = new UsersDAL().Insert(this.txtName.Text, this.txtSurname.Text, ((interop.USER) this.Session["user"]).ID_CERT, this.txtemail.Text, active, DateTime.Now, this.txtUsername.Text, pass, 3, this.txtIP.Text);
                string old1    = this.txtName.Text + ";" + this.txtSurname.Text + ";" + this.txtemail.Text + ";" + this.txtUsername.Text + ";" + this.txtPassword.Text + ";" + active.ToString();
                string newone1 = "";
                KeyValuePair <int, string> keyValuePair = Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)WebApplicationInterop.InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "USERS"));
                new LOGDAL().Insert(keyValuePair.Key, (interop.USER) this.Session["user"], id.ToString(), 1, DateTime.Now, old1, newone1);
                interop.USER        byId1 = new UsersDAL().GetByID(id);
                interop.INSTITUTION byId2 = new InstitutionsDAL().GetByID((long)Convert.ToInt32(this.DropDownInst.SelectedValue));
                foreach (interop.WEBSERVICE ws in (List <interop.WEBSERVICE>) this.Session["ListWSInst"])
                {
                    long   num     = new PermissionsDAL().Insert(byId2, byId1, ws, 2, true, DateTime.Now);
                    string old2    = "";
                    string newone2 = "";
                    keyValuePair = Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)WebApplicationInterop.InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS"));
                    new LOGDAL().Insert(keyValuePair.Key, (interop.USER) this.Session["user"], num.ToString(), 1, DateTime.Now, old2, newone2);
                }
                this.ClearTxtBox();
                List <HelpClassUsers> permissionsByInstitution = new UsersDAL().GetUsersPermissionsByInstitution(true, new PermissionsDAL().GetPermisionsByUser((interop.USER) this.Session["user"])[0].INSTITUTION);
                this.Application["ListUsersPermissions"]     = (object)permissionsByInstitution;
                this.Application["ListUsersPermissionsPerm"] = (object)permissionsByInstitution;
                this.CustomersGridView.DataSource            = (object)(List <HelpClassUsers>) this.Application["ListUsersPermissions"];
                this.CustomersGridView.DataBind();
                this.DropDownList3.SelectedIndex = -1;
                this.PanelEditUser.CssClass      = "content-box column-right closed-box";
                this.PanelNewUser.CssClass       = "content-box column-left closed-box";
            }
        }
Пример #13
0
        protected void PanelInstitucii_Load(object sender, EventArgs e)
        {
            List <INSTITUTION> allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);

            this.PanelInstitucii.Controls.Clear();
            foreach (INSTITUTION institution in allActiveDeleted)
            {
                Label label = new Label();
                this.PanelInstitucii.Controls.Add((Control) new LiteralControl("<p>"));
                label.ID       = "LabelInst" + (object)institution.ID;
                label.Text     = institution.Tittle;
                label.CssClass = "lblpanelsinfo";
                this.PanelInstitucii.Controls.Add((Control)label);
                LinkButton linkButton = new LinkButton();
                linkButton.ID       = "LinkInst" + (object)institution.ID;
                linkButton.Text     = "Повеќе...";
                linkButton.CssClass = "linkpanelsinfo";
                linkButton.Click   += new EventHandler(this.LinkInst_Click);
                this.PanelInstitucii.Controls.Add((Control)linkButton);
                this.PanelInstitucii.Controls.Add((Control) new LiteralControl("</p>"));
            }
        }
Пример #14
0
        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            List <INSTITUTION>        allActiveDeleted = new InstitutionsDAL().GetAllActiveDeleted(true);
            List <INSTITUTION>        list             = new List <INSTITUTION>();
            IEnumerable <INSTITUTION> source           = Enumerable.Where <INSTITUTION>((IEnumerable <INSTITUTION>)allActiveDeleted, (Func <INSTITUTION, bool>)(p => p.Tittle.ToUpper().Contains(this.TextBox1.Text.ToUpper())));

            if (Enumerable.Count <INSTITUTION>(source) != 0)
            {
                list.Clear();
                foreach (INSTITUTION institution in source)
                {
                    list.Add(institution);
                }
            }
            if (list.Count == 0)
            {
                list.AddRange((IEnumerable <INSTITUTION>)allActiveDeleted);
            }
            this.Application["ListInstitutions"] = (object)list;
            this.InstitutionsGridView.DataSource = (object)list;
            this.InstitutionsGridView.DataBind();
        }
Пример #15
0
        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;
        }
Пример #16
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);
            }
        }