Exemple #1
0
        public WebReply DocumentSearch()
        {
            Section Search = Sys.RenderSection("Document Search", "Documents", 1, this, SystemObject.SectionMode.Search);
            GodEdit geBtnB = Search.AddButton("btnSearch", "Search");

            return(Search.Render(this, true));
        }
Exemple #2
0
        public WebReply TicketSearch()
        {
            Section TicketSearch = Sys.RenderSection("Ticket Search", "Ticket", 1, this, SystemObject.SectionMode.Search);
            GodEdit geBtnB       = TicketSearch.AddButton("btnSearch", "Search");

            return(TicketSearch.Render(this, true));
        }
Exemple #3
0
        public GodEdit AddButton(string sButtonName, string sButtonCaption)
        {
            GodEdit b = new GodEdit(Name, GodEdit.GEType.Button, sButtonName, sButtonCaption, Sys);

            this.AddControl(b);
            return(b);
        }
Exemple #4
0
        public WebReply TicketList_AddNew()
        {
            Section  TicketAdd = Sys.RenderSection("Ticket View", "Ticket", 1, this, SystemObject.SectionMode.Add);
            GodEdit  geBtnB    = TicketAdd.AddButton("btnSave", "Save");
            WebReply ta        = TicketAdd.Render(this, true);

            return(ta);
        }
Exemple #5
0
        public WebReply MainMenu()
        {
            Section s1      = new Section("Admin", 1, Sys, this);
            GodEdit geLink1 = new GodEdit("Admin", GodEdit.GEType.Anchor, "LinkSettings", "Settings", Sys);

            s1.AddControl(geLink1);
            return(s1.Render(this, false));
        }
Exemple #6
0
        public GodEdit AddTextbox(string sTextBoxName, string sCaption)
        {
            GodEdit geText = new GodEdit(Name, sTextBoxName, Sys);

            geText.CaptionText = sCaption;
            this.AddControl(geText);
            return(geText);
        }
Exemple #7
0
        public WebReply DocumentAdd()
        {
            Section Add       = Sys.RenderSection("Document Add", "Documents", 1, this, SystemObject.SectionMode.Edit);
            GodEdit ctlUpload = new GodEdit("Document Add", GodEdit.GEType.UploadControl, "btnSave", "Save", Sys);

            ctlUpload.Id         = this.ViewGuid;
            ctlUpload.ParentGuid = this.ParentID;
            Add.AddControl(ctlUpload);
            return(Add.Render(this, true));
        }
Exemple #8
0
        public void AddControl(Object o)
        {
            GodEdit ge = (GodEdit)o;

            if (_controls.ContainsKey(ge.Name))
            {
                return;
            }

            _controls.Add(ge.Name, ge);
        }
Exemple #9
0
        public WebReply Phase3()
        {
            Section s = new Section("Phase3", 3, Sys, this);

            if (Sys.GetObjectValue("Phase3", "ConditionCount") == "")
            {
                Sys.SetObjectValue("Phase3", "ConditionCount", "1");
            }

            int iConditionCount = Convert.ToInt32(Sys.GetObjectValue("Phase3", "ConditionCount"));

            for (int x = 0; x < iConditionCount; x++)
            {
                GodEdit ddFields = new GodEdit("Phase3", "Fields" + x.ToString(), Sys);
                ddFields.Type         = GodEdit.GEType.Lookup;
                ddFields.CaptionText  = "Field:";
                ddFields.LookupValues = ddFields.ConvertStringToLookupList("Address;City;State;Zip;Phone");
                s.AddControl(ddFields);
                string sValueOfFieldsControl = Sys.GetObjectValue("Phase3", "Fields" + x.ToString());

                GodEdit ddConditions = new GodEdit("Phase3", "Conditions" + x.ToString(), Sys);
                ddConditions.Type        = GodEdit.GEType.Lookup;
                ddConditions.CaptionText = "Conditions:";


                ddConditions.LookupValues = new List <SystemObject.LookupValue>();


                SystemObject.LookupValue i1 = new SystemObject.LookupValue();
                i1.ID      = "Underlying ID";
                i1.Value   = "DisplayValue";
                i1.Caption = "Caption";
                string sValueOfLookup = Sys.GetObjectValue("Phase3", "Conditions" + x.ToString());
                ddConditions.LookupValues.Add(i1);

                SystemObject.LookupValue i2 = new SystemObject.LookupValue();
                i2.ID      = "Underlying ID2";
                i2.Value   = "DisplayValueTwo";
                i2.Caption = "CaptionTwo";
                ddConditions.LookupValues.Add(i2);
                s.AddControl(ddConditions);
                GodEdit txtValue = new GodEdit("Phase3", "SelectedValue" + x.ToString(), Sys);
                txtValue.Type        = GodEdit.GEType.Text;
                txtValue.CaptionText = "Selected Value:";
                string sValueOfSelected = Sys.GetObjectValue("Phase3", "SelectedValue" + x.ToString());
                s.AddControl(txtValue);
            }
            s.AddButton("btnAddCondition", "Add Condition");
            WebReply wr1 = s.Render(this, true);

            return(wr1);
        }
Exemple #10
0
        public WebReply btnLightbox_Click()
        {
            Section s = new Section("Lightbox", 1, Sys, this);
            GodEdit g = new GodEdit("Lightbox", GodEdit.GEType.Lightbox, Sys);

            g.Name        = "Lightbox";
            g.CaptionText = "Open";
            g.URL         = "images/Data.png";
            s.AddControl(g);
            WebReply wr1 = s.Render(this, true);

            return(wr1);
        }
Exemple #11
0
        public WebReply PictureGallery()
        {
            string    sql  = "Select ID from Picture where Picture.Organization='" + Sys.Organization.ToString() + "' and Picture.Deleted=0";
            DataTable dt   = Sys._data.GetDataTable(sql);
            string    html = "<DIV>";

            for (int iRows = 0; iRows < dt.Rows.Count; iRows++)
            {
                string sURL = Sys.GetPictureURL(dt.Rows[iRows]["id"].ToString());
                string cell = "<a id=PV name=PV data-featherlight='" + sURL + "'><img width=150 height=150 src='" + sURL + "' /></a>&nbsp;";
                html += cell;
            }
            html += "</DIV>";

            Section s = new Section("Picture Gallery", 1, Sys, this);
            GodEdit g = new GodEdit("PictureGallery", GodEdit.GEType.HTML, Sys);

            g.Name = "pg1";
            g.HTML = html;
            s.AddControl(g);
            return(s.Render(this, false));
        }
Exemple #12
0
        public WebReply CreateYesNoDialog(string sSectionName, string sDialogID, string sYesID, string sNoID, string Title, string Body, object Caller)
        {
            GodEdit btnYes = new GodEdit(sSectionName, GodEdit.GEType.Button, sYesID, "Yes", Sys);

            btnYes.IsInDialog = true;
            btnYes.DialogName = sDialogID;
            string  sBtnYes = btnYes.Render(Caller).Packages[0].HTML;
            GodEdit btnNo   = new GodEdit(sSectionName, GodEdit.GEType.Button, sNoID, "No", Sys);

            btnNo.IsInDialog = true;
            btnNo.DialogName = sDialogID;
            string sBtnNo   = btnNo.Render(Caller).Packages[0].HTML;
            string sButtons = "<table><tr><td>" + sBtnYes + "</td><td>" + sBtnNo + "</td></tr></table>";
            string sHidden  = "<input type='hidden' id='hdialog' name='hdialog' value='hdialog'>";
            string sHTML    = "<div id='" + sDialogID + "' title='" + Title + "'>"
                              + "<p><span class='ui-icon ui-icon-circle-check' style='float:left; margin:0 7px 50px 0;'></span>"
                              + Body + " </p><p>" + sButtons + "</p>" + sHidden + "<p></div>";
            string   sOpt        = "var opt = {        autoOpen: false,        modal: true,        width: 550,        height:350,        title: '" + sDialogID + "' };";
            string   sJavascript = sOpt + " var theDialog = $('#" + sDialogID + "').dialog(opt); theDialog.dialog('open');";
            WebReply wr          = new WebReply(sHTML, sJavascript, sSectionName, true);

            return(wr);
        }
Exemple #13
0
        public WebReply LinkSettings_Click()
        {
            Section s1        = new Section("SettingsEdit", 2, Sys, this);
            GodEdit ddContext = new GodEdit("SettingsEdit", "Context", Sys);

            ddContext.Type         = GodEdit.GEType.Lookup;
            ddContext.CaptionText  = "Context:";
            ddContext.LookupValues = Sys.BindColumn("Setting", "Context", "");
            s1.AddControl(ddContext);
            GodEdit ddName = new GodEdit("SettingsEdit", "Name", Sys);

            ddName.Type        = GodEdit.GEType.Lookup;
            ddName.CaptionText = "Name:";
            string sSelectedContext = Sys.GetObjectValue("SettingsEdit", "Context");
            string sWhere           = "Context='" + sSelectedContext + "'";

            ddName.LookupValues = Sys.BindColumn("Setting", "Name", sWhere);
            s1.AddControl(ddName);
            string sSelectedName = Sys.GetObjectValue("SettingsEdit", "Name");
            string sSql          = "Select Value from Setting where Context='" + sSelectedContext + "' and Name='" + sSelectedName + "'";

            System.Data.DataTable dt1 = Sys._data.GetDataTable(sSql);
            string sValue             = "";

            if (dt1.Rows.Count > 0)
            {
                sValue = dt1.Rows[0][0].ToString();
            }

            GodEdit txtValue = new GodEdit("SettingsEdit", "Value", Sys);

            txtValue.CaptionText  = "Value:";
            txtValue.TextBoxValue = sValue;
            s1.AddControl(txtValue);
            return(s1.Render(this, true));
        }
Exemple #14
0
        public WebReply btnRegister_Click()
        {
            Section Reg        = new Section("Register", 1, Sys, this);
            GodEdit geUsername = new GodEdit("Register", "Username", Sys);

            geUsername.CaptionText = "User Name:";
            Reg.AddControl(geUsername);
            GodEdit gePassword = new GodEdit("AccountEdit", GodEdit.GEType.Password, "Password", "Password:"******"AccountEdit", "Caption1") == String.Empty)
            {
                gePassword.ErrorText = "Invalid Username or Password";
            }

            GodEdit geEmail = new GodEdit("AccountEdit", "Email", Sys);

            geEmail.CaptionText = "Email:";
            Reg.AddControl(geEmail);
            GodEdit geBtnReg = new GodEdit("Register", GodEdit.GEType.Button, "btnRegisterSave", "Register", Sys);

            Reg.AddControl(geBtnReg);
            return(Reg.Render(this, true));
        }
Exemple #15
0
        public WebReply Render(object caller, bool ClearScreen)
        {
            string     myClass    = caller.GetType().ToString();
            StackTrace stackTrace = new StackTrace();

            StackFrame[] stackFrames  = stackTrace.GetFrames();
            StackFrame   callingFrame = stackFrames[1];
            MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
            string       sMyMethod    = method.Name;
            // Button for Expand-Collapse
            string sExpandedClass = Expanded ? "icon-minus" : "icon-plus";

            sExpandedClass = Expanded ? "icon-chevron-up" : "icon-chevron-down";
            string sExpandButton = GetHeaderButton("expand", myClass, sMyMethod, sExpandedClass);
            string sEditButton   = "";

            if (SecMode == SystemObject.SectionMode.View)
            {
                sEditButton = GetHeaderButton("edit", myClass, sMyMethod + "_EditClick", "icon-pencil");
            }

            string sButtons = sExpandButton + sEditButton;
            // Button for Edit
            string divname      = this.Name;
            string sNarrative   = "";
            string sBorderStyle = "";
            string sFrameStyle  = "";

            if (SecMode == SystemObject.SectionMode.View)
            {
                sNarrative = "View";
            }
            else if (SecMode == SystemObject.SectionMode.Add)
            {
                sNarrative = "Add";
            }
            else if (SecMode == SystemObject.SectionMode.Edit)
            {
                sNarrative = "Edit";
            }
            else if (SecMode == SystemObject.SectionMode.Customize)
            {
                sNarrative = "Customize";
            }
            string FriendlyName = this.Name;

            if (!this.MaskSectionMode)
            {
                FriendlyName += " <font size=1>[" + sNarrative + "]</font>";
            }


            string sDivClass = "class='dragContent'";

            if (SecMode == SystemObject.SectionMode.Customize)
            {
                sBorderStyle = "style='border-top: solid 1px; border-bottom:solid 1px; border-left: solid 1px; border-right:solid 1px;'";
            }
            else
            {
                sFrameStyle = "frame=box";
            }


            // CONTEXT MENU
            AddContextMenuitem("Customize", "Customize", "Customize");


            string htmlCMI = "";

            foreach (Weblist.ContextMenuItem cm1 in listContextMenuItems)
            {
                string sRow = "";
                sRow     = "   \"" + cm1.Name + "\": {name: \"" + cm1.Caption + "\", icon: \"" + cm1.Caption + "\"},";
                htmlCMI += sRow;
            }

            string sContextMenuCssClass = "context-menu-" + CleanName(divname);



            string sOut = "<div id='" + divname + "' " + sDivClass + " name='" + divname + "'><table " + sBorderStyle + " class='" + sContextMenuCssClass + "' " + sFrameStyle + " cellspacing=5 cellpadding=5 width=100%>"
                          + "<tr><th colspan=10 cellpadding=0 cellspacing=0 style='border-bottom: grey thin solid' class='ui-dialog-titlebar ui-corner-all ui-widget-header'>"
                          + "<span class='ui-dialog-title'>" + FriendlyName + "</span>" + sButtons + "</th></tr>";

            string javascript = "";

            if (htmlCMI.Length > 0)
            {
                htmlCMI = htmlCMI.Substring(0, htmlCMI.Length - 1);
            }
            string sContextEvent = " onclick=postdiv(this,'contextmenu','" + myClass + "','" + sMyMethod + "_ContextMenu_'+key,'');";
            string sContextMenu  = "  $(function() {   $.contextMenu({     selector: '." + sContextMenuCssClass + "',        callback: function(key, options) { " +
                                   "       " + sContextEvent + "            },"
                                   + "       items: {  " + htmlCMI + "                     }                    });"
                                   + "       $('." + sContextMenuCssClass + "').on('click', function(e){      console.log('clicked', this);        })        });";



            javascript += sContextMenu;

            int iCurCol       = 0;
            int iCurCellCount = 0;
            int iCurRowCount  = 0;

            if (Expanded)
            {
                foreach (KeyValuePair <string, object> entry in _controls)
                {
                    GodEdit ge = (GodEdit)entry.Value;
                    if (iCurCol == 0)
                    {
                        sOut += "<TR>";
                    }

                    WebReply wr          = ge.Render(caller);
                    string   sDivWrapper = "divWrapper" + Guid.NewGuid().ToString();

                    if (SecMode == SystemObject.SectionMode.Customize)
                    {
                        string sObject = ge.CaptionText + ": " + ge.TextBoxValue;
                        string susgdid = Guid.NewGuid().ToString();
                        string sCoords = "coords" + iCurCol.ToString() + "-" + iCurRowCount.ToString();
                        sOut += "<td " + sBorderStyle + "><span usgdid='z" + susgdid + "' usgdname='" + sCoords + "' usgdcaption='" + sCoords + "'></span><div class='drag1'>"
                                + "<span usgdcaption='" + ge.CaptionText + "' usgdname='" + ge.Name + "' usgdid='" + susgdid
                                + "' usgdvalue='" + ge.TextBoxValue + "' >" + sObject + "&nbsp;</span></div></td>";
                    }
                    else
                    {
                        sOut += "<td>" + wr.Packages[0].HTML + "</td>";
                    }
                    javascript += wr.Packages[0].Javascript;
                    iCurCol++;
                    iCurCellCount++;
                    if (iCurCol == ColumnCount)
                    {
                        if (iCurRowCount == 0)
                        {
                            if (DisplayPictureHTML != null)
                            {
                                sOut += "<td rowspan=5>" + DisplayPictureHTML + "</TD>";
                            }
                        }

                        iCurRowCount++;
                        sOut   += "</TR>";
                        iCurCol = 0;
                    }
                }
            }

            sOut += "</TR>";
            sOut += "</table></div><p>";
            WebReply wr1 = new WebReply();

            string sIdentifier         = "USGDrag";
            string sEvent              = "alert('test');";
            string sJavaEventAfterDrop = "  var sOut=''; $(this).closest('table').find('span').each(function (index) "
                                         + "        {        var sUSGDID = $(this)[0].getAttribute('usgdid'); "
                                         + "                 var sUSGDValue = $(this)[0].getAttribute('usgdvalue'); "
                                         + "                 var sUSGDCaption = $(this)[0].getAttribute('usgdcaption'); "
                                         + "                 var sUSGDName = $(this)[0].getAttribute('usgdname'); "
                                         + "        var s = $(this)[0].name + '[COL]' + $(this)[0].value + '[COL]' + sUSGDID + '[COL]' + sUSGDValue + '[COL]' + sUSGDCaption + '[COL]' + sUSGDName + '[ROW]';"
                                         + "      if (sUSGDID != null) {  if (sUSGDID.length > 0)   sOut += s;  }  }); ";

            string sDropEvent = sJavaEventAfterDrop + "postdiv(this,'dropevent','" + myClass + "','" + sMyMethod + "','[DROPPABLE]"
                                + divname + "[/DROPPABLE][DATA]' + sOut + '[/DATA]');";


            string DraggableJavascript = "     $('.drag1').draggable({  "
                                         + "    helper: 'clone',        start: function(event, ui)"
                                         + "    {            c.tr = this;                c.helper = ui.helper;            }    });"
                                         + "   $('.drag1').droppable({     drop: function(event, ui) {     "
                                         + "  "
                                         + "   $(c.helper).remove();        }     });";

            DraggableJavascript = " var myDraggedObject = null; $(function() { $( '.drag1' ).draggable({containment:parent});  }); ";
            DraggableJavascript = "var myDraggedObject = null; var myOriginalHTML = null; $('.drag1').draggable(  "
                                  + "{ revert: function(droppableContainer) {         if(droppableContainer) { var thisisvalid='valid';    }       else {        myDraggedObject.innerHTML=myOriginalHTML;     } } ,"
                                  + "      helper: 'clone', "
                                  + "      containment: '.dragContent', cursor:'move', snap: true, snapMode: 'inner',"
                                  + "     start: function(event, ui)   {  myDraggedObject = this; this.setAttribute('usgdname','test'); "
                                  + "       myOriginalHTML = myDraggedObject.innerHTML; myDraggedObject.setAttribute('usgdname','bye3');  "
                                  + "       myDraggedObject.innerHTML ='&nbsp;';      }   });  "
                                  + "                $('.drag1').droppable(  {drop: function(event, ui) { ui.helper[0].innerHTML='bye'; myDraggedObject.innerHTML = myOriginalHTML; ui.draggable.detach().appendTo($(this));   " + sDropEvent + "  }     }); ";

            if (SecMode == SystemObject.SectionMode.Customize)
            {
                javascript += DraggableJavascript;
            }
            wr1.AddWebReply(sOut, javascript, Name, false);
            WebReplyPackage wrp1 = wr1.Packages[0];

            wrp1.ClearScreen = ClearScreen;
            wr1.Packages[0]  = wrp1;
            return(wr1);
        }
Exemple #16
0
        public WebReply LoginSection()
        {
            // BIBLEPAY ACCOUNTABILITY
            if (HttpContext.Current.Request.Url.ToString().ToUpper().Contains("ACCOUNTABILITY"))
            {
                Login l     = new Login(Sys);
                bool  bAuth = l.VerifyUser("guest", "guest", ref Sys, false);
                // Start at the expense View Page when coming in from the Wallet accountability button
                Home h = new Home(Sys);
                return(h.ExpenseList());
            }


            Section Login      = new Section("Login", 3, Sys, this);
            GodEdit geUserName = new GodEdit("Login", "Username", Sys);

            geUserName.CaptionText = "Username:"******"width=140px";
            Login.AddControl(geUserName);
            GodEdit geBR1 = new GodEdit("Login", GodEdit.GEType.HTML, "br1", "br1", Sys);

            Login.AddControl(geBR1);
            GodEdit geBR2 = new GodEdit("Login", GodEdit.GEType.HTML, "br2", "br2", Sys);

            Login.AddControl(geBR2);
            Login.AddControl(geBR1);
            GodEdit gePassword = new GodEdit("Login", GodEdit.GEType.Password, "Password", "Password:"******"Login", "Caption1") == String.Empty)
            {
                gePassword.ErrorText = "Invalid Username or Password";
            }
            GodEdit geBR3 = new GodEdit("Login", GodEdit.GEType.HTML, "br3", "br3", Sys);

            Login.AddControl(geBR3);
            GodEdit geBR4 = new GodEdit("Login", GodEdit.GEType.HTML, "br4", "br4", Sys);

            Login.AddControl(geBR4);

            GodEdit geBtnLogin = new GodEdit("Login", GodEdit.GEType.DoubleButton, "btnLogin", "Login", Sys);

            geBtnLogin.Name2        = "btnLogout";
            geBtnLogin.CaptionText2 = "Logout";
            Login.AddControl(geBtnLogin);

            GodEdit geBtnRegister = new GodEdit("Login", GodEdit.GEType.DoubleButton, "btnRegister", "Register", Sys);

            geBtnRegister.MaskBeginTD = true;
            geBtnRegister.MaskEndTD   = true;

            geBtnRegister.Name2        = "btnResetPassword";
            geBtnRegister.CaptionText2 = "Reset Password";
            Login.AddControl(geBtnRegister);


            // New Row, and global caption:
            GodEdit geTR3 = new GodEdit("Login", GodEdit.GEType.TableRow, "Tr3", "", Sys);

            Login.AddControl(geTR3);
            GodEdit geSpan = new GodEdit("Login", GodEdit.GEType.Caption, "Caption1", "", Sys);

            Login.AddControl(geSpan);
            Sys.SetObjectValue("", "ApplicationMessage", "Login");
            return(Login.Render(this, true));
        }