protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     foreach (Control control in Controls)
     {
         if (regForm == null)
         {
             regForm = control as HtmlForm;
             if (regForm != null) break;
         }
     }
     if (regForm == null)
     {
         throw new ArgumentException("登录页面中至少添加一个服务器端表单");
     }
     window = new Window();
     window.Title = "管理员注册";
     window.Closable = false;
     window.Icon = Icon.Key;
     window.Width = 320;
     window.Height = 185;
     formPanel = new FormPanel();
     formPanel.BodyStyle = "padding:20px;";
     formPanel.Layout = "table";
     formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "用户名",
         AllowBlank = false,
         ColSpan = 2,
         Name = "Username"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "密码",
         AllowBlank = false,
         ColSpan = 2,
         InputType = Ext.Net.InputType.Password,
         Name = "Password"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "确认密码",
         AllowBlank = false,
         ColSpan = 1,
         InputType = Ext.Net.InputType.Password,
         Name = "Password2"
     });
     window.Items.Add(formPanel);
     regForm.Controls.Add(window);
     btnReg = new KeyAddButton();
     btnReg.Text = "注册";
     btnReg.ID = "btnReg";
     btnReg.OnClientClick = "App.direct.Reg({eventMask:{showMask:true,msg:'正在注册'}});";
     window.Buttons.Add(btnReg);
 }
Beispiel #2
0
        protected void viewTuongItem_Click(object sender, Ex.DirectEventArgs e)
        {
            if (sender is Ex.DataView)
            {
                string           selectedID = (sender as Ex.DataView).SelectedRecordID;
                DB.DBDataContext db         = new DB.DBDataContext();
                var off = (from t
                           in db.M_Tuongs
                           where t.Pid.ToString() == selectedID
                           select t).FirstOrDefault();

                Ex.Window win = new Ex.Window
                {
                    ID     = "wShowDetail" + off.MaTuong,
                    Title  = off.TenTuong,
                    Height = 353,
                    Width  = 493,
                    //BodyPadding = 5,
                    Resizable   = false,
                    Modal       = false,
                    CloseAction = Ex.CloseAction.Destroy,
                    Html        = "<img src='?big=true&tuong=" + off.MaTuong + "'>"
                };

                win.Render(this.Form);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 初始化查询 明细列表
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="model"></param>
        public void IniSelectDetailWindow(Ext.Net.Window win)
        {
            int n = uiHelper.Select.DetailGrid.Width;

            win.Width  = n > 0 ? n : 420;
            n          = uiHelper.Select.DetailGrid.Height;
            win.Height = n > 0 ? n : 300;
            win.Title  = uiHelper.WebPage.Title + "--明细信息";
        }
Beispiel #4
0
        protected void BieuBaoCao_DBClick(object sender, DirectEventArgs e)
        {
            string json = e.ExtraParams["Values"];

            if (json == "")
            {
                return;
            }
            Dictionary <string, string>[] companies = JSON.Deserialize <Dictionary <string, string>[]>(json);
            string _MaBC = "";
            string _Thang = "1", _Nam = "0", _IDMauBieu = "0";

            foreach (Dictionary <string, string> row in companies)
            {
                _MaBC = row["MaBaoCao"].ToString();
                try
                {
                    _Thang     = row["Thang"].ToString();
                    _Nam       = row["Nam"].ToString();
                    _IDMauBieu = row["IDBieuDinhNghia"].ToString();
                }
                catch { }
            }
            if (_MaBC == "")
            {
                X.Msg.Alert("", "ANh/chị hãy click chuột vào một biểu tượng!").Show();
                return;
            }

            if (_MaBC == "000000")
            {
                ucBieuBC1.KhoiTao();
                wTaoBieuBaoCao.Show();
            }
            else
            {
                Ext.Net.Window CSo = new Ext.Net.Window();
                switch (_IDMauBieu)
                {
                case "1":
                    CSo = CuaSoChucNang("Nhập dữ liệu báo cáo nhanh Tháng " + _Thang + " Năm " + _Nam, "frmBieuNhapBCN.aspx?ThangBieuNhapBCN=" + _Thang + "&&NamBieuNhapBCN=" + _Nam + "&&MaBieuNhapBCN=" + _MaBC + "&&IDMauBieuBieuNhapBCN=" + _IDMauBieu);
                    break;

                case "3":
                    CSo = CuaSoChucNang("Báo cáo B02-05 " + _Thang + " Năm " + _Nam, "frmBieuNhapB0205.aspx?ThangBieuNhapB0205=" + _Thang + "&&NamBieuNhapB0205=" + _Nam + "&&MaBieuNhapB0205=" + _MaBC + "&&IDMauBieuBieuNhapB0205=" + _IDMauBieu);
                    break;
                }
                this.Form.Controls.Add(CSo);
                CSo.Render();
                CSo.Show();
            }
        }
        public void ShowDialog(int id)
        {
            ContentItem contentItem = Engine.Persister.Get(id);

            var window = new Window
            {
                ID = "pageCachingSettings",
                Title = @"Page Caching Settings",
                Width = 500,
                Height = 300,
                Layout = "fit",
                Modal = true
            };

            var formPanel = new FormPanel { Padding = 5 };
            var formLayout = new FormLayout();
            formPanel.ContentControls.Add(formLayout);
            window.Items.Add(formPanel);

            var chkEnableCache = new Checkbox
            {
                ID = "chkEnableCache",
                FieldLabel = @"Enable page cache?",
                LabelSeparator = "",
                Checked = contentItem.GetPageCachingEnabled()
            };
            formLayout.Anchors.Add(new Anchor(chkEnableCache));

            var tmeCacheDuration = new TimeField
            {
                ID = "tmeCacheDuration",
                FieldLabel = @"Cache duration",
                Width = 80,
                SelectedTime = contentItem.GetPageCachingDuration()
            };
            formLayout.Anchors.Add(new Anchor(tmeCacheDuration));

            Button btnSave = new Button { Text = @"Save" };
            window.Buttons.Add(btnSave);
            btnSave.Listeners.Click.Handler = string.Format(
                "stbStatusBar.showBusy(); Ext.net.DirectMethods.PageCaching.SavePageCachingSettings({0}, Ext.getCmp('{1}').getValue(), Ext.getCmp('{2}').getValue(), {{ url: '{4}', success: function() {{ stbStatusBar.setStatus({{ text: 'Saved page caching settings', iconCls: '', clear: true }}); }} }}); {3}.close();",
                id, chkEnableCache.ClientID, tmeCacheDuration.ClientID, window.ClientID, Engine.AdminManager.GetAdminDefaultUrl());

            Button btnCancel = new Button { Text = @"Cancel" };
            window.Buttons.Add(btnCancel);
            btnCancel.Listeners.Click.Handler = string.Format("{0}.close();", window.ClientID);

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
        public void btnSearch_Click()
        {
            string fromDate;
            string fromMonth;
            string fromYear;
            string toDate;
            string toMonth;
            string toYear;
            if (dfTo.IsEmpty)
                return;
            if (dfFrom.IsEmpty)
            {
                fromDate = "1";
                fromMonth = "1";
                fromYear = "1990";
            }
            else
            {
                fromDate = dfFrom.SelectedDate.Day.ToString().Trim();
                fromMonth = dfFrom.SelectedDate.Month.ToString().Trim();
                fromYear = dfFrom.SelectedDate.Year.ToString().Trim();
            }
            toDate = dfTo.SelectedDate.Day.ToString().Trim();
            toMonth = dfTo.SelectedDate.Month.ToString().Trim();
            toYear = dfTo.SelectedDate.Year.ToString().Trim();
            var win = new Window()
            {
                ID = "wdwSuratMasuk",
                Title = "Laporan Surat Masuk",
                Width = Unit.Pixel(800),
                Height = Unit.Pixel(600),
                Modal = true,
                AutoRender = false,
                Collapsed = false,
                Maximizable = false,
                Maximized = true,
                Hidden = true,
                Draggable = false,
                Resizable = false,
                Closable = true
            };

            win.AutoLoad.Url = "~/frmReportSuratMasuk.aspx?fromDay=" + fromDate + "&fromMonth=" +fromMonth+"&fromYear="+fromYear+"&toDay="+toDate+"&toMonth="+toMonth+"&toYear="+toYear;
            win.AutoLoad.Mode = LoadMode.IFrame;
            win.AutoLoad.ShowMask = true;
            win.Render(this.Form);
            win.Show();
        }
        public void OpenLookupWindow(string title, string url)
        {
            Ext.Net.Window w = new Ext.Net.Window();
            w.ID    = "LookupWindow" + Guid.NewGuid().ToString().Replace("-", "");
            w.Title = title;
            w.Modal = true;
            ComponentLoader cl = new ComponentLoader
            {
                Url      = url,
                Mode     = LoadMode.Frame,
                LoadMask = { ShowMask = true }
            };

            w.Loader = cl;
            w.Render();
        }
Beispiel #8
0
 private Window __BuildControl__control11()
 {
     Window window = new Window();
     window.ApplyStyleSheetSkin(this);
     window.Title=("用户登录");
     window.Closable=(false);
     window.Icon = Icon.Key;
     window.Width = new Unit(320.0, UnitType.Pixel);
     window.Height = new Unit(205.0, UnitType.Pixel);
     this.__BuildControl__control12(window.Items);
     this.__BuildControl__control18(window.Buttons);
     object[] parameters = new object[5];
     parameters[0] = window;
     parameters[2] = 0x19b;
     parameters[3] = 0x709;
     parameters[4] = false;
     this.__PageInspector_SetTraceData(parameters);
     return window;
 }
Beispiel #9
0
 private void ShowReport(string UID)
 {
     PrintPreview = new Window
     {
         ID          = "PrintPreview",
         Maximizable = false,
         Minimizable = false,
         Closable    = true,
         Modal       = true,
         Frame       = true,
         CloseAction = CloseAction.Destroy,
         Loader      = new ComponentLoader
         {
             Url      = String.Format(@"Preview.aspx?UID={0}", UID),
             Mode     = LoadMode.Frame,
             LoadMask = { ShowMask = true }
         }
     };
     PrintPreview.Maximize();
     PrintPreview.Render();
 }
Beispiel #10
0
        private Ext.Net.Window CuaSoChucNang(string rTieuDe, string Url)
        {
            Ext.Net.Window  _CSo    = new Ext.Net.Window();
            ComponentLoader _Loader = new ComponentLoader();

            _Loader.Url  = Url;
            _Loader.Mode = LoadMode.Frame;
            _Loader.LoadMask.ShowMask = true;
            _Loader.LoadMask.Msg      = "Đang xử lý .....";

            _CSo.ID          = "IDwNhapBCN";
            _CSo.Title       = rTieuDe;
            _CSo.TitleAlign  = TitleAlign.Center;
            _CSo.AutoRender  = true;
            _CSo.Maximizable = false;
            _CSo.Icon        = Icon.BookAddressesEdit;
            _CSo.Width       = 1200;
            _CSo.Height      = 600;
            _CSo.Loader      = _Loader;

            return(_CSo);
        }
Beispiel #11
0
    public void GetChildControl(Ext.Net.Component wrapperComponent)
    {
        switch (wrapperComponent.ToString())
        {
        case "Ext.Net.Window":
            Ext.Net.Window window = (Ext.Net.Window)wrapperComponent;
            GenSql(window.Items);
            break;

        case "Ext.Net.Container":
            Ext.Net.Container ctainer = (Ext.Net.Container)wrapperComponent;
            GenSql(ctainer.Items);
            break;

        case "Ext.Net.FieldSet":
            Ext.Net.FieldSet fs = (Ext.Net.FieldSet)wrapperComponent;
            GenSql(fs.Items);
            break;

        default:
            break;
        }
    }
Beispiel #12
0
        public override void RenderView(ViewContext viewContext, System.IO.TextWriter writer)
        {
            writer.Write("<!DOCTYPE html>");
            writer.Write("<head>");
            writer.Write("<title>用户登录</title>");
            var x = Html.X();
            writer.Write(Html.X().ResourceManager().ToHtmlString());
            var loginWindow = new Window()
            {
                Title = "用户登录",
                Width = 300,
                Height = 200,
                Closable = false,
                Modal = true,
                Icon = Icon.Key,
                Draggable = false,
                BodyPadding = 10,
                Resizable = false
            };
            var formPanel = new ValidatedForm()
            {
                Border = true,
                BodyPadding = 10,
                ID = "loginForm",
                Url = Url.Action("login")
            };
            formPanel.Layout = "table";
            formPanel.LayoutConfig.Add(new TableLayoutConfig()
            {
                Columns = 2
            });
            loginWindow.Add(formPanel);
            var textField = new TextField()
            {
                FieldLabel = "用户名",
                Name = "Username",
                ColSpan = 2,
                AllowBlank = false,
                BlankText = "用户名不能为空"
            };
            var passwordField = new TextField()
            {
                FieldLabel = "密码",
                Name = "Password",
                ColSpan = 2,
                AllowBlank = false,
                InputType = Ext.Net.InputType.Password,
                BlankText = "密码不能为空"
            };
            var verifyImg = new Image()
            {
                Width = 100,
                ImageUrl = Url.Action("VerifyImage"),
                Height = 22,
                ColSpan = 1,
                ID = "imgVerify"
            };
            var verifyCodeField = new TextField()
            {
                FieldLabel = "验证码",
                ColSpan = 1,
                AllowBlank = false,
                BlankText = "验证码不能为空'",
                Name="VerifyCode"
            };
            formPanel.Add(textField);
            formPanel.Add(passwordField);
            formPanel.Add(verifyCodeField);
            formPanel.Add(verifyImg);
            var btnLogin = new Button()
            {
                Text = "登录",
                Icon = Icon.KeyStart,

            };
            var btnChangeImage = new Button()
            {
                Text = "更换验证码",
                Icon = Icon.ImageEdit,
                ID = "btnChangeImage"
            };
            btnChangeImage.Handler = "var src='" + verifyImg.ImageUrl + "';src=src+'?'+new Date().valueOf();App.imgVerify.setImageUrl(src);";
            btnLogin.Handler = @"App.loginForm.submitData(function(r){if(r.success){location.href='" + @Url.Action("index", "home") + "';}else{App.btnChangeImage.handler();}});";
            loginWindow.Buttons.Add(btnChangeImage);
            loginWindow.Buttons.Add(btnLogin);
            writer.Write(loginWindow.ToBuilder().ToHtmlString());
            writer.Write("</head>");

        }
        public void EditUser(string commandName, string userid)
        {
            taskManager1.StartAll();
            HttpContext.Current.Session["isEditUser"] = false;
            HttpContext.Current.Session["isEditUser"] = false;

            BusinessObjects.User u = new User();
            //EDIT
            if (u.LoadByPrimaryKey(userid.Trim()) && commandName.Trim() == "Edit")
            {
                var win = new Window()
                {
                    ID = "EditUserWindow",
                    Title = "Edit User : "******"~/frmUserWindowEdit.aspx?userid=" + userid.ToString().Trim();
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
            //DELETE
            else if (u.LoadByPrimaryKey(userid.Trim()) && commandName.Trim() == "Delete")
            {
                X.Msg.Confirm("Warning", "Are you sure want to DELETE user : "******"Ext.net.DirectMethods.DoYes('" + userid + "')",
                        Text = "Yes, DELETE user: "******"Ext.net.DirectMethods.DoNo()",
                        Text = "No"
                    }
                }).Show();
            }
            //ADD NEW
            else if (commandName.Trim() == "New")
            {
                var win = new Window()
                {
                    ID = "AddUserWindow",
                    Title = "Add User",
                    Width = Unit.Pixel(800),
                    Height = Unit.Pixel(600),
                    Modal = true,
                    AutoRender = false,
                    Collapsed = false,
                    Maximizable = false,
                    Hidden = true,
                    Draggable = false,
                    Resizable = false,
                    Closable = true
                };

                win.AutoLoad.Url = "~/frmUserWindowAdd.aspx?userid=new";
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
        }
    /// <summary>
    /// Metodo que crea todos los SubMenus(Menu Hijos), Si el Hijo a su vez tiene Hijos, tbn los crea
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    public void Button_WindowDesktop(object sender, DirectEventArgs args)
    {
      try
      {
        Window win = new Window();
        win.Title = args.ExtraParams["title"];
        win.Loader = new ComponentLoader(new ComponentLoader.Config { Mode = LoadMode.Frame, Url = args.ExtraParams["url"] });
        win.ID = "WIN_" + args.ExtraParams["id"];
        win.IconCls = args.ExtraParams["icono"];



        if (args.ExtraParams["id"] == "cv" ||args.ExtraParams["id"] == "ct")
        {
          win.Minimizable = false;
          win.Maximizable = false;
          win.Width = 500;
          win.Height = 400;
          win.Resizable = false;
        }
        else if (args.ExtraParams["id"] == "cf")
        {
          win.Minimizable = false;
          win.Maximizable = false;
          win.Width = 900;
          win.Height = 500;
          win.Resizable = false;
        }
        else
        {
          win.Maximized = false;
          win.Maximizable = true;
          win.MinWidth = _minWidth;
          win.MinHeight = _minHeigth;
          win.Maximize();
        }


        dskPrincipal.CreateWindow(win);

      }
      catch (Exception ex)
      {
        throw new Exception(ex.Message);
      }
    }
        public override void ModifyInterface(IMainInterface mainInterface)
        {
            // Add tree.
            TreePanel treePanel = new TreePanel
            {
                ID = "stpNavigation",
                Width = 200,
                Icon = Icon.SitemapColor,
                Title = "Site",
                AutoScroll = true,
                PathSeparator = "|",
                EnableDD = true,
                UseArrows = true,
                BodyStyle = "padding-top:5px",
                Region = Region.West,
                MinWidth = 175,
                MaxWidth = 400,
                Split = true,
                CollapseFirst = false
            };
            mainInterface.Viewport.Items.Add(treePanel);

            // Setup tree top toolbar.
            Toolbar topToolbar = new Toolbar();
            treePanel.TopBar.Add(topToolbar);

            TriggerField filterField = new TriggerField
            {
                EnableKeyEvents = true,
                Width = 100,
                EmptyText = "Filter..."
            };
            filterField.Triggers.Add(new FieldTrigger
            {
                Icon = TriggerIcon.Clear,
                HideTrigger = true
            });
            filterField.Listeners.KeyUp.Fn = "keyUp";
            filterField.Listeners.KeyUp.Buffer = 100;
            filterField.Listeners.TriggerClick.Fn = "clearFilter";
            topToolbar.Items.Add(filterField);

            topToolbar.Items.Add(new ToolbarFill());

            Button refreshButton = new Button { Icon = Icon.Reload };
            refreshButton.ToolTips.Add(new ToolTip { Html = "Refresh" });
            refreshButton.Listeners.Click.Handler = string.Format("{0}.getLoader().load({0}.getRootNode());", treePanel.ClientID);
            topToolbar.Items.Add(refreshButton);

            Button expandAllButton = new Button { IconCls = "icon-expand-all" };
            expandAllButton.ToolTips.Add(new ToolTip { Html = "Expand All" });
            expandAllButton.Listeners.Click.Handler = string.Format("{0}.expandAll();", treePanel.ClientID);
            topToolbar.Items.Add(expandAllButton);

            Button collapseAllButton = new Button { IconCls = "icon-collapse-all" };
            collapseAllButton.ToolTips.Add(new ToolTip { Html = "Collapse All" });
            collapseAllButton.Listeners.Click.Handler = string.Format("{0}.collapseAll();", treePanel.ClientID);
            topToolbar.Items.Add(collapseAllButton);

            topToolbar.Items.Add(new ToolbarSeparator());

            Window helpWindow = new Window
                {
                    Modal = true,
                    Icon = Icon.Help,
                    Title = "Help",
                    Hidden = true,
                    Html = "This is the site tree. You can use this to view all the pages on your site. Right-click any item to edit or delete it, as well as create additional pages.<br /><br />The main branches of the root node tree are the main sections of the admin system. Each section is broken down into smaller sections, accessed by expanding the + sign. (Wherever you see a + sign, the section can be broken down into further sections).<br /><br />When you receive your admin system, you will notice the first main section (after the Root Node) will be divided into the main sections of your website. (Example sections may include: Homepage, About Us, News, Links and Contact pages.) To see these pages, as they appear on the website, simply click the relevant node – it will then appear in the right hand pane.",
                    BodyStyle = "padding:5px",
                    Width = 300,
                    Height = 200,
                    AutoScroll = true
                };
            mainInterface.AddControl(helpWindow);

            Button helpButton = new Button();
            helpButton.Icon = Icon.Help;
            helpButton.ToolTips.Add(new ToolTip { Html = "Help" });
            helpButton.Listeners.Click.Handler = string.Format("{0}.show();", helpWindow.ClientID);
            topToolbar.Items.Add(helpButton);

            // Data loader.
            var treeLoader = new Ext.Net.TreeLoader
                {
                    DataUrl = Context.Current.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(GetType().Assembly,
                        "Zeus.Admin.Plugins.Tree.TreeLoader.ashx"),
                    PreloadChildren = true
                };
            treeLoader.Listeners.Load.Handler = "if (response.getResponseHeader['Content-Type'] == 'text/html; charset=utf-8') { Ext.Msg.alert('Timeout', 'Your session has timed out. Please refresh your browser to login again.'); }";
            treePanel.Loader.Add(treeLoader);

            // Call tree modification plugins and load tree plugin user controls.
            foreach (ITreePlugin treePlugin in Context.Current.ResolveAll<ITreePlugin>())
            {
                string[] requiredUserControls = treePlugin.RequiredUserControls;
                if (requiredUserControls != null)
                    mainInterface.LoadUserControls(requiredUserControls);

                treePlugin.ModifyTree(treePanel, mainInterface);
            }

            if (!ExtNet.IsAjaxRequest)
            {
                TreeNodeBase treeNode = SiteTree.Between(Find.StartPage, Find.RootItem, true)
                    .OpenTo(Find.StartPage)
                    .Filter(items => items.Authorized(Context.Current.WebContext.User, Context.SecurityManager, Operations.Read))
                    .ToTreeNode(true);
                treePanel.Root.Add(treeNode);
            }
        }
Beispiel #16
0
        public void Yes() { Response.Redirect("/Default.aspx"); } //Pagina a la que se redireccionara

        protected void Page_Load(object sender, EventArgs e)
        {
            Acceso.Revisa_Permisos(162);//Revisa los permisos de usuario
            if (!Page.IsPostBack)
            {
                Session["SucursalEjec"] = Session["NoSucursal"];
                Session.Remove("Dependiente");
                cbSumaAsegurada.SelectedItem.Value = "25000";
                /*Guarda en log el acceso del usuario*/
                Loguin.InsertLogDanos(Convert.ToInt32(Session["Ejecutivo"]), 11, "ACCESO AL MODULO DE EMISION");
            }
            dlfCooperativa.Text = Convert.ToString(Session["Coop"]);
            dlfPlaza.Text = Convert.ToString(Session["Plaza"]);
            dlfSucursal.Text = Convert.ToString(Session["Sucursal"]);

            //Condiciona que las fechas máximas a elegir sea el día actual
            dfFechaIngreso.MaxDate = DateTime.Now;
            dfFechaNacimiento.MaxDate = DateTime.Now;

            /*Crea ventana emergenta para consultar CURP desde sitio de gobierno federal*/
            var win = new Window
            {
                ID = "Window1",
                Title = "Consulta-CURP",
                Width = Unit.Pixel(900),
                Height = Unit.Pixel(450),
                Modal = true,
                Collapsible = false,
                Maximizable = false,
                Hidden = true
            };

            win.AutoLoad.Url = "http://consultas.curp.gob.mx/CurpSP/";//Carga en la ventana la pagina de consulta CURP de gobierno
            win.AutoLoad.Mode = LoadMode.IFrame;
            win.Render(this.Form);
        }
Beispiel #17
0
        /*Método para asignar bandera a variable de sesión*/
        protected void btnVerificaRFC_Click(object sender, DirectEventArgs e)
        {
            verRFC = true;//Asigna bandera a variable de sesión
            Session["VerificaRFC"] = verRFC;
            /*Crea ventana emergente para consultar RFC desde Recaudanet*/
            var win2 = new Window
            {
                ID = "Window2",
                Title = "Verifica-RFC",
                Width = Unit.Pixel(900),
                Height = Unit.Pixel(460),
                Modal = true,
                Collapsible = false,
                Maximizable = false
            };

            win2.AutoLoad.Url = "https://www.recaudanet.gob.mx/recaudanet/rfc.jsp";//Carga página de gobierno a la ventana
            win2.AutoLoad.Mode = LoadMode.IFrame;
            win2.Render(this.Form);

        }
Beispiel #18
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);

            #region 总体布局
            _viewPort = new Viewport();
            _viewPort.Layout = "border";
            _copyright = new Panel();
            _copyright.Title = "版权";
            _copyright.TitleAlign = TitleAlign.Center;
            _copyright.Collapsible = false;
            _copyright.Region = Region.South;
            _copyright.Split = true;
            _menu = new Panel();
            _menu.Title = "导航菜单";
            _menu.Collapsible = true;
            _menu.Region = Region.West;
            _menu.Split = true;
            _menu.Width = 200;
            _workArea = new Ext.Net.TabPanel();
            _workArea.Title = "欢迎使用";
            _workArea.Region = Region.Center;
            _workArea.ID = "tabWork";
            _title = new Panel();
            _title.Title = WebName;
            _title.Collapsible = false;
            _title.Region = Region.North;
            _title.Split = true;
            _viewPort.Items.Add(_title);
            _viewPort.Items.Add(_workArea);
            _viewPort.Items.Add(_copyright);
            _viewPort.Items.Add(_menu);
            #endregion

            #region 个人区
            _personPanel = new Ext.Net.Panel();
            _personPanel.Collapsed = true;
            _personPanel.Collapsible = true;
            _personPanel.Title = "欢迎使用";
            _personPanel.Height = 110;
            _personPanel.BodyPadding = 10;
            _personPanel.Layout = "table";
            _personPanel.LayoutConfig.Add(new TableLayoutConfig()
            {
                Columns = 2
            });
            Image avatarImg = new Image();
            avatarImg.RowSpan = 2;
            avatarImg.Width = avatarImg.Height = 70;
            avatarImg.ImageUrl = BaseResource.avatar;
            _personPanel.Add(avatarImg);
            _personPanel.Add(new Label(userInfo.Username));

            ButtonGroup buttonGroup = new ButtonGroup();
            buttonGroup.Width = 80;
            buttonGroup.Layout = "vbox";
            buttonGroup.Add(new KeyButton()
            {
                Text = "修改密码",
                ID = "btnChangePassword",
                OnClientClick = "App.winChangePassword.show();App.winChangePassword.getLoader().load();"
            });

            btnExit = new Button()
            {
                Text = "安全退出",
                ID = "btnExit",
                Icon = Icon.KeyDelete
            };
            var clickEvent = btnExit.DirectEvents.Click;
            clickEvent.Event += clickEvent_Event;
            clickEvent.EventMask.Set("正在退出");
            clickEvent.Confirmation.ConfirmRequest = true;
            clickEvent.Confirmation.Title = "提示";
            clickEvent.Confirmation.Message = "确定退出?";
            buttonGroup.Add(btnExit);
            _personPanel.Add(buttonGroup);
            _menu.Add(_personPanel);
            winChangePassword = new Window()
            {
                Icon = Icon.Key,
                BodyPadding = 10,
                Width = 300,
                Height = 210,
                Modal = true,
                Hidden = true,
                AutoShow = false,
                ID = "winChangePassword",
                Title = "修改密码",
                Loader = new ComponentLoader()
                {
                    Url = ResolveClientUrl("~/user/changepassword.aspx"),
                    Mode = LoadMode.Frame
                }
            };
            winChangePassword.Loader.LoadMask.Set("正在加载");
            Controls.Add(winChangePassword);
            #endregion

            _menuPanel = new TreePanel()
            {
                Title = "功能菜单",
                Height = 500,
                RootVisible = false,
                ID = "mainMenu"
            };

            _menuStore = new TreeStore()
            {
                NodeParam = "parentId"
            };
            _menuStore.ReadData += _menuStore_ReadData;
            _menuPanel.Store.Add(_menuStore);
            _menuPanel.Root.Add(new Node()
            {
                NodeID = "0",
                Text = "Root",
                Expanded = true
            });
            _menu.Add(_menuPanel);
            var itemClick = _menuPanel.DirectEvents.ItemClick;
            itemClick.Before = "var tree=arguments[0],eventType=arguments[1],eventName=arguments[2],extraParams=arguments[3];var tab = App.tabWork.getComponent('menu' + extraParams.id);if (tab) {App.tabWork.setActiveTab(tab);return false;}return tree.getStore().getNodeById(extraParams.id).isLeaf();";
            itemClick.EventMask.Set("正在加载");
            itemClick.Event += itemClick_Event;
            itemClick.ExtraParams.Add(new Parameter("id", "record.data.id", ParameterMode.Raw));

            #region 隐藏顶级窗口
            _winParentWindow = new Window();
            _winParentWindow.Hidden = true;
            _winParentWindow.Loader = new ComponentLoader();
            _winParentWindow.Loader.Mode = LoadMode.Frame;
            _winParentWindow.Width = 800;
            _winParentWindow.Modal = true;
            _winParentWindow.Height = 600;
            _winParentWindow.ID = "_topWin";
            Controls.Add(_winParentWindow);
            #endregion

            Controls.Add(_viewPort);
        }
    public void OpenNewWindow2(string titulo, string url, string id, string icono = "#Application")
    {
      try
      {
        Window win = new Window();
        win.Title = titulo;
        win.Loader = new ComponentLoader(new ComponentLoader.Config { Mode = LoadMode.Frame, Url = Constantes.URL_PRINCIPAL_ADMIN + url });
        win.Maximized = false;
        win.Minimizable = true;
        win.ID = "WIN_" + id;
        win.IconCls = icono;
        win.MinWidth = _minWidth;
        win.MinHeight = _minHeigth;
        win.Maximize();
        UserControl uc = new UserControl();
        uc.ID = "MH_" + id;


        win.ContentControls.Add(uc);


        dskPrincipal.CreateWindow(win);
      }
      catch (Exception ex)
      {
        Mensajes.Error(ex.Message);
      }
    }
Beispiel #20
0
        public override void RenderView(System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer)
        {
            writer.Write("<!DOCTYPE html>");
            writer.Write("<head>");
            writer.Write("<title>后台管理中心 - " + AppConfig.WebTitle + "</title>");
            writer.Write("</head><body></body>");
            var x = Html.X();
            writer.Write(x.ResourceManager().ToHtmlString());
            #region 总体布局
            var viewPort = new Viewport();
            viewPort.Layout = "border";
            var _copyright = new Panel();
            _copyright.Title = AppConfig.WebName + " 版权所有";
            _copyright.TitleAlign = TitleAlign.Center;
            _copyright.Collapsible = false;
            _copyright.Region = Region.South;
            _copyright.Split = true;
            var _menu = new Panel();
            _menu.Title = "导航菜单";
            _menu.Collapsible = true;
            _menu.Region = Region.West;
            _menu.Split = true;
            _menu.Width = 200;
            var _workArea = new Ext.Net.TabPanel();
            _workArea.Title = "欢迎使用";
            _workArea.Region = Region.Center;
            _workArea.ID = "tabWork";
            var _title = new Panel();
            _title.Title = AppConfig.WebTitle;
            _title.Collapsible = false;
            _title.Region = Region.North;
            _title.Split = true;
            viewPort.Items.Add(_title);
            viewPort.Items.Add(_workArea);
            viewPort.Items.Add(_copyright);
            viewPort.Items.Add(_menu);
            #endregion

            #region 个人区
            var _personPanel = new Ext.Net.Panel();
            _personPanel.Collapsed = true;
            _personPanel.Collapsible = true;
            _personPanel.Title = "欢迎使用";
            _personPanel.Height = 110;
            _personPanel.BodyPadding = 10;
            _personPanel.Layout = "table";
            _personPanel.LayoutConfig.Add(new TableLayoutConfig()
            {
                Columns = 2
            });
            Image avatarImg = new Image();
            avatarImg.RowSpan = 2;
            avatarImg.Width = avatarImg.Height = 70;
            //avatarImg.ImageUrl = BaseResource.avatar;
            _personPanel.Add(avatarImg);
            _personPanel.Add(new Label(UserInfo.Username));

            ButtonGroup buttonGroup = new ButtonGroup();
            buttonGroup.Width = 80;
            buttonGroup.Layout = "vbox";
            buttonGroup.Add(new Button()
            {
                Icon= Ext.Net.Icon.Key,
                Text = "修改密码",
                ID = "btnChangePassword",
                OnClientClick = "App.winChangePassword.show();App.winChangePassword.getLoader().load();"
            });

            var btnExit = new Button()
            {
                Text = "安全退出",
                ID = "btnExit",
                Icon = Icon.KeyDelete
            };

            buttonGroup.Add(btnExit);
            _personPanel.Add(buttonGroup);
            _menu.Add(_personPanel);
            var winChangePassword = new Window()
            {
                Icon = Icon.Key,
                BodyPadding = 10,
                Width = 300,
                Height = 210,
                Modal = true,
                Hidden = true,
                AutoShow = false,
                ID = "winChangePassword",
                Title = "修改密码",
                Loader = new ComponentLoader()
                {
                    Url = Url.Action("changePassword", "account"),
                    Mode = LoadMode.Frame
                }
            };
            #endregion

            var _menuPanel = new TreePanel()
            {
                Title = "功能菜单",
                Height = 500,
                RootVisible = false,
                ID = "mainMenu"
            };

            var _menuStore = new TreeStore()
             {
                 NodeParam = "parentId"
             };
            _menuStore.Proxy.Add(x.AjaxProxy().Url(Url.Action("GetMenus")).ActionMethods(y => y.Read = HttpMethod.POST));
            //_menuStore.ReadData += _menuStore_ReadData;
            _menuPanel.Store.Add(_menuStore);
            _menuPanel.Root.Add(new Node()
            {
                NodeID = "0",
                Text = "Root",
                Expanded = true
            });
            _menu.Add(_menuPanel);
            var itemClick = _menuPanel.DirectEvents.ItemClick;
            itemClick.Before = "var tree=arguments[0],eventType=arguments[1],eventName=arguments[2],extraParams=arguments[3];var tab = App.tabWork.getComponent('menu' + extraParams.menuid);if (tab) {App.tabWork.setActiveTab(tab);return false;}return tree.getStore().getNodeById(extraParams.menuid).isLeaf();";
            itemClick.Url = Url.Action("OpenPage");
            itemClick.ExtraParams.Add(new Parameter("menuid", "record.data.id", ParameterMode.Raw));
            writer.Write(viewPort.ToBuilder().ToHtmlString());
        }
Beispiel #21
0
 private void InitGridCommand()
 {
     if ((this.EditorConfig != null) && (this.EditorConfig.Mode == EditorMode.Window))
     {
         Window window = new Window
         {
             AutoShow = false,
             Hidden = true,
             CloseAction = CloseAction.Hide,
             Closable = true,
             ConstrainHeader = true,
             Constrain = true,
             Modal = true,
             BodyPadding = 10
         };
         ComponentLoader loader = new ComponentLoader
         {
             DisableCaching = true,
             AutoLoad = false,
             Mode = LoadMode.Frame
         };
         window.Loader = loader;
         this._editWindow = window;
         this._editWindow.Loader.LoadMask.ShowMask = true;
         this._editWindow.Loader.LoadMask.Msg = "正在加载";
         this._editWindow.ID = "_editWindow";
         this.Controls.Add(this._editWindow);
         CommandColumn item = (CommandColumn)this.ColumnModel.Columns.FirstOrDefault<ColumnBase>(x => (x is CommandColumn));
         GridCommand command = null;
         if (this.EnableEdit)
         {
             command = new GridCommand
             {
                 Text = "编辑",
                 Icon = Ext.Net.Icon.ApplicationEdit,
                 CommandName = "edit"
             };
         }
         GridCommand commandRemove = null;
         if (this.EnableRemove)
         {
             commandRemove = new GridCommand
             {
                 Text = "删除",
                 Icon = Ext.Net.Icon.ApplicationDelete,
                 CommandName = "delete"
             };
         }
         if (item == null)
         {
             item = new CommandColumn();
             item.DirectEvents.Command.Confirmation.ConfirmRequest = true;
             item.DirectEvents.Command.Confirmation.Message = "确认删除?";
             item.DirectEvents.Command.Confirmation.Title = "提示";
             item.DirectEvents.Command.Confirmation.BeforeConfirm = "if(command=='delete')return true;return false;";
             item.Width = 150;
             if (this.EnableEdit)
             {
                 item.Commands.Add(command);
             }
             if (this.EnableRemove)
             {
                 item.Commands.Add(commandRemove);
             }
             this.ColumnModel.Columns.Insert(0, item);
             this.InitGridCommand(item);
             if (EditorConfig.EditWindow != null)
                 item.DirectEvents.Command.ExtraParams.AddRange(this.EditorConfig.EditWindow.ExtraParams);
         }
         else
         {
             GridCommand commandEdit = (GridCommand)item.Commands.FirstOrDefault<GridCommandBase>(x => (((GridCommand)x).CommandName == "edit"));
             if (commandEdit == null)
             {
                 commandEdit = command;
                 this.InitGridCommand(item);
                 if (EnableRemove)
                     item.Commands.Insert(0, commandRemove);
                 if (EnableEdit)
                     item.Commands.Insert(0, commandEdit);
                 if (EditorConfig.EditWindow != null)
                     item.DirectEvents.Command.ExtraParams.AddRange(this.EditorConfig.EditWindow.ExtraParams);
             }
         }
     }
 }
        /// <summary>
        /// Constructs the online users tree.
        /// </summary>
        private void ConstructOnlineUsersTree()
        {
            var activeOnlineUsers = this.GetActiveUsers();
            var friendsList = this.GetBuddiesList();
            var tree = new TreePanel
            {
                RootVisible = false,
                ID = "OnlineUsersTree",
                ContextMenuID = "OnlineUsersMenu",
            };
            var root = new Node {NodeID = "root", Expanded = true};
            tree.Root.Add(root);
            var friendsNode = new Node { Text = this.Text("FRIENDS", "LIST"), Expanded = true };
            foreach (var friend in friendsList)
            {
                friendsNode.Children.Add(new Node()
                {
                    Text = friend.UserName,
                    Icon =
                        (activeOnlineUsers.Exists(x => x.UserId == friend.UserId))
                            ? Icon.StatusOnline
                            : Icon.StatusOffline,
                    Leaf = true
                });
            }
            if (!friendsList.Any())
            {
                friendsNode.Children.Add(new Node()
                {
                    Text = this.Text("FRIENDS", "NONE"),
                    Icon = Icon.None,
                    Leaf = true,
                });
                this.OnlineUsersMenu.Visible = false;
            }
            root.Children.Add(friendsNode);
            //TODO: Optimize friends list due to performance issue
            //var usersHood = this.GetCore<classes.Core.UserData>().GetUsersHoods(this.PageContext.PageUserID);
            //foreach (var h in usersHood)
            //{
            //    var hoodNode = new Node { Text = h.Name, Expanded = false };
            //    foreach (var u in h.Users.Where(x => x.UserId != this.PageContext.PageUserID))
            //    {
            //        hoodNode.Children.Add(new Node()
            //        {
            //            Text = UserMembershipHelper.GetDisplayNameFromID(u.UserId),
            //            Icon =
            //                (activeOnlineUsers.Exists(x => x.UserId == u.UserId))
            //                    ? Icon.StatusOnline
            //                    : Icon.StatusOffline,
            //            Leaf = true
            //        });
            //    }
            //    root.Children.Add(hoodNode);
            //}
            FriendWindow = new Window
            {
                ID = "friendsWindow",
                AutoRender = false,
                Hidden = true,
                Width = Unit.Pixel(250),
                Height = Unit.Pixel(400),
                Maximizable = false,
                BodyBorder = 0,
                Layout = "Accordion"
            };

            this.FriendWindow.Items.Add(tree);
            this.FriendsAspPlaceHolder.Controls.Add(this.FriendWindow);
        }
        public void Refresh_Grid()
        {
            if (HttpContext.Current.Session["isEditInbox"] == null)
            {
                taskManager1.StopAll();
                return;
            }

            if ((bool)HttpContext.Current.Session["isEditInbox"] == false && (bool)HttpContext.Current.Session["isAddDisposition"] == false)
                return;
            //Finish add new letter and no add disposition
            if ((bool)HttpContext.Current.Session["isEditInbox"] == true && (bool)HttpContext.Current.Session["isAddDisposition"] == false)
            {
                this.storeInbox.DataSource = GetInbox();
                this.storeInbox.DataBind();
                HttpContext.Current.Session["isEditInbox"] = false;
                taskManager1.StopAll();
            }
            //Finish add new letter and create new disposition
            if ((bool)HttpContext.Current.Session["isEditInbox"] == false && (bool)HttpContext.Current.Session["isAddDisposition"] == true)
            {
                var win = new Window()
                {
                    ID = "AddDisposition",
                    Title = "Add Disposisi",
                    Width = Unit.Pixel(800),
                    Height = Unit.Pixel(600),
                    Modal = true,
                    AutoRender = false,
                    Collapsed = false,
                    Maximizable = false,
                    Hidden = true,
                    Draggable = false,
                    Resizable = false,
                    Closable = false
                };

                win.AutoLoad.Url = "~/frmInboxDisposisiAdd.aspx?nomorsurat=" + HttpContext.Current.Session["nomorsurat"].ToString().Trim();
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
        }
        public void ProceesData_Click(string invoiceNo)
        {
            tm1.StartAll();
            HttpContext.Current.Session["isProcess"] = false;
            gpInvoices.Title = invoiceNo;
            InvoiceSupplier iS = new InvoiceSupplier();
            iS.es.Connection.Name = "KENCANA";
            if (iS.LoadByPrimaryKey(invoiceNo))
            {
                gpInvoices.Title = iS.InvoiceNotes + " " + iS.SupplierID;
            }

            var win = new Window()
            {
                ID = "window1",
                Title = "Proses Invoice Number : " + invoiceNo,
                Width = Unit.Pixel(800),
                Height = Unit.Pixel(600),
                Modal = true,
                AutoRender = false,
                Collapsible = false,
                Maximizable = false,
                Hidden = true, 
                Draggable = false, 
                Resizable = false
            };
            win.AutoLoad.Url = "~/Transaksi/TransaksiTarikDataPembayaranProcess.aspx?invoiceno=" + invoiceNo;
            win.AutoLoad.Mode = Ext.Net.LoadMode.IFrame;
            win.AutoLoad.ShowMask = true;            
            //win.Center();
            //win.Show();

            //this.Form.Controls.Add(win);
            win.Render(this.Form);
            win.Show();
        }
Beispiel #25
0
 private void InitGridCommand()
 {
     if ((this.EditorConfig != null) && (this.EditorConfig.Mode == EditorMode.Window))
     {
         Window window = new Window
         {
             AutoShow = false,
             Hidden = true,
             CloseAction = CloseAction.Hide,
             Closable = true,
             ConstrainHeader = true,
             Constrain = true,
             Modal = true,
             BodyPadding = 10
         };
         ComponentLoader loader = new ComponentLoader
         {
             DisableCaching = true,
             AutoLoad = false,
             Mode = LoadMode.Frame
         };
         window.Loader = loader;
         this._editWindow = window;
         this._editWindow.Loader.LoadMask.ShowMask = true;
         this._editWindow.Loader.LoadMask.Msg = "正在加载";
         this._editWindow.ID = "editWindow";
         _editWindow.Resizable = false;
         _editWindow.Icon = Ext.Net.Icon.UserAdd;
         this.Controls.Add(this._editWindow);
         CommandColumn item = (CommandColumn)this.ColumnModel.Columns.FirstOrDefault<ColumnBase>(x => (x is CommandColumn));
         GridCommand command = null;
         if (this.EnableEdit)
         {
             command = new GridCommand
             {
                 Text = "编辑",
                 Icon = Ext.Net.Icon.ApplicationEdit,
                 CommandName = "edit"
             };
         }
         GridCommand commandRemove = null;
         if (this.EnableRemove)
         {
             commandRemove = new GridCommand
             {
                 Text = "删除",
                 Icon = Ext.Net.Icon.ApplicationDelete,
                 CommandName = "delete"
             };
         }
         if (item == null)
         {
             item = new CommandColumn();
             item.DirectEvents.Command.Confirmation.ConfirmRequest = true;
             item.DirectEvents.Command.Confirmation.Message = "确认删除?";
             item.DirectEvents.Command.Confirmation.Title = "提示";
             item.DirectEvents.Command.Confirmation.BeforeConfirm = "if(command=='delete')return true;return false;";
             item.Width = 150;
             if (this.EnableEdit)
             {
                 item.Commands.Add(command);
             }
             if (this.EnableRemove)
             {
                 item.Commands.Add(commandRemove);
             }
             this.ColumnModel.Columns.Insert(0, item);
             this.InitGridCommand(item);
             if (EditorConfig.EditWindow != null)
             {
                 var replaceParamsScripts = new List<string>();
                 var scriptTpl = "url=url.replace('{0}',{1});";
                 foreach (var paras in EditorConfig.EditWindow.ExtraParams)
                 {
                     var script = string.Format(scriptTpl, "@" + paras.Name, paras.Value);
                     replaceParamsScripts.Add(script);
                 }
                 item.Listeners.Command.Handler = "if(command==\"edit\"){var url='" + EditorConfig.EditWindow.Url + "';" + string.Join(";", replaceParamsScripts) + "var editWindow=App." + _editWindow.ID + ";editWindow.show();editWindow.loader.load({url:url});editWindow.setTitle(\"" + EditorConfig.EditWindow.Title + "\");editWindow.setWidth(" + EditorConfig.EditWindow.Width + ");editWindow.setHeight(" + EditorConfig.EditWindow.Height + ");editWindow.center();}else{Ext.Msg.confirm(\"提示\",\"确认删除吗?\",function(r){if(r==\"yes\"){               }})}";
                 //item.DirectEvents.Command.ExtraParams.AddRange(this.EditorConfig.EditWindow.ExtraParams);
             }
         }
         else
         {
             GridCommand commandEdit = (GridCommand)item.Commands.FirstOrDefault<GridCommandBase>(x => (((GridCommand)x).CommandName == "edit"));
             if (commandEdit == null)
             {
                 commandEdit = command;
                 this.InitGridCommand(item);
                 if (EnableRemove)
                     item.Commands.Insert(0, commandRemove);
                 if (EnableEdit)
                     item.Commands.Insert(0, commandEdit);
                 if (EditorConfig.EditWindow != null)
                     item.DirectEvents.Command.ExtraParams.AddRange(this.EditorConfig.EditWindow.ExtraParams);
             }
         }
     }
 }
        public void EditSurat(string commandName, string masukid )
        {
            taskManager1.StartAll();
            HttpContext.Current.Session["isEditInbox"] = false;
            int masukId = 0;
            HttpContext.Current.Session["isEditInbox"] = false;
            HttpContext.Current.Session["isAddDisposition"] = false;
            if (!int.TryParse(masukid.Trim(), out masukId))
                masukId = 0;
            Suratmasuk sm = new Suratmasuk();
            //EDIT
            if (sm.LoadByPrimaryKey(masukId) && commandName.Trim() == "Edit")
            {
                var win = new Window()
                {
                    ID = "EditSuratWindow",
                    Title = "Edit Surat Masuk No. " + sm.Nomor,
                    Width = Unit.Pixel(800),
                    Height = Unit.Pixel(600),
                    Modal = true,
                    AutoRender = false,
                    Collapsed = false,
                    Maximizable = false,
                    Hidden = true,
                    Draggable = false,
                    Resizable = false,
                    Closable = false
                };

                win.AutoLoad.Url = "~/frmInboxWindowEdit.aspx?masukid=" + masukId.ToString().Trim() + "&isadd=0";
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
            //ADD new surat
            if (commandName.Trim() == "New")
            {
                if (masukid.Trim() != "new")
                    return;
                else
                {
                    var win = new Window()
                    {
                        ID = "EditSuratWindow",
                        Title = "Add Surat Masuk",
                        Width = Unit.Pixel(800),
                        Height = Unit.Pixel(600),
                        Modal = true,
                        AutoRender = false,
                        Collapsed = false,
                        Maximizable = false,
                        Hidden = true,
                        Draggable = false,
                        Resizable = false,
                        Closable = false
                    };

                    win.AutoLoad.Url = "~/frmInboxWindow.aspx?masukid=new&isadd=1";
                    win.AutoLoad.Mode = LoadMode.IFrame;
                    win.AutoLoad.ShowMask = true;
                    win.Render(this.Form);
                    win.Show();
                }
            }
            //Add new Disposition
            if (commandName.Trim() == "Disposition")
            {
                var win = new Window()
                {
                    ID = "AddDisposition",
                    Title = "Add Disposisi",
                    Width = Unit.Pixel(800),
                    Height = Unit.Pixel(600),
                    Modal = true,
                    AutoRender = false,
                    Collapsed = false,
                    Maximizable = false,
                    Hidden = true,
                    Draggable = false,
                    Resizable = false,
                    Closable = true
                };

                win.AutoLoad.Url = "~/frmInboxDisposisiAdd.aspx?masukid=" + masukId.ToString().Trim();
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
        }
        public void EditSurat(string keluarid)
        {
            taskManager1.StartAll();
            HttpContext.Current.Session["isEditInbox"] = false;
            int masukId = 0;
            HttpContext.Current.Session["isEditInbox"] = false;
            if (!int.TryParse(keluarid.Trim(), out masukId))
                masukId = 0;
            Suratkeluar sm = new Suratkeluar();
            //EDIT
            if (sm.LoadByPrimaryKey(masukId))
            {
                var win = new Window()
                {
                    ID = "EditSuratWindow",
                    Title = "Edit Surat Keluar No. " + sm.Nomor,
                    Width = Unit.Pixel(800),
                    Height = Unit.Pixel(600),
                    Modal = true,
                    AutoRender = false,
                    Collapsed = false,
                    Maximizable = false,
                    Hidden = true,
                    Draggable = false,
                    Resizable = false,
                    Closable = false
                };

                win.AutoLoad.Url = "~/frmOutboxWindowEdit.aspx?keluarid=" + masukId.ToString().Trim();
                win.AutoLoad.Mode = LoadMode.IFrame;
                win.AutoLoad.ShowMask = true;
                win.Render(this.Form);
                win.Show();
            }
            //ADD
            else
            {
                if (keluarid.Trim() != "new")
                    return;
                else
                {
                    var win = new Window()
                    {
                        ID = "EditSuratWindow",
                        Title = "Add Surat Keluar",
                        Width = Unit.Pixel(800),
                        Height = Unit.Pixel(600),
                        Modal = true,
                        AutoRender = false,
                        Collapsed = false,
                        Maximizable = false,
                        Hidden = true,
                        Draggable = false,
                        Resizable = false,
                        Closable = false
                    };

                    win.AutoLoad.Url = "~/frmOutboxWindowAdd.aspx?keluarid=new";
                    win.AutoLoad.Mode = LoadMode.IFrame;
                    win.AutoLoad.ShowMask = true;
                    win.Render(this.Form);
                    win.Show();
                }
            }
        }
Beispiel #28
0
        private Window AddEditorWindow(ContentItem contentItem)
        {
            Window editorWindow = new Window
            {
                ID = ID + "editorWindow" + _itemEditorIndex,
                Title = "Edit",
                Icon = Icon.NoteEdit,
                Width = 800,
                Height = 400,
                Modal = true,
                Hidden = true,
                Layout = "Fit",
                AutoScroll = true
            };

            Controls.Add(editorWindow);

            // Item Editor

            ItemEditView itemEditor = new ItemEditView();
            itemEditor.ID = ID + "_ie_" + _itemEditorIndex;
            editorWindow.ContentControls.Add(itemEditor);
            itemEditor.CurrentItem = contentItem;

            _itemEditors.Add(itemEditor);

            // Buttons

            Ext.Net.Button saveButton = new Ext.Net.Button
            {
                ID = ID + "btnSave" + _itemEditorIndex,
                Text = "Update",
                Icon = Icon.Disk
            };
            string titleValue = itemEditor.PropertyControls.ContainsKey("Title")
                ? string.Format("Ext.getDom('{0}').value", itemEditor.PropertyControls["Title"].ClientID)
                : "'[No Title]'";
            saveButton.Listeners.Click.Handler = string.Format(@"
                var editorWindow = Ext.getCmp('{0}editorWindow{1}');
                var record = editorWindow.record;
                record.set('Title', {2});
                editorWindow.hide(null);",
                ClientID, _itemEditorIndex, titleValue);
            editorWindow.Buttons.Add(saveButton);

            ++_itemEditorIndex;

            return editorWindow;
        }
Beispiel #29
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="moduleId"></param>
 public virtual void LaunchModule(string moduleId, Window config)
 {
     config.AutoRender = false;
     this.AddScript(string.Format("{0}.getModule({1}).createWindow({2});", this.ClientID, JSON.Serialize(moduleId), config.ToConfig()));
 }
Beispiel #30
0
        public void ShowDialog(string title, string subtitle, string affectedItemIDs)
        {
            var window = new Window
            {
                ID = "deleteDialog",
                Modal = true,
                Width = 500,
                Height = 300,
                Title = title,
                Layout = "fit",
                Maximizable = true
            };

            window.Listeners.Maximize.Fn = "function(el) { var v = Ext.getBody().getViewSize(); el.setSize(v.width, v.height); }";
            window.Listeners.Maximize.Scope = "this";

            FormPanel formPanel = new FormPanel
            {
                BaseCls = "x-plain",
                Layout = "absolute"
            };
            window.Items.Add(formPanel);

            formPanel.ContentControls.Add(new Label
            {
                Html = @"<div class=""x-window-dlg""><div class=""ext-mb-warning"" style=""width:32px;height:32px""></div></div>",
                X = 5,
                Y = 5
            });
            formPanel.ContentControls.Add(new Label
            {
                Html = subtitle,
                X = 42,
                Y = 6
            });

            TabPanel tabPanel = new TabPanel
            {
                ID = "deleteDialog_TabPanel",
                X = 0,
                Y = 42,
                Anchor = "100% 100%",
                AutoTabs = true,
                DeferredRender = false,
                Border = false
            };
            formPanel.ContentControls.Add(tabPanel);

            TreePanel affectedItemsTreePanel = new TreePanel
            {
                Title = "Affected Items",
                AutoScroll = true,
                RootVisible = false
            };
            tabPanel.Items.Add(affectedItemsTreePanel);

            TreeLoader treeLoader = new TreeLoader
            {
                DataUrl = Engine.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(typeof(DeleteUserControl).Assembly,
                    "Zeus.Admin.Plugins.DeleteItem.AffectedItems.ashx")
            };
            affectedItemsTreePanel.Loader.Add(treeLoader);

            treeLoader.Listeners.Load.Fn = "function(loader, node) { node.getOwnerTree().expandAll(); }";

            affectedItemsTreePanel.Root.Add(new AsyncTreeNode
            {
                Text = "Root",
                NodeID = affectedItemIDs,
                Expanded = true
            });

            TreePanel referencingItemsTreePanel = new TreePanel
            {
                Title = "Referencing Items",
                TabTip = "Items referencing the item(s) you're deleting",
                AutoScroll = true,
                RootVisible = false
            };
            tabPanel.Items.Add(referencingItemsTreePanel);

            TreeLoader referencingItemsTreeLoader = new TreeLoader
            {
                DataUrl = Engine.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(typeof(DeleteUserControl).Assembly,
                    "Zeus.Admin.Plugins.DeleteItem.ReferencingItems.ashx")
            };
            referencingItemsTreePanel.Loader.Add(referencingItemsTreeLoader);

            referencingItemsTreePanel.Root.Add(new AsyncTreeNode
            {
                Text = "Root",
                NodeID = affectedItemIDs,
                Expanded = true
            });

            Button yesButton = new Button
            {
                ID = "yesButton",
                Text = "Yes"
            };
            yesButton.Listeners.Click.Handler = string.Format(@"
                stbStatusBar.showBusy('Deleting...');
                {0}.hide();
                Ext.net.DirectMethods.Delete.DeleteItems('{1}',
                {{
                    url : '{2}',
                    success: function() {{ stbStatusBar.setStatus({{ text: 'Deleted Item(s)', iconCls: '', clear: true }}); }}
                }});",
                window.ClientID, affectedItemIDs, Engine.AdminManager.GetAdminDefaultUrl());
            window.Buttons.Add(yesButton);

            window.Buttons.Add(new Button
            {
                ID = "noButton",
                Text = "No",
                Handler = string.Format(@"function() {{ {0}.hide(); }}", window.ClientID)
            });

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
Beispiel #31
0
 protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     foreach (Control control in Controls)
     {
         if (loginForm == null)
         {
             loginForm = control as HtmlForm;
             if (loginForm != null) break;
         }
     }
     if (loginForm == null)
     {
         throw new ArgumentException("登录页面中至少添加一个服务器端表单");
     }
     window = new Window();
     window.Title = "用户登录";
     window.Closable = false;
     window.Icon = Icon.Key;
     window.Width = 320;
     window.Height = 185;
     formPanel = new FormPanel();
     formPanel.BodyStyle = "padding:20px;";
     formPanel.Layout = "table";
     formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "用户名",
         AllowBlank = false,
         ColSpan = 2,
         Name = "Username"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "密码",
         AllowBlank = false,
         ColSpan = 2,
         InputType = Ext.Net.InputType.Password,
         Name = "Password"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "验证码",
         AllowBlank = false,
         ColSpan = 1,
         InputType = Ext.Net.InputType.Text,
         Name = "VerifyCode"
     });
     imgVerify = new Ext.Net.Image()
     {
         Width = 100,
         ImageUrl = "login.aspx?action=VerifyImage",
         Height = 22,
         ColSpan = 1,
         ID = "imgVerify"
     };
     formPanel.Items.Add(imgVerify);
     window.Items.Add(formPanel);
     loginForm.Controls.Add(window);
     btnChangeImage = new Ext.Net.Button();
     btnChangeImage.Text = "更换验证码";
     btnChangeImage.OnClientClick = "App.direct.ChangeImage();";
     window.Buttons.Add(btnChangeImage);
     btnLogin = new KeyGoButton();
     btnLogin.Text = "登录";
     btnLogin.ID = "btnLogin";
     btnLogin.OnClientClick = "App.direct.Login();";
     window.Buttons.Add(btnLogin);
 }