예제 #1
0
 protected void ChangePassword1_ChangingPassword(object sender, LoginCancelEventArgs e)
 {
     if (ConfigurationManager.AppSettings["codename"].ToLower().IndexOf("demo") > 0)
     {
         BaseContentPage.SetError("W tej wersji aplikacji has³o nie mo¿e byæ zmienione.", "~/OczekujaceZadania.aspx");
         e.Cancel = true;
     }
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!File.Exists(Pemi.Esoda.Tools.Configuration.ScannersConfigurationFile))
            {
                BaseContentPage.SetError("Nie uda³o siê odnaleŸæ pliku konfiguracyjnego skanerów", "~/Aplikacje/DziennikKancelaryjny/EdycjaSkanowPozycjiDziennika.aspx");
                return;
            }
            presenter = new AddItemScanPresenter(this, new WebSessionProvider());
            if (!IsPostBack)
            {
                presenter.Initialize();
            }

            liczbaNowychSkanow.Text = MonitorUrzadzen.LiczbaOczekujacychSkanow().ToString();
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ViewDocumentActionsPresenter presenter = new ViewDocumentActionsPresenter(this, new WebSessionProvider());

            Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton4";
            if (!IsPostBack)
            {
                int docId = CoreObject.GetId(Request);
                if (docId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new DocumentDAO()).IsDocVisibleForUser(docId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tego dokumentu", "~/OczekujaceZadania.aspx");
                    }
                }
                presenter.Initialize();
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new ViewDocumentPresenter(this, new WebSessionProvider());

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Page.Request["mode"]) && !String.IsNullOrEmpty(Page.Request["id"]))
                {
                    string url = "FormularzDoc.aspx?id=" + Page.Request["id"].ToString() + "&mode=" + Page.Request["mode"].ToString();

                    //if (!ClientScript.IsStartupScriptRegistered(this.GetType(), "scriptWord"))
                    //{
                    //    string script = @"window.location.href='" + url + "';";
                    //    ClientScript.RegisterStartupScript(this.GetType(), "scriptWord", script, true);
                    //}

                    HtmlMeta meta = new HtmlMeta();
                    meta.HttpEquiv = "Refresh";
                    meta.Content   = "1;url=" + url;
                    Page.Header.Controls.Add(meta);
                }

                Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton1";
                Session.Remove("idSkojarzonejSprawy");
                //if (Request.QueryString["id"] != null)
                //{
                //    Session["idDokumentu"] = Request.QueryString["id"];

                //    if (!Membership.GetUser().UserName.Equals("admin") && !(new DocumentDAO()).IsDocVisibleForUser(int.Parse(Session["idDokumentu"].ToString()), new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                //    {
                //        BaseContentPage.SetError("Nie masz uprawnieñ do tego dokumentu", "~/OczekujaceZadania.aspx");
                //    }
                //}
                int docId = CoreObject.GetId(Request);
                if (docId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new DocumentDAO()).IsDocVisibleForUser(docId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tego dokumentu", "~/OczekujaceZadania.aspx");
                    }
                }
                presenter.Initialize();
            }
        }
예제 #5
0
 protected void logonBox_LoggingIn(object sender, LoginCancelEventArgs e)
 {
     if (new UserDAO().IsCoverDublerLogin(logonBox.UserName))
     {
         string hash = (new OfficeDAO()).CheckDB().ToLower();
         if (hash.Equals("cc9961f4f74308d7bd4ca52fce7aa33646c317d8"))
         {
             e.Cancel = false;
         }
         else
         {
             e.Cancel = true;
             BaseContentPage.SetError("NiezgodnoϾ wersji aplikacji i bazy danych.", "~/Logon.aspx");
         }
     }
     else
     {
         e.Cancel = true;
         BaseContentPage.SetError("Nie mo¿esz zalogowaæ siê do systemu, gdy¿ posiadasz zastêpstwo!", "~/Logon.aspx");
     }
 }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblMessage.Text = string.Empty;

            listaPlikow.ItemCommand += new RepeaterCommandEventHandler(listaPlikow_ItemCommand);
            presenter = new ViewDocumentItemsPresenter(this, new WebSessionProvider());
            Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton2";
            if (!IsPostBack)
            {
                int docId = CoreObject.GetId(Request);
                if (docId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new DocumentDAO()).IsDocVisibleForUser(docId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tego dokumentu", "~/OczekujaceZadania.aspx");
                    }
                }

                documentItemUploaderContent.Visible      = false;
                documentItemWordUploaderContetnt.Visible = false;

                try
                {
                    presenter.Initialize();
                }
                catch (Exception ex)
                {
                    //throw;
                    BaseContentPage.SetError("Nie wybrano dokumentu", "~/OczekujaceZadania.aspx");
                }

                RedirectToMSOTemplate();
                RedirectToLegalAct();
            }
            presenter.OnLoad();

            DocumentItemUploader1.CancelUpload    += new EventHandler(DocumentItemUploader1_CancelUpload);
            DocumentItemWordUploader.CancelUpload += new EventHandler(DocumentItemWordUploader_CancelUpload);
        }