protected void OnExecuteCommand(ExecutingCommandEventArgs e)
 {
     if (ExecuteCommand != null)
     {
         ExecuteCommand(this, e);
     }
 }
示例#2
0
        void view_ExecutingCommand(object sender, ExecutingCommandEventArgs e)
        {
            if (e.CommandName.ToLower() == "dokument" || e.CommandName.ToLower() == "sprawa" || e.CommandName.ToLower() == "faktura")
            {
                /*XPathDocument xpd = new XPathDocument(new StringReader(assignedItems));
                 * XPathNavigator xpn = xpd.CreateNavigator();
                 * XPathNodeIterator xpni = xpn.Select(string.Format("/zadania/zadanie[id='{0}']", e.CommandArgument));
                 * if (xpni.MoveNext())
                 *  session["context"] = xpni.Current.OuterXml;*/
                if (e.CommandName.ToLower() == "dokument" || e.CommandName.ToLower() == "faktura")
                {
                    session.Remove("idSprawy");
                    //session["idDokumentu"] = e.CommandArgument.ToString();
                }
                if (e.CommandName.ToLower() == "sprawa")
                {
                    session.Remove("idDokumentu");
                    //session["idSprawy"] = e.CommandArgument.ToString();
                }
                string cmdName = e.CommandName;
                if (e.CommandName.ToLower() == "faktura")
                {
                    cmdName = "Dokument";
                }

                view.TargetView = string.Format("{1}/{0}.aspx?id={2}", cmdName, cmdName == "Sprawa" ? "Sprawy" : "Dokumenty", e.CommandArgument.ToString());
            }
            if (e.CommandName.ToLower() == "dokument_s")
            {
                view.TargetView = string.Format("{1}/{0}.aspx?id={2}", "SkladnikiDokumentu", "Dokumenty", e.CommandArgument.ToString());
            }
        }
示例#3
0
        void ExecuteItemCommand(object sender, ExecutingCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "edytuj":
                view.IsInEditState = true;
                getItemData();
                getDictionaries(true);
                break;

            case "anuluj":
                view.IsInPreviewState = true;
                getItemData();
                break;

            //case "zapisz":
            //  SaveItem();
            //  view.IsInPreviewState = true;
            //  getItemData();
            //  break;
            case "nowyInteresant":
                //	getItemData();
                //	getDictionaries(false);
                view.IsInCustomerInsertState = true;
                break;

            //case "zapiszNowegoInteresanta":
            //  //zapiszNowegoInteresanta();
            //  view.IsInEditState = true;
            //  getItemData();
            //  break;
            //case "listaInteresantow":
            //  view.IsInInsertState = true;
            //  getItemData();
            //  getDictionaries(false);
            //  break;
            case "zapiszZmianyInteresanta":
                //zapis
                view.IsInInsertState = true;
                getItemData();
                //	getDictionaries(false);
                break;

            case "ustawSlownik":
                if (e.CommandArgument.ToString() == "customer")
                {
                    view.Customers = service.GetCustomers(view.CustomerType);
                }
                if (e.CommandArgument.ToString() == "employee")
                {
                    view.Employees = service.GetEmployees(view.OrganizationalUnitId);
                }
                if (e.CommandArgument.ToString() == "documentTypes")
                {
                    view.DocumentTypes = service.GetDocumentTypes(view.DocumentCategory);
                }
                break;
            }
        }
示例#4
0
        private void commandExecuting(object sender, ExecutingCommandEventArgs e)
        {
            bool ok = true;

            if (ok)
            {
                OnExecuteCommand(e);
            }
        }
        void view_ViewDetails(object sender, ExecutingCommandEventArgs e)
        {
            if (e.CommandName == "dokument")
            {
                //session["idDokumentu"] = int.Parse(e.CommandArgument.ToString());
                view.NextView = "~/Dokumenty/Dokument.aspx?id=" + e.CommandArgument.ToString();
            }

            if (e.CommandName == "usunZeSprawy")
            {
                session["docToRemoveFromCase"] = e.CommandArgument;
                session["caseToRemoveFrom"]    = CaseId;
                view.NextView = "~/Akcje/UsuniecieDokumentuZeSprawy.aspx";
            }
        }
 void view_CommandExecuting(object sender, ExecutingCommandEventArgs e)
 {
     OnExecuteCommand(e);
 }
示例#7
0
        void view_ExecutingCommand(object sender, ExecutingCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "openFile":
                currentPicture       = new ImageHelper(new Guid(e.CommandArgument.ToString()));
                view.previewImageUrl = currentPicture.UrlObrazka;
                view.CurrentPage     = currentPicture.AktualnaStrona;
                view.CurrentScale    = currentPicture.Skala;                      // < 50) ? 50 : currentPicture.Skala;
                view.PageCount       = currentPicture.LiczbaStron;
                scanID            = e.CommandArgument.ToString();
                view.IsInListMode = false;
                view_ExecutingCommand(null, new ExecutingCommandEventArgs("scale", "width"));
                break;

            case "saveFile":
                break;

            case "changePageOrScale":

                int nrStrony = view.CurrentPage;

                if (nrStrony > 0 && nrStrony <= currentPicture.LiczbaStron && nrStrony != currentPicture.AktualnaStrona)
                {
                    currentPicture.AktualnaStrona = nrStrony;
                    view.CurrentPage     = currentPicture.AktualnaStrona;
                    view.previewImageUrl = currentPicture.UrlObrazka;
                }

                int skala = view.CurrentScale;

                if (skala > 0 && skala <= 100 && skala != currentPicture.Skala)
                {
                    currentPicture.Skala = skala;
                    view.CurrentScale    = currentPicture.Skala;
                    view.previewImageUrl = currentPicture.UrlObrazka;
                }
                break;

                #region nawigacja
            case "nav":
                if (currentPicture != null)
                {
                    switch (e.CommandArgument.ToString())
                    {
                    case "previous":
                        currentPicture.AktualnaStrona--;
                        view.CurrentPage     = currentPicture.AktualnaStrona;
                        view.previewImageUrl = currentPicture.UrlObrazka;
                        break;

                    case "next":
                        currentPicture.AktualnaStrona++;
                        view.CurrentPage     = currentPicture.AktualnaStrona;
                        view.previewImageUrl = currentPicture.UrlObrazka;
                        break;

                    case "first":
                        currentPicture.AktualnaStrona = 1;
                        view.CurrentPage     = currentPicture.AktualnaStrona;
                        view.previewImageUrl = currentPicture.UrlObrazka;
                        break;

                    case "last":
                        currentPicture.AktualnaStrona = currentPicture.LiczbaStron;
                        view.CurrentPage     = currentPicture.AktualnaStrona;
                        view.previewImageUrl = currentPicture.UrlObrazka;
                        break;
                    }
                }
                break;

                #endregion
                #region obracanie
            case "rotate":
                switch (e.CommandArgument.ToString())
                {
                case "0":
                    currentPicture.Orientacja = OrientacjaObrazka.Oryginalna;
                    view.previewImageUrl      = currentPicture.UrlObrazka;
                    break;

                case "r90":
                    currentPicture.Orientacja = OrientacjaObrazka.ObrotPrawo90;
                    view.previewImageUrl      = currentPicture.UrlObrazka;
                    break;

                case "l90":
                    currentPicture.Orientacja = OrientacjaObrazka.ObrotLewo90;
                    view.previewImageUrl      = currentPicture.UrlObrazka;
                    break;

                case "180":
                    currentPicture.Orientacja = OrientacjaObrazka.Obrot180;
                    view.previewImageUrl      = currentPicture.UrlObrazka;
                    break;
                }
                break;

                #endregion
                #region skalowanie
            case "scale":
                switch (e.CommandArgument.ToString())
                {
                case "zoomin":
                    currentPicture.Skala += 10;
                    view.previewImageUrl  = currentPicture.UrlObrazka;
                    view.CurrentScale     = currentPicture.Skala;
                    break;

                case "zoomout":
                    currentPicture.Skala -= 10;
                    view.previewImageUrl  = currentPicture.UrlObrazka;
                    view.CurrentScale     = currentPicture.Skala;
                    break;

                case "width":
                    currentPicture.AktualnaSzerokosc = 720;
                    view.previewImageUrl             = currentPicture.UrlObrazka;
                    view.CurrentScale = currentPicture.Skala;
                    break;

                case "height":
                    currentPicture.AktualnaWysokosc = 500;
                    view.previewImageUrl            = currentPicture.UrlObrazka;
                    view.CurrentScale = currentPicture.Skala;
                    break;
                }
                break;

                #endregion
                #region pozostale
            case "other":
                switch (e.CommandArgument.ToString())
                {
                case "reset":
                    view_ExecutingCommand(null, new ExecutingCommandEventArgs("openFile", scanID)); return;

                case "saveActual":
                    //	Server.Transfer("download.aspx?id=" + pozycjaZalacznika + "&amp;tmp=1");
                    break;

                case "saveOriginal":
                    //	Server.Transfer("download.aspx?id=" + pozycjaZalacznika);
                    break;
                }
                break;
                #endregion
            }
        }