Пример #1
0
        protected void lblCancel_Click(object sender, EventArgs e)
        {
            int regId = 0;

            if (String.IsNullOrEmpty(Page.Request["regId"].ToString()))
            {
                if (Session["fromDoc"] == null && Session["fromCase"] != null)
                {
                    Session["fromDoc"] = Session["fromCase"] = null;
                    Response.Redirect("~/Sprawy/Sprawa.aspx?id=" + CoreObject.GetId(Request).ToString()); // CHECK
                }
                if (Session["fromCase"] == null && Session["fromDoc"] != null)
                {
                    Response.Redirect("~/Dokumenty/Dokument.aspx?id=" + CoreObject.GetId(Request).ToString()); // CHECK
                    Session["fromDoc"] = Session["fromCase"] = null;
                }
                if (Session["fromDoc"] == null && Session["fromCase"] == null)
                {
                    Response.Redirect("~/OczekujaceZadania.aspx");
                }
            }
            else
            {
                if (int.TryParse(Page.Request["regId"].ToString(), out regId))
                {
                    Response.Redirect("~/Rejestry/ListaRejestrow.aspx?regid=" + regId);
                }
            }
        }
Пример #2
0
        protected void btnGenerate_click(object sender, EventArgs e)
        {
            int         docID   = CoreObject.GetId(Request);
            BarcodeData newData = GetBarcodeDataFromForm();

            newData.SentBy = Membership.GetUser().Comment;

            //documentID temporary in notes!
            newData.Notes = docID.ToString() + "|" + newData.Notes;

            XmlSerializer serializer = new XmlSerializer(typeof(BarcodeData));

            if (Button1.CommandName == "Cancel")
            {
                newData.SendDate = null;
            }
            using (Stream ms = new MemoryStream())
            {
                serializer.Serialize(ms, newData);
                ms.Seek(0, SeekOrigin.Begin);
                XmlReader          xr      = XmlReader.Create(ms);
                IDataMatrixService service = new DataMatrixService();

                new DocumentDAO().SetDataMatrix(docID, (Guid)Membership.GetUser().ProviderUserKey, xr);
                Response.Redirect(Request.Url.AbsoluteUri, true);
            }
        }
Пример #3
0
        protected void executeCommand(object sender, EventArgs e)
        {
            int caseId = CoreObject.GetId(Request);

            if (caseId <= 0)
            {
                BaseContentPage.SetError("Nie wybrano sprawy", "~/Oczekuj¹ceZadania.aspx");
                return;
            }

            //if(Session["idSprawy"]==null || !int.TryParse(Session["idSprawy"].ToString(),out caseId)){
            //  BaseContentPage.SetError("Nie wybrano sprawy","~/Oczekuj¹ceZadania.aspx");
            //  return;
            //}

            CaseDAO dao = new CaseDAO();

            dao.RedirectCase(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment,
                             txtNote.Text, int.Parse(wydzial.SelectedItem.Value), int.Parse(pracownik.SelectedItem.Value), wydzial.SelectedItem.Text, pracownik.SelectedItem.Text);
            if (IsCaseVisibleToUser(new Guid(Membership.GetUser().ProviderUserKey.ToString()), caseId))
            {
                Response.Redirect("~/Sprawy/HistoriaSprawy.aspx?id=" + caseId.ToString());
            }
            else
            {
                Response.Redirect("~/OczekujaceZadania.aspx");
            }
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int docId = CoreObject.GetId(Request);
         ViewState["docID"] = docId;
     }
 }
Пример #5
0
        protected void zapisz_Click(object sender, EventArgs e)
        {
            DocumentDAO dao = new DocumentDAO();
            FileStream  fs  = File.OpenRead(Pemi.Esoda.Tools.Configuration.PhysicalTemporaryDirectory + "\\" + temporaryFileName);

            if (forceUpdate.Visible && forceUpdate.Checked)
            {
                dao.AddNewVersionOfDocumentItem(IdDokumentu, IdOryginalu, fileDescription.Text, fs, mimeType.Text, fileName.Text, DocumentItemCategory.Uploaded);
                IdOryginalu = Guid.Empty;
            }
            else
            {
                Guid itemId = Guid.Empty;
                dao.AddNewDocumentItem(IdDokumentu, fileName.Text, fileDescription.Text, fs, mimeType.Text, ref itemId, DocumentItemCategory.Uploaded);
                //int docId = dao.AddNewDocument(new Guid(Membership.GetUser().ProviderUserKey.ToString()), md.GetXml());

                DocumentItemDTO docItem = dao.GetItem(itemId);
                string          imie = String.Empty, nazwisko = string.Empty;
                DbDataReader    dr = (DbDataReader)(new UserDAO()).GetEmployee(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
                if (dr.Read())
                {
                    imie     = dr["imie"].ToString();
                    nazwisko = dr["nazwisko"].ToString();
                }
                dr.Close();

                List <string> paramList = new List <string>();
                paramList.Add(fileName.Text);
                ActionLogger al = new ActionLogger(new ActionContext(new Guid("9cd585bb-2a06-4c24-b415-aa3f8b00ea5f"), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, paramList));

                al.AppliesToDocuments.Add(IdDokumentu);
                al.ActionData.Add("idDokumentu", IdDokumentu.ToString());
                al.ActionData.Add("idPracownika", Membership.GetUser().UserName);
                al.ActionData.Add("imie", imie);
                al.ActionData.Add("nazwisko", nazwisko);
                al.ActionData.Add("dataDodania", docItem.CreationDate.ToString());
                al.ActionData.Add("idPliku", docItem.ID.ToString());
                al.ActionData.Add("nazwaPliku", fileName.Text);

                /* Nr systemowy dokumentu logicznego
                 * Id pracownika (login) (który dokonuje operacji do³¹czenia)
                 * imie pracownika
                 * nazwisko pracownika,
                 * Data dolaczenia pliku
                 * Czas dolaczenia pliku
                 * Id systemowe (guid?) dolaczanego pliku
                 * Nazwa do³¹czanego pliku*/


                al.Execute();
            }
            fs.Close();
            DeleteTemporaryFile();

            Response.Redirect("~/Dokumenty/SkladnikiDokumentu.aspx?id=" + CoreObject.GetId(Request).ToString());
        }
Пример #6
0
        protected void wykonajAkcje(object sender, CommandEventArgs e)
        {
            int docId = CoreObject.GetId(Request);

            switch (e.CommandArgument.ToString())
            {
            case "450423F0-4819-4BE3-8BF4-E42C17815B59":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/PrzekierowanieDokumentu.aspx?id=" + docId.ToString(), false);
                break;

            case "1E476BE2-1FA1-46AF-A45C-A5C0F3882E8E":
                Session["szablon"]    = e.CommandName;
                Session["idAkcji"]    = e.CommandArgument.ToString();
                Session["nowaSprawa"] = false;
                Response.Redirect("~/Akcje/PrzypisanieDokumentuDoSprawy.aspx?id=" + docId.ToString(), false);
                break;

            case "363F872A-CC31-4FA7-8B30-C9917E185544":
                Session["szablon"]    = e.CommandName;
                Session["idAkcji"]    = e.CommandArgument.ToString();
                Session["nowaSprawa"] = true;
                Response.Redirect("~/Akcje/PrzypisanieDokumentuDoSprawy.aspx?id=" + docId.ToString(), false);
                break;

            case "10672122-E570-4A04-9D5D-A6667C27FE3D":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/DekretacjaDokumentuWielokrotna.aspx?id=" + docId.ToString(), false);
                break;

            case "5B1EDF0C-DE49-4D5C-A116-54A5E25C6FB8":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/EdycjaDokumentu.aspx?id=" + docId.ToString(), false);
                break;

            case "ED10E89A-365B-4034-9710-1E58BB93F5E9":
                Session["szablon"]   = e.CommandName;
                Session["idAkcji"]   = e.CommandArgument.ToString();
                Session["idObiektu"] = Session["idDokumentu"];
                Session["fromCase"]  = null;
                Session["fromDoc"]   = true;
                Response.Redirect("~/Akcje/SelectRegistry.aspx?id=" + docId.ToString(), false);
                break;

            case "ADBAD8B1-ABE0-41DA-8E17-32817C4FAE74":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/WykonanieCzynnosci.aspx?id=" + docId.ToString(), false);
                break;
            }
        }
Пример #7
0
 protected void anuluj_Click(object sender, EventArgs e)
 {
     if (Session["idAkcji"].ToString() == "2820653C-06BA-4704-AE1C-47D667E9F352")
     {
         Response.Redirect("~/sprawy/akcjeSprawy.aspx?id=" + CoreObject.GetId(Request), false);
     }
     if (Session["idAkcji"].ToString() == "ED10E89A-365B-4034-9710-1E58BB93F5E9")
     {
         Response.Redirect("~/dokumenty/akcjeDokumentu.aspx?id=" + CoreObject.GetId(Request), false);
     }
 }
Пример #8
0
        protected void zakonczAkcje(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                if (Page.IsValid)
                {
                    int     id  = -1;
                    CaseDAO dao = new CaseDAO();
                    id = int.Parse((frmSprawa.FindControl("hfCaseId") as HiddenField).Value);
                    string opis      = (frmSprawa.FindControl("txtOpis") as TextBox).Text;
                    string znakPisma = (frmSprawa.FindControl("txtZnakPisma") as TextBox).Text;

                    DateTime dataRozpoczecia;
                    if (!DateTime.TryParse((frmSprawa.FindControl("dataRozpoczecia") as TextBox).Text, out dataRozpoczecia))
                    {
                        dataRozpoczecia = DateTime.MinValue;
                    }

                    DateTime dataPisma;
                    if (!DateTime.TryParse((frmSprawa.FindControl("txtDataPisma") as TextBox).Text, out dataPisma))
                    {
                        dataPisma = DateTime.MinValue;
                    }

                    DateTime dataZakonczenia;
                    if (!DateTime.TryParse((frmSprawa.FindControl("dataZakonczenia") as TextBox).Text, out dataZakonczenia))
                    {
                        dataZakonczenia = DateTime.MinValue;
                    }

                    string uwagi = (frmSprawa.FindControl("txtUwagi") as TextBox).Text;

                    int status  = int.Parse((frmSprawa.FindControl("ddlStatus") as DropDownList).SelectedValue);
                    int nadawca = int.Parse((frmSprawa.FindControl("hfCustomerId") as HiddenField).Value);



                    List <string> parameters = new List <string>();
                    parameters.Add(Membership.GetUser().Comment);
                    ActionLogger al = new ActionLogger(new ActionContext(new Guid("05555FAA-A86A-40C1-9A69-6512276C7098"), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, parameters));
                    al.AppliesToCases.Add(id);
                    al.Execute();

                    dao.UpdateCase(id, opis, znakPisma, dataRozpoczecia, dataPisma, dataZakonczenia, uwagi, status, nadawca, -1, new Guid(Membership.GetUser().ProviderUserKey.ToString()));

                    Response.Redirect("~/Sprawy/AkcjeSprawy.aspx?id=" + id.ToString(), false);
                }
            }
            else if (e.CommandName == "Cancel")
            {
                Response.Redirect("~/Sprawy/AkcjeSprawy.aspx?id=" + CoreObject.GetId(Request));
            }
        }
Пример #9
0
        protected void saveClick(object sender, EventArgs e)
        {
            string[] parameters = { description.Text };

            ActionLogger al = new ActionLogger(new ActionContext(new Guid("ADBAD8B1-ABE0-41DA-8E17-32817C4FAE74"), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, parameters));

            al.AppliesToDocuments.Add((int)ViewState["docID"]);
            al.ActionData.Add("Opis", description.Text);

            al.Execute();

            Response.Redirect("~/Dokumenty/akcjeDokumentu.aspx?id=" + CoreObject.GetId(Request).ToString(), false);
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId > 0)
                {
                    CaseDAO cd = new CaseDAO();
                    frmSprawa.ChangeMode(FormViewMode.Edit);
                    XmlDataSource xds = new XmlDataSource();
                    using (XmlReader xr = cd.GetCase(caseId))
                    {
                        if (!xr.Read())
                        {
                            xds.Data = string.Empty;
                        }
                        else
                        {
                            xds.Data = xr.ReadOuterXml();
                        }
                    }
                    xds.EnableCaching = false;
                    if (xds.Data != "")
                    {
                        xds.XPath            = "/sprawa";
                        frmSprawa.DataSource = xds;
                    }
                    else
                    {
                        frmSprawa.DataSource = null;
                    }

                    frmSprawa.DataBind();
                }
            }

            if (customer != null)
            {
                customer.SearchCustomers     += new EventHandler <SearchCustomersEventArgs>(customersList.FindCustomers);
                customer.SearchCustomers     += new EventHandler <SearchCustomersEventArgs>(customer_SearchCustomers);
                customer.SearchListVisible   += new EventHandler <SearchCustomersEventArgs>(customersList.SearchListVisible);
                customer.OnCustomerAdded     += new EventHandler(customer_OnCustomerAdded);
                customersList.AddNewCustomer += new EventHandler(customer.AddNewCustomer);
                customersList.EditCustomer   += new EventHandler(customer.EditCustomer);
                customersList.SelectCustomer += new EventHandler(customer.SelectCustomer);
                customersList.SelectCustomer += new EventHandler(onSelectCustomer);
            }
            customersList.AdminMode = false;
            customersList.PageSize  = 5;
        }
Пример #11
0
        protected void anuluj_Click(object sender, EventArgs e)
        {
            int caseId = CoreObject.GetId(Request);

            //if (Session["idSprawy"] != null && int.TryParse(Session["idSprawy"].ToString(), out caseId))
            if (caseId > 0)
            {
                Response.Redirect("~/Sprawy/Sprawa.aspx?id=" + caseId.ToString(), false);
            }
            else
            {
                Response.Redirect("~/OczekujaceZadania.aspx", false);
            }
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId == 0)
                {
                    wyslij.Enabled = false;
                    return;
                }

                SMSData data = new CaseDAO().GetSMSDataForCase(caseId);
                txtNumerSMS.Text = data.PhoneNumber;
                txtMessage.Text  = data.Message;
            }
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton4";
            if (CoreObject.GetId(Request) <= 0)
            {
                BaseContentPage.SetError("Sprawa o podanym numerze nie istnieje", "~/Akta/AktaSpraw.aspx");
            }
            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new CaseDAO()).IsCaseVisibleForUser(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tej sprawy", "~/OczekujaceZadania.aspx");
                    }
                }
                ActionDAO dao     = new ActionDAO();
                string    xmlData = string.Empty;
                try
                {
                    //using (XmlReader xr = dao.GetAvailableActions(int.Parse(Session["idSprawy"].ToString()), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case,ActionType.CalledFromList))
                    using (XmlReader xr = dao.GetAvailableActions(CoreObject.GetId(Request), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case, ActionType.CalledFromList))
                    {
                        if (xr.Read())
                        {
                            xmlData = xr.ReadOuterXml();
                        }
                    }

                    XmlDataSource xds = new XmlDataSource();
                    xds.Data          = xmlData;
                    xds.EnableCaching = false;
                    lista.DataSource  = null;
                    if (xds.Data != "")
                    {
                        xds.XPath        = "/akcje/akcja";
                        lista.DataSource = xds;
                    }
                    lista.DataBind();
                }
                catch //(Exception ex)
                {
                    BaseContentPage.SetError("Nie uda³o siê odnaleŸæ sprawy", "~/Akta/AktaSpraw.aspx");
                }
            }
        }
Пример #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ViewCaseDocumentsPresenter presenter = new ViewCaseDocumentsPresenter(this, new WebSessionProvider());

            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new CaseDAO()).IsCaseVisibleForUser(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tej sprawy", "~/OczekujaceZadania.aspx");
                    }
                }
                presenter.Initialize();
            }
        }
Пример #15
0
        protected void lnkGetAsPdf_click(object sender, EventArgs e)
        {
            BarcodeData        data    = GetBarcodeDataFromForm();
            IDataMatrixService service = new DataMatrixService();

            string[] address = new string[3];
            address[0] = txtName.Text;
            address[1] = txtAddress.Text;
            address[2] = txtPost.Text;

            byte[] content = service.GetDataMatrixWithAddressAsPdf(data, address);
            if (content.Length == 0)
            {
                return;
            }
            Transmit(content, "doc_" + CoreObject.GetId(Request).ToString() + "_DataMatrix.pdf");
        }
Пример #16
0
        protected void wyslij_click(object sender, EventArgs e)
        {
            int caseId = CoreObject.GetId(Request);

            bool wasSent = SendSMS(txtNumerSMS.Text, txtMessage.Text);

            List <string> parameters = new List <string>();

            parameters.Add(wasSent ? "Udane" : "Nieudane");
            parameters.Add(txtNumerSMS.Text);
            parameters.Add(txtMessage.Text);
            ActionLogger al = new ActionLogger(new ActionContext(new Guid("1F00EEAE-D0DB-4267-A62A-07A95FDF8E25"), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, parameters));

            al.AppliesToCases.Add(caseId);
            al.Execute();

            Response.Redirect("~/Sprawy/HistoriaSprawy.aspx?id=" + caseId.ToString(), false);
        }
Пример #17
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();
            }
        }
Пример #18
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();
            }
        }
Пример #19
0
        protected void wykonajAkcje(object sender, CommandEventArgs e)
        {
            int caseId = CoreObject.GetId(Request);

            switch (e.CommandArgument.ToString())
            {
            case "E2E8D217-1E83-4F5B-BA3A-31412D771BF1":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/NowyDokumentLogiczny.aspx", false);
                break;

            case "05555FAA-A86A-40C1-9A69-6512276C7098":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/EdycjaSprawy.aspx?id=" + caseId.ToString(), false);
                break;

            case "1F00EEAE-D0DB-4267-A62A-07A95FDF8E25":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/PowiadomienieSMS.aspx?id=" + caseId.ToString(), false);
                break;

            case "386D76E7-FAA0-4264-A722-BFB60ACCBD46":
                Session["szablon"] = e.CommandName;
                Session["idAkcji"] = e.CommandArgument.ToString();
                Response.Redirect("~/Akcje/PrzekazanieSprawy.aspx?id=" + caseId.ToString(), false);
                break;

            case "2820653C-06BA-4704-AE1C-47D667E9F352":
                Session["szablon"]   = e.CommandName;
                Session["idAkcji"]   = e.CommandArgument.ToString();
                Session["idObiektu"] = Session["idSprawy"];     // TODO
                Session["fromCase"]  = true;
                Session["fromDoc"]   = null;
                Response.Redirect("~/Akcje/SelectRegistry.aspx?id=" + caseId.ToString(), false);
                break;

            case "AD9DEECC-96A0-4478-9891-90B1E96085E6":
                Response.Redirect("~/Akcje/NowyDokumentLogiczny.aspx?idSprawy=" + caseId.ToString(), false);
                break;
            }
        }
Пример #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton5";
            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");
                    }
                }

                DocumentDAO dao = new DocumentDAO();
                rejestry.DataSource = dao.GetDocumentRegistryItems(CoreObject.GetId(Request));
                rejestry.DataBind();
            }
        }
Пример #21
0
        protected void potwierdzZapoznanie(object sender, CommandEventArgs e)
        {
            int docId = CoreObject.GetId(Request);

            if (new DocumentDAO().ConfirmReading(docId))
            {
                List <string> parameters = new List <string>();
                parameters.Add(docId.ToString());
                ActionLogger al = new ActionLogger(new ActionContext(new Guid("4453A151-F6EF-40C7-9056-F8D62F2E53D8"), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, parameters));
                al.AppliesToDocuments.Add(docId);
                al.Execute();
                Response.Redirect(e.CommandArgument.ToString());
            }
            else
            {
                Session["errorMessage"] = "Nie uda³o siê potwierdziæ zapoznania siê z dokumentem.";
                Session["returnUrl"]    = Request.Url.ToString();
                Response.Redirect("~/shared/error2.aspx");
            }
        }
Пример #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //if (Session["idDokumentu"] != null)
                //{
                //    int docId;
                //    if (!int.TryParse(Session["idDokumentu"].ToString(), out docId))
                //    {
                //        BaseContentPage.SetError("nie wybrano dokumentu do edycji", "~/oczekujaceZadania.aspx");
                //        return;
                //    }
                //    loadDocumentData(docId);
                //}
                int docId = CoreObject.GetId(Request);
                if (docId > 0)
                {
                    loadDocumentData(docId);
                    DisableCategoryAndType(docId);
                }
                else
                {
                    BaseContentPage.SetError("nie wybrano dokumentu do edycji", "~/oczekujaceZadania.aspx");
                    return;
                }
            }

            if (customer != null)
            {
                customer.SearchCustomers     += new EventHandler <SearchCustomersEventArgs>(customersList.FindCustomers);
                customer.SearchCustomers     += new EventHandler <SearchCustomersEventArgs>(customer_SearchCustomers);
                customer.SearchListVisible   += new EventHandler <SearchCustomersEventArgs>(customersList.SearchListVisible);
                customer.OnCustomerAdded     += new EventHandler(customer_OnCustomerAdded);
                customersList.AddNewCustomer += new EventHandler(customer.AddNewCustomer);
                customersList.EditCustomer   += new EventHandler(customer.EditCustomer);
                customersList.SelectCustomer += new EventHandler(customer.SelectCustomer);
                customersList.SelectCustomer += new EventHandler(onSelectCustomer);
            }
            customersList.AdminMode = false;
            customersList.PageSize  = 5;
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //    currentItem = currentItem;
            //else
            //    currentItem = lnkCaseDetails.ID;

            // ustawienie id obiektu dla linków
            int caseId = CoreObject.GetId(Request);

            lnkCaseDetails.CommandArgument   = "~/Sprawy/Sprawa.aspx?id=" + caseId.ToString();
            lnkCaseDocuments.CommandArgument = "~/Sprawy/DokumentySprawy.aspx?id=" + caseId.ToString();
            lnkCaseHistory.CommandArgument   = "~/Sprawy/HistoriaSprawy.aspx?id=" + caseId.ToString();
            lnkCaseActions.CommandArgument   = "~/Sprawy/AkcjeSprawy.aspx?id=" + caseId.ToString();
            lnkCaseRegistry.CommandArgument  = "~/Sprawy/RejestrySprawy.aspx?id=" + caseId.ToString();
            lnkCaseMetrics.NavigateUrl       = "~/Aplikacje/Raporty/MetrykaSprawy.aspx?id=" + caseId.ToString();

            string currentOption = Request.Url.AbsoluteUri.Substring(Request.Url.AbsoluteUri.LastIndexOf('/') + 1);

            currentOption = currentOption.Substring(0, currentOption.LastIndexOf('.'));

            switch (currentOption.ToLower())
            {
            case "sprawa": currentItem = lnkCaseDetails.ID; break;

            case "dokumentysprawy": currentItem = lnkCaseDocuments.ID; break;

            case "historiasprawy": currentItem = lnkCaseHistory.ID; break;

            case "akcjesprawy": currentItem = lnkCaseActions.ID; break;

            case "rejestrysprawy": currentItem = lnkCaseRegistry.ID; break;

            default: currentItem = lnkCaseDetails.ID; break;
            }

            if (Request.Url.AbsoluteUri.Contains("/Akcje/"))
            {
                currentItem = lnkCaseActions.ID;
            }
        }
Пример #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new CaseDAO()).IsCaseVisibleForUser(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnień do tej sprawy", "~/OczekujaceZadania.aspx");
                    }
                }

                if (caseId <= 0)
                {
                    BaseContentPage.SetError("Nie ma takiej sprawy", "~/OczekujaceZadania.aspx");
                }
                CaseDAO cd = new CaseDAO();
                rejestry.DataSource = cd.GetCaseRegistryItems(caseId);
                rejestry.DataBind();
            }
        }
Пример #25
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);
        }
Пример #26
0
        private void generateFields()
        {
            string xmlItem = string.Empty;
            string objectType;
            int    objectID;

            Dictionary <string, string> values = new Dictionary <string, string>();

            if (Session["registryDefinition"] == null)
            {
                return;
            }
            int idPozycji = 0;

            if (Request.QueryString["itemId"] != null && int.TryParse(Request.QueryString["itemId"].ToString(), out idPozycji))
            {
                xmlItem = new RegistryDAO().GetRegistryItem(idPozycji);
                new RegistryDAO().GetObjectIDRegistry(idPozycji, out objectType, out objectID);

                switch (objectType)
                {
                case "DOC":
                    ObjectDetailsViewC.DocumentID = objectID;
                    ObjectType = "dokumentu";
                    ScanPreviewControl1.DocumentID = objectID;
                    break;

                case "CASE":
                    ObjectDetailsViewC.CaseID = objectID;
                    ObjectType = "sprawy";
                    break;
                }

                if (!string.IsNullOrEmpty(xmlItem))
                {
                    XPathDocument     xmld = new XPathDocument(new StringReader(xmlItem));
                    XPathNavigator    xmln = xmld.CreateNavigator();
                    XPathNodeIterator xmli = xmln.Select("/wpis//*");

                    while (xmli.MoveNext())
                    {
                        values.Add(xmli.Current.Name, xmli.Current.Value);
                    }
                }
            }
            else
            {
                int regID = 0;

                int.TryParse(Request["regid"].ToString(), out regID);

                RegistryDAO dao = new RegistryDAO();

                objectType = dao.GetRegistryType(regID);
                objectID   = CoreObject.GetId(Request);

                switch (objectType)
                {
                case "DOC":
                    ObjectDetailsViewC.DocumentID = objectID;
                    ObjectType = "dokumentu";
                    ScanPreviewControl1.DocumentID = objectID;
                    break;

                case "CASE":
                    ObjectDetailsViewC.CaseID = objectID;
                    ObjectType = "sprawy";
                    break;
                }
            }
            XPathDocument     xpd  = new XPathDocument(new StringReader(Session["registryDefinition"].ToString()));
            XPathNavigator    xpn  = xpd.CreateNavigator();
            XPathNodeIterator xpni = xpn.Select("//pole");

            while (xpni.MoveNext())
            {
                bool isHeader = xpni.Current.SelectDescendants("pole", "", false).Count > 0;
                int  level    = xpni.Current.SelectAncestors("pole", "", false).Count + 1;
                if (isHeader)
                {
                    level -= 1;
                }
                if (level < 0)
                {
                    level = 0;
                }
                string name  = xpni.Current.SelectSingleNode("@nazwa").Value;
                string label = xpni.Current.SelectSingleNode("@etykieta").Value;


                if (isHeader)
                {
                    fieldContainer.Controls.Add(RegistryHelper.CreateField(isHeader, "0", level, name, label, null, false, null));
                }
                else
                {
                    string dataType = xpni.Current.SelectSingleNode("@typ").Value;
                    bool   required = xpni.Current.SelectSingleNode("@wymagane").Value == "1" ? true : false;
                    string position = xpni.CurrentPosition.ToString();

                    fieldContainer.Controls.Add(RegistryHelper.CreateField(isHeader, position, level, name, label, dataType, required, values.Count > 0?values[name]:null));
                }
            }
        }
Пример #27
0
 protected void listaPlikow_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "openWord")
     {
         Response.Redirect(String.Format("~/Dokumenty/SkladnikiDokumentu.aspx?id={0}&itemGUID={1}&mode={2}", CoreObject.GetId(Request), e.CommandArgument.ToString(), "e"));//e - przy edycji
     }
     else if (e.CommandName == "newVersion")
     {
         documentItemUploaderContent.Visible            = true;
         DocumentItemUploader1.IdOryginalu              = new Guid(e.CommandArgument.ToString());
         (e.Item.FindControl("blok") as Panel).CssClass = "currentItem opcjePodgladuPliku";
         wyczyscZaznaczenie(e.Item);
     }
     else
     if (e.CommandName == "toggleVersions")
     {
         e.Item.FindControl("wersje").Visible = !(e.Item.FindControl("wersje").Visible);
     }
     else
     {
         OnObslugaPolecen(new ExecutingCommandEventArgs(e.CommandName, e.CommandArgument));
     }
 }
Пример #28
0
        protected void saveItem(object sender, EventArgs e)
        {
            if (Session["registryDefinition"] == null)
            {
                return;
            }
            XPathDocument     xpd  = new XPathDocument(new StringReader(Session["registryDefinition"].ToString()));
            XPathNavigator    xpn  = xpd.CreateNavigator();
            XPathNodeIterator xpni = xpn.Select("//pole[not(*)]");
            //int i = 1;

            List <string> values = new List <string>();

            foreach (Control c in fieldContainer.Controls)
            {
                if (c is Panel)
                {
                    foreach (Control c2 in c.Controls)
                    {
                        if (c2 is TextBox)
                        {
                            TextBox tb = c2 as TextBox;
                            values.Add(tb.Text);

                            break;
                        }
                    }
                }
            }

            int objectId = 0;

            //if (Session["idObiektu"] == null || !int.TryParse(Session["idObiektu"].ToString(), out objectId))



            if (Request.QueryString["itemId"] != null)
            {
                int.TryParse(Request.QueryString["itemId"].ToString(), out objectId);
            }
            else
            {
                if (CoreObject.GetId(Request) <= 0)
                {
                    BaseContentPage.SetError("Nie udało się zapisać pozycji rejestru - brak skojarzonego dokumentu lub sprawy", "~/OczekujaceZadania.aspx");
                }
                objectId = CoreObject.GetId(Request);
            }

            int registryId = 0;
            int itemID     = 0;

            if (Request["itemId"] != null && int.TryParse(Request["itemId"].ToString(), out itemID))
            {
                registryId         = new RegistryDAO().GetRegistryIDByItem(itemID);
                Session["idAkcji"] = "ED10E89A-365B-4034-9710-1E58BB93F5E9";
            }

            if (registryId == 0 && (Request["regid"] == null || !int.TryParse(Request["regid"].ToString(), out registryId)))
            {
                BaseContentPage.SetError("Nie udało się zapisać pozycji rejestru - brak wybranego rejestru", "~/OczekujaceZadania.aspx");
            }

            string itemContent = RegistryHelper.CreateRegistryItem(Session["registryDefinition"].ToString(), values);
            int    pozId       = (new RegistryDAO()).SaveRegistryItem((Guid)Membership.GetUser().ProviderUserKey, registryId, objectId, itemContent, itemID == 0);

            List <string> parameters = new List <string>();

            using (DbDataReader dr = (DbDataReader)(new RegistryDAO()).GetRegistry(registryId))
            {
                if (dr.Read())
                {
                    parameters.Add(dr["nazwa"].ToString());
                    parameters.Add(objectId.ToString());
                    ActionLogger al = new ActionLogger(new ActionContext(new Guid(Session["idAkcji"].ToString()), new Guid(Membership.GetUser().ProviderUserKey.ToString()), Membership.GetUser().UserName, Membership.GetUser().Comment, parameters));
                    if (dr["wpisy"].ToString().Contains("doc"))
                    {
                        al.AppliesToDocuments.Add(objectId);
                    }
                    else
                    {
                        al.AppliesToCases.Add(objectId);
                    }

                    if (Request.QueryString["itemId"] != null)
                    {
                        al.ActionData.Add("WykonanaAkcja", "Edycja wpisu do rejestru");
                    }
                    else
                    {
                        al.ActionData.Add("WykonanaAkcja", "Dodanie wpisu do rejestru");
                    }
                    al.ActionData.Add("Data", DateTime.Now.ToString());
                    al.ActionData.Add("Nazwa", "Wpis do rejestru " + dr["nazwa"].ToString());
                    al.ActionData.Add("Uzytkownik", Membership.GetUser().UserName);
                    al.ActionData.Add("NazwaRejestru", dr["nazwa"].ToString());
                    al.ActionData.Add("NrPozycjiWRejestrze", pozId.ToString());
                    al.ActionData.Add("TypWpisu", (dr["wpisy"].ToString().Contains("doc")) ? "dokument" : "sprawa");
                    al.Execute();
                }
            }

            Response.Redirect("~/Rejestry/ListaRejestrow.aspx?regid=" + registryId.ToString());
        }
Пример #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["idSkojarzonejSprawy"] != null)
            {
                lnkDocCase.Enabled = true;
            }

            // przypisanie ID w nawigacji
            int docId = CoreObject.GetId(Request);

            // ukrycie/pokazanie linka formularz
            DocumentDAO dao = new DocumentDAO();

            lnkCustomForm.Visible     = dao.IsCustomFormVisible(docId);
            lnkLegalAct.Visible       = dao.CanCreateLegalAct(docId);
            lnkDocConfirmRead.Visible = dao.IsConfirmationNeeded(docId);

            lnkCustomForm.CommandArgument    = "~/Dokumenty/FormularzWidokGlowny.aspx?id=" + docId.ToString();
            lnkDocDetails.CommandArgument    = "~/Dokumenty/Dokument.aspx?id=" + docId.ToString();
            lnkDocInnerItems.CommandArgument = "~/Dokumenty/SkladnikiDokumentu.aspx?id=" + docId.ToString();
            lnkDocHistory.CommandArgument    = "~/Dokumenty/HistoriaDokumentu.aspx?id=" + docId.ToString();
            lnkDocActions.CommandArgument    = "~/Dokumenty/AkcjeDokumentu.aspx?id=" + docId.ToString();
            lnkDocRegisters.CommandArgument  = "~/Dokumenty/RejestryDokumentu.aspx?id=" + docId.ToString();
            lnkDocCodes.CommandArgument      = "~/Dokumenty/KodyDokumentu.aspx?id=" + docId.ToString();
            lnkLegalAct.CommandArgument      = "~/Dokumenty/AktyPrawne.aspx?id=" + docId.ToString();
            //lnkDocCase" Text="sprawa" onCommand="przejdzDoSprawy" Enabled="false"  /></li>

            string currentOption = Request.Url.AbsoluteUri.Substring(Request.Url.AbsoluteUri.LastIndexOf('/') + 1);

            currentOption = currentOption.Substring(0, currentOption.LastIndexOf('.'));

            switch (currentOption.ToLower())
            {
            case "formularzwidokglowny": currentItem = lnkCustomForm.ID; break;

            case "formularzxml": currentItem = lnkCustomForm.ID; break;

            case "formularzhistoria": currentItem = lnkCustomForm.ID; break;

            case "formularz": currentItem = lnkCustomForm.ID; break;

            case "formularzdoc": currentItem = lnkCustomForm.ID; break;

            case "skladnikdoc": currentItem = lnkDocInnerItems.ID; break;

            case "dokument": currentItem = lnkDocDetails.ID; break;

            case "skladnikidokumentu": currentItem = lnkDocInnerItems.ID; break;

            case "historiadokumentu": currentItem = lnkDocHistory.ID; break;

            case "akcjedokumentu": currentItem = lnkDocActions.ID; break;

            case "kodydokumentu":
                currentItem = lnkDocCodes.ID;
                break;

            case "rejestrydokumentu":
                currentItem = lnkDocRegisters.ID;
                break;

            case "aktyprawne": currentItem = lnkLegalAct.ID; break;

            default: currentItem = lnkDocDetails.ID; break;
            }

            if (Request.Url.AbsoluteUri.Contains("/Akcje/"))
            {
                currentItem = lnkDocActions.ID;
            }
        }
Пример #30
0
 protected void cancelClick(object sender, EventArgs e)
 {
     Response.Redirect("~/Dokumenty/akcjeDokumentu.aspx?id=" + CoreObject.GetId(Request).ToString(), false);
 }