Exemple #1
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);
            }
        }
Exemple #2
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();
        }
Exemple #6
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();
 }
        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);
        }
        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 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();
            }
        }
Exemple #10
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);
        }
Exemple #11
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);

        }
        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();
                }
            }
        }
        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();
        }
        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();
            }
        }