public void OnViewLoaded()
        {
            actionID = session["idAkcji"] != null ? session["idAkcji"].ToString() : null;

            //if (session["idDokumentu"] != null)
            if (view.DocumentId > 0 && !string.IsNullOrEmpty(actionID))
            {
                documentID = view.DocumentId; // int.Parse(session["idDokumentu"].ToString());

                IRedirectDocumentTask srv = new RedirectDocumentTask();
                //dd = srv.GetDokumentDetails(int.Parse(session["idDokumentu"].ToString()));
                dd               = srv.GetDocumentDetails(documentID);
                view.Notice      = dd.Notice;
                view.Description = dd.Description;

                if (dd.IsCopy)
                {
                    view.WorkOnPaperEnable = false;
                }

                //dokument (papierowy lub kopia) nie wychodzi ze sprawy
                if (dd.IsInCase)
                {
                    view.WorkOnPaperEnable = false;
                }

                if (session["RedirectListItem"] != null)
                {
                    itemList = (List <RedirectItem>)session["RedirectListItem"];
                }
            }
            else
            {
                view.ReturnTo = "~/Logon.aspx";
            }

            //isCopy = srv.IsCopy();

            //if (isCopy)
            //{
            //    view.WorkOnPaperEnable = false;
            //}
        }
예제 #2
0
        public DokumentDetails GetDocumentDetails(int docId)
        {
            Database db = DatabaseFactory.CreateDatabase();

            if (db == null)
            {
                throw new Exception("Couldn't connect to database");
            }

            DokumentDetails dd = null;

            DbCommand cmd = db.GetStoredProcCommand("Dokumenty.pobierzDodatkoweDane", docId);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                if (dr.Read())
                {
                    dd = new DokumentDetails(bool.Parse(dr["isCopy"].ToString()), dr["description"].ToString(), dr["notice"].ToString(), bool.Parse(dr["isInCase"].ToString()));
                }
            }

            return(dd);
        }