示例#1
0
        public void OnUpdateModelPositions(Editing.TerrainChangeParameters parameters)
        {
            if (mAsyncLoaded == false || AreaFile.IsValid == false || mSyncLoaded == false)
                return;

            AreaFile.OnUpdateModelPositions(parameters);
        }
示例#2
0
        public void OnTextureChange(Editing.TextureChangeParameters parameters)
        {
            if (mAsyncLoaded == false || AreaFile.IsValid == false || mSyncLoaded == false)
                return;

            AreaFile.OnTextureTerrain(parameters);
        }
示例#3
0
 public void NavigateToLibrary()
 {
     Edit.Visibility = Visibility.Collapsed;
     ContentGridView.Visibility = Visibility.Visible;
     MetaEdit.Visibility = Visibility.Collapsed;
     currentlyEditing = Editing.None;
     ImagePopup.IsOpen = false;
     Header.header.ResetEditButton();
     Header.header.ResetMetaEditButton();
 }
示例#4
0
        public void OnEditTerrain(Editing.TerrainChangeParameters parameters)
        {
            // ReSharper disable once InconsistentlySynchronizedField
            foreach (var pair in mAreas)
                pair.Value.OnTerrainChange(parameters);

            if(parameters.AlignModels)
            {
                foreach (var pair in mAreas)
                    pair.Value.OnUpdateModelPositions(parameters);
            }
        }
示例#5
0
        public void OnTerrainChange(Editing.TerrainChangeParameters parameters)
        {
            if (mAsyncLoaded == false || AreaFile.IsValid == false || mSyncLoaded == false)
                return;

            mIsDirty = AreaFile.OnChangeTerrain(parameters);
            if (!mIsDirty)
                return;

            mBoundingBox = AreaFile.BoundingBox;
            foreach (var chunk in mChunks)
            {
                if (chunk == null) continue;

                chunk.UpdateBoundingBox();
            }
        }
示例#6
0
 public void NavigateToEditing(Picture sentPicture)
 {
     currentlyEditing = Editing.Picture;
     ContentGridView.Visibility = Visibility.Collapsed;
     GridViewNav.Visibility = Visibility.Collapsed;
     Edit.Visibility = Visibility.Visible;
     MetaEdit.Visibility = Visibility.Collapsed;
     EditObject.Source = sentPicture.ImageSource;
     editImage = new EditCurrentImage(EditObject, sentPicture.Id, sentPicture.ImageSource);
     EditObject.Clip = null;
     EditObject.RenderTransformOrigin = new Point(0.5, 0.5);
     EditObject.RenderTransform = new RotateTransform() { CenterX = 0.5, CenterY = 0.5, Angle = 0 };
     ApplyEdit.IsEnabled = false;
     CropButton.IsEnabled = true;
     ApplyEdit.Label = "Lagre";
     ImagePopup.IsOpen = false;
     Header.header.ResetEditButton();
 }
示例#7
0
        public virtual bool OnTerrainChange(Editing.TerrainChangeParameters parameters)
        {
            var diffVec = new Vector2(mMidPoint.X, mMidPoint.Y) - new Vector2(parameters.Center.X, parameters.Center.Y);
            var dsquare = Vector2.Dot(diffVec, diffVec);

            var maxRadius = parameters.OuterRadius + Metrics.ChunkRadius;

            if (dsquare > maxRadius * maxRadius)
                return false;

            // always update the normals if we are closer than ChunkRadius to the modified area
            // since nearby changes might affect the normals of this chunk even if the positions
            // them self didn't change
            mUpdateNormals = true;

            var changed = false;
            switch (parameters.Method)
            {
                case Editing.TerrainChangeType.Elevate:
                    changed = HandleElevateTerrain(parameters);
                    break;

                case Editing.TerrainChangeType.Flatten:
                    changed = HandleFlatten(parameters);
                    break;

                case Editing.TerrainChangeType.Blur:
                    changed = HandleBlur(parameters);
                    break;

                case Editing.TerrainChangeType.Shading:
                    changed = HandleMccvPaint(parameters);
                    break;
            }

            return changed;
        }
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            if (!String.IsNullOrEmpty(ErrorMsg))
            {
                writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
            }

            if (DataUpdated)
            {
                writer.Append("<p align=\"left\"><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
            }

            if (AppLogic.NumLocaleSettingsInstalled() > 1)
            {
                writer.Append("<script type='text/javascript' src='Scripts/tabs.js'></script>");
            }

            if (!String.IsNullOrEmpty(ErrorMsg))
            {
                ltContent.Text = writer.ToString();
                return;
            }

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from ShippingMethod   with (NOLOCK)  where ShippingMethodID=" + ShippingMethodID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (Editing)
                    {
                        writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editshippingmethod.EditingShippingMethod", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "ShippingMethodID").ToString()) + "<br/><br/></b>\n");
                    }
                    else
                    {
                        writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editshippingmethod.AddNewShippingMethod", SkinID, LocaleSetting) + ":</div><br/></b>\n");
                    }

                    writer.Append("<script type=\"text/javascript\">\n");
                    writer.Append("function ShippingMethodForm_Validator(theForm)\n");
                    writer.Append("{\n");
                    writer.Append("submitonce(theForm);\n");
                    writer.Append("return (true);\n");
                    writer.Append("}\n");
                    writer.Append("</script>\n");

                    writer.Append("<p>" + AppLogic.GetString("admin.editshippingmethod.ShippingMethodInfo", SkinID, LocaleSetting) + "</p>\n");
                    writer.Append("<form action=\"" + AppLogic.AdminLinkUrl("editshippingmethod.aspx") + "?ShippingMethodID=" + ShippingMethodID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"ShippingMethodForm\" name=\"ShippingMethodForm\" onsubmit=\"return (validateForm(this) && ShippingMethodForm_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                    writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                    writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                    writer.Append("              <tr valign=\"middle\">\n");
                    writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                    writer.Append("                </td>\n");
                    writer.Append("              </tr>\n");
                    writer.Append("              <tr valign=\"middle\">\n");
                    writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.common.Name", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                    writer.Append("                <td align=\"left\" valign=\"top\">\n");
                    if (DB.RSFieldBool(rs, "IsRTShipping"))
                    {
                        writer.Append(DB.RSFieldByLocale(rs, "Name", LocaleSetting));
                    }
                    else
                    {
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editshippingmethod.EnterShippingMethod", SkinID, LocaleSetting), 100, 30, 0, 0, false));
                    }

                    writer.Append("                	</td>\n");
                    writer.Append("              </tr>\n");

                    if (AppLogic.AppConfigBool("ShipRush.Enabled"))
                    {
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editshippingmethod.ShipRushTemplate", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\">\n");
                        writer.Append("                	<input maxLength=\"100\" size=\"50\" name=\"ShipRushTemplate\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "ShipRushTemplate")), "") + "\"> " + AppLogic.GetString("admin.editshippingmethod.Sample", SkinID, LocaleSetting) + "\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");
                    }
                }
            }

            if (MultiStoreFilteringEnabled)
            {
                List <int> mappedStoreIds = new List <int>();
                string     mappingQuery   = string.Format("SELECT StoreId FROM ShippingMethodStore WITH (NOLOCK) WHERE ShippingMethodId = {0}", ShippingMethodID);

                if (Editing)
                {
                    using (SqlConnection conn = new SqlConnection(DB.GetDBConn()))
                    {
                        conn.Open();

                        using (IDataReader rsMap = DB.GetRS(mappingQuery, conn))
                            while (rsMap.Read())
                            {
                                mappedStoreIds.Add(rsMap.FieldInt("StoreId"));
                            }
                    }
                }

                writer.Append("              <tr valign=\"middle\">\n");
                writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">" + AppLogic.GetString("admin.editshippingmethod.MappedStores", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                writer.Append("                <td align=\"left\">\n");

                foreach (var store in Store.GetStoreList())
                {
                    bool   alreadyMapped = Editing && mappedStoreIds.Contains(store.StoreID);
                    string html          = string.Format("<input type=\"checkbox\" name=\"chkStoreMap_{0}\" value=\"{1}\" {2} /> {1}\n", store.StoreID, HttpUtility.HtmlEncode(store.Name), alreadyMapped ? "checked" : string.Empty);
                    writer.Append(html + "<br />");
                }

                writer.Append("                	</td>\n");
                writer.Append("              </tr>\n");
            }


            writer.Append("<tr>\n");
            writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");

            string backText = string.Empty;

            if (Editing)
            {
                writer.Append("<input class=\"normalButtons\" type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                backText = AppLogic.GetString("admin.common.Back", SkinID, LocaleSetting);
            }
            else
            {
                writer.Append("<input type=\"submit\" class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                backText = AppLogic.GetString("admin.common.Cancel", SkinID, LocaleSetting);
            }

            string backLink = string.Format("&nbsp;<a href=\"" + AppLogic.AdminLinkUrl("shippingmethods.aspx") + "?storeid={0}\">{1}</a>", StoreFilter, backText);

            writer.Append(backLink);

            writer.Append("        </td>\n");
            writer.Append("      </tr>\n");
            writer.Append("  </table>\n");
            writer.Append("</form>\n");

            ltContent.Text = writer.ToString();
        }
示例#9
0
        private async void GridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            Picture sentPicture = (Picture)e.ClickedItem;
            if (sentPicture.ImageSource == null)
            {
                sentPicture.ImageSource = await Pictures.getFullImage(sentPicture.Id);
            }

            if (clickedExport)
            {
                var imageString = await SharedFunctions.RunHttpRequestWithStringReturn(new Uri("http://" + serverIP + "/server/requestHandler.php?operation=getImage&id=" + sentPicture.Id));
                var data = Convert.FromBase64String(imageString);
                var file = await (new PicturePicker()).saveFile(".jpg");
                if (file != null)
                {
                    using (var targetStream = await file.OpenAsync(FileAccessMode.ReadWrite))
                    {
                        await targetStream.AsStreamForWrite().WriteAsync(data, 0, data.Length);
                        await targetStream.FlushAsync();
                    }
                }
                clickedExport = false;
                Header.header.ResetExportButton();
            }
            else
            {
                if (currentlyEditing == Editing.None)
                {
                    if (Header.header.GetEditTag() == "1")
                    {
                        NavigateToEditing(sentPicture);
                    }
                    else if (Header.header.GetEditMetaTag() == "1")
                    {
                        NavigateToMetaEditing(sentPicture);
                    }
                    else
                    {
                        // Display popup with image and non-editable data
                        currentlyEditing = Editing.None;
                        PopupImage.Source = sentPicture.ImageSource;
                        currentlyViewing = sentPicture;
                        
                        PopupImage.MaxHeight = 0.9 * ContentGridView.ActualHeight;
                        PopupImage.MaxWidth = 0.9 * ContentGridView.ActualWidth;

                        PopupImage.Height = sentPicture.ImageSource.PixelHeight;

                        try { PopupCityBlock.Text = sentPicture.City; }
                        catch (ArgumentNullException) { PopupCityBlock.Text = "Ingen by funnet"; }
                        try { PopupCountryBlock.Text = sentPicture.Country; }
                        catch (ArgumentNullException) { PopupCountryBlock.Text = "Ingen land funnet"; }
                        try
                        {
                            PopupRatingBlock.Text = "Rating: ";
                            PopupRatingBlock.Text += sentPicture.Rating.Value;
                            PopupRatingBlock.Text += "/6";
                        }
                        catch (Exception) { PopupRatingBlock.Text = "Rating: 0/6"; }
                        try { PopupDateBlock.Text = sentPicture.Date.Value.ToString("yyyy-MM-dd"); }
                        catch (Exception) { PopupDateBlock.Text = "Ingen dato funnet"; }
                        try { PopupTagsBlock.Text = sentPicture.Tags; }
                        catch (ArgumentNullException) { PopupTagsBlock.Text = "Ingen tags funnet"; }
                        ImagePopup.IsOpen = false;
                        ImagePopup.IsOpen = true;
                    }
                }
                else
                {
                    if (Header.header.GetEditTag() == "1")
                    {
                        NavigateToEditing(sentPicture);
                    }
                    else if (Header.header.GetEditMetaTag() == "1")
                    {
                        NavigateToMetaEditing(sentPicture);
                    }
                    else
                    {
                        if (currentlyEditing == Editing.Picture)
                        {
                            NavigateToEditing(sentPicture);
                        }
                        else
                        {
                            NavigateToMetaEditing(sentPicture);
                        }
                    }
                }
            }
        }
示例#10
0
 public abstract void OnUpdateModelPositions(Editing.TerrainChangeParameters parameters);
示例#11
0
        private bool HandleFlatten(Editing.TerrainChangeParameters parameters)
        {
            var radius = parameters.OuterRadius;
            var amount = parameters.Amount / 550.0f;
            if (amount > 1) amount = 1;

            amount = 1 - amount;
            var changed = false;

            for (var i = 0; i < 145; ++i)
            {
                var p = Vertices[i].Position;
                var dist = (new Vector2(p.X, p.Y) - new Vector2(parameters.Center.X, parameters.Center.Y)).Length();
                if (dist > radius)
                    continue;

                changed = true;
                var factor = dist / radius;

                switch (parameters.Algorithm)
                {
                    case Editing.TerrainAlgorithm.Flat:
                        p.Z = amount * p.Z + (1 - amount) * parameters.Center.Z;
                        break;

                    case Editing.TerrainAlgorithm.Linear:
                    {
                        var nremain = 1 - (1 - amount) * (1 - factor);
                        p.Z = nremain * p.Z + (1 - nremain) * parameters.Center.Z;
                        break;
                    }

                    case Editing.TerrainAlgorithm.Quadratic:
                    {
                        var nremain = 1 - (float)Math.Pow(1 - amount, 1 + factor);
                        p.Z = nremain * p.Z + (1 - nremain) * parameters.Center.Z;
                        break;
                    }

                    case Editing.TerrainAlgorithm.Trigonometric:
                    {
                        var nremain = 1 - (1 - amount) * (1 - (float)Math.Cos(factor * Math.PI / 2.0f));
                        p.Z = nremain * p.Z + (1 - nremain) * parameters.Center.Z;
                        break;
                    }
                }

                if (p.Z < mMinHeight)
                    mMinHeight = p.Z;
                if (p.Z > mMaxHeight)
                    mMaxHeight = p.Z;

                Vertices[i].Position = p;
            }

            return changed;
        }
示例#12
0
 protected abstract bool HandleMccvPaint(Editing.TerrainChangeParameters parameters);
示例#13
0
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from News  with (NOLOCK)  where NewsID=" + NewsID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editnews.EditingNews", SkinID, LocaleSetting), DB.RSFieldInt(rs, "NewsID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editnews.AddingNews", SkinID, LocaleSetting) + ":</div><br/></b>\n");
                        }

                        writer.Append("  <!-- calendar stylesheet -->\n");
                        writer.Append("  <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"jscalendar/calendar-win2k-cold-1.css\" title=\"win2k-cold-1\" />\n");
                        writer.Append("\n");
                        writer.Append("  <!-- main calendar program -->\n");
                        writer.Append("  <script type=\"text/javascript\" src=\"jscalendar/calendar.js\"></script>\n");
                        writer.Append("\n");
                        writer.Append("  <!-- language for the calendar -->\n");
                        writer.Append("  <script type=\"text/javascript\" src=\"jscalendar/lang/" + Localization.JSCalendarLanguageFile() + "\"></script>\n");
                        writer.Append("\n");
                        writer.Append("  <!-- the following script defines the Calendar.setup helper function, which makes\n");
                        writer.Append("       adding a calendar a matter of 1 or 2 lines of code. -->\n");
                        writer.Append("  <script type=\"text/javascript\" src=\"jscalendar/calendar-setup.js\"></script>\n");

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        if (AppLogic.NumLocaleSettingsInstalled() > 1)
                        {
                            writer.Append("<script type='text/javascript' src='Scripts/tabs.js'></script>");
                        }

                        writer.Append("<p>" + AppLogic.GetString("admin.editnews.NewsInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editnews.aspx") + "?NewsID=" + NewsID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(document.forms[0]) && Form_Validator(document.forms[0]))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"top\">" + AppLogic.GetString("admin.editnews.Headline", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Headline"), "Headline", false, true, true, AppLogic.GetString("admin.editnews.EnterHeadline", SkinID, LocaleSetting), 100, 50, 0, 0, false));

                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"top\">" + AppLogic.GetString("admin.editnews.NewsCopy", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "NewsCopy"), "NewsCopy", true, true, false, "", 0, 0, AppLogic.AppConfigUSInt("Admin_TextareaHeight"), AppLogic.AppConfigUSInt("Admin_TextareaWidth"), true));

                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*Expiration Date:&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append("                	<input maxLength=\"100\" size=\"30\" name=\"ExpiresOn\" value=\"" + CommonLogic.IIF(Editing, Localization.ToThreadCultureShortDateString(DB.RSFieldDateTime(rs, "ExpiresOn")), Localization.ToThreadCultureShortDateString(System.DateTime.Now.AddMonths(1))) + "\">&nbsp;<img src=\"" + AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/calendar.gif") + "\" class=\"actionelement\" align=\"absmiddle\" id=\"f_trigger_s\">&nbsp; <small>(" + Localization.ShortDateFormat() + ")</small>\n");
                        writer.Append("                	<input type=\"hidden\" name=\"ExpiresOn_vldt\" value=\"[req][blankalert=Please enter the expiration date (e.g. " + Localization.ShortDateFormat() + ")]\">\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.currencies.Published", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetString("admin.common.Yes", SkinID, LocaleSetting) + "&nbsp;<INPUT TYPE=\"RADIO\" NAME=\"Published\" value=\"1\" " + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldBool(rs, "Published"), " checked ", ""), " checked ") + ">\n");
                        writer.Append(AppLogic.GetString("admin.common.No", SkinID, LocaleSetting) + "&nbsp;<INPUT TYPE=\"RADIO\" NAME=\"Published\" value=\"0\" " + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldBool(rs, "Published"), "", " checked "), "") + ">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");


                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");


                        writer.Append("\n<script type=\"text/javascript\">\n");
                        writer.Append("    Calendar.setup({\n");
                        writer.Append("        inputField     :    \"ExpiresOn\",      // id of the input field\n");
                        writer.Append("        ifFormat       :    \"" + Localization.JSCalendarDateFormatSpec() + "\",       // format of the input field\n");
                        writer.Append("        showsTime      :    false,            // will display a time selector\n");
                        writer.Append("        button         :    \"f_trigger_s\",   // trigger for the calendar (button ID)\n");
                        writer.Append("        singleClick    :    true            // double-click mode\n");
                        writer.Append("    });\n");
                        writer.Append("</script>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
示例#14
0
 internal virtual void CancelEdit()
 {
     Debug.Assert(IsEditing);
     Editing.CancelEdit(this);
 }
示例#15
0
 internal virtual RowPresenter EndEdit(bool staysOnInserting = false)
 {
     Debug.Assert(IsEditing);
     return(Editing.EndEdit(this, staysOnInserting));
 }
示例#16
0
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from salesprompt   with (NOLOCK)  where SalesPromptID=" + SalesPromptID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }

                    if (DataUpdated)
                    {
                        writer.Append("<p align=\"left\"><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
                    }



                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editsalesprompt.EditingSalesPrompt", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "SalesPromptID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editsalesprompt.AddNewSalesPrompt", SkinID, LocaleSetting) + ":</div><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        if (AppLogic.NumLocaleSettingsInstalled() > 1)
                        {
                            writer.Append("<script type='text/javascript' src='Scripts/tabs.js'></script>");
                        }

                        writer.Append("<p>" + AppLogic.GetString("admin.editsalesprompt.SalesPromptInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editSalesPrompt.aspx") + "?SalesPromptID=" + SalesPromptID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editsalesprompt.SalesPromptName", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, String.Format(AppLogic.GetString("admin.common.EnterNameParam", SkinID, LocaleSetting), AppLogic.GetString("AppConfig.CategoryPromptSingular", SkinID, LocaleSetting).ToLowerInvariant()), 100, 30, 0, 0, false));

                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
示例#17
0
 public void OnTextureTerrain(Editing.TextureChangeParameters parameters)
 {
     foreach (var pair in mAreas)
         pair.Value.OnTextureChange(parameters);
 }
示例#18
0
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from LocaleSetting   with (NOLOCK)  where LocaleSettingID=" + LocaleSettingID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }

                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editlocalesetting.EditingLocale", SkinID, LocaleSetting), DB.RSField(rs, "Name"), DB.RSFieldInt(rs, "LocaleSettingID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editlocalesetting.AddNewLocale", SkinID, LocaleSetting) + ":<div/><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        writer.Append("<p>" + AppLogic.GetString("admin.editlocalesetting.LocaleInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form action=\"" + AppLogic.AdminLinkUrl("editlocalesetting.aspx") + "?LocaleSettingID=" + LocaleSettingID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("<tr valign=\"middle\">\n");
                        writer.Append("<td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("</td>\n");
                        writer.Append("</tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("</td>\n");
                        writer.Append("</tr>\n");

                        writer.Append("<tr valign=\"middle\">\n");
                        writer.Append("<td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.orderframe.LocaleSetting", SkinID, LocaleSetting) + "&nbsp;&nbsp;</td>\n");
                        writer.Append("<td align=\"left\" valign=\"top\">\n");
                        writer.Append("<input maxLength=\"10\" size=\"10\" name=\"Name\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "Name")), "") + "\"> " + AppLogic.GetString("admin.editlocalesetting.Sample", SkinID, LocaleSetting) + "\n");
                        writer.Append("<input type=\"hidden\" name=\"Name_vldt\" value=\"[req][blankalert=" + AppLogic.GetString("admin.editlocalesetting.EnterLocale", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("</td>\n");
                        writer.Append("</tr>\n");

                        writer.Append("<tr valign=\"middle\">\n");
                        writer.Append("<td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.common.Description", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("<td align=\"left\" valign=\"top\">\n");
                        writer.Append("<input maxLength=\"100\" size=\"50\" name=\"Description\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "Description")), "") + "\"> " + AppLogic.GetString("admin.editlocalesetting.SampleDescription", SkinID, LocaleSetting) + "\n");
                        writer.Append("<input type=\"hidden\" name=\"Description_vldt\" value=\"[req][blankalert=" + AppLogic.GetString("admin.editlocalesetting.EnterDescription", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("</td>\n");
                        writer.Append("</tr>\n");

                        writer.Append("<tr valign=\"middle\">\n");
                        writer.Append("<td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editlocalesetting.DefaultCurrency", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("<td align=\"left\" valign=\"top\">\n");
                        String DefCur = Localization.GetPrimaryCurrency();
                        if (Editing)
                        {
                            DefCur = Currency.GetCurrencyCode(DB.RSFieldInt(rs, "DefaultCurrencyID"));
                        }
                        String CurrencySelectList = Currency.GetSelectList("DefaultCurrency", String.Empty, String.Empty, DefCur);
                        writer.Append(CurrencySelectList);
                        writer.Append("</td>\n");
                        writer.Append("</tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
示例#19
0
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from CreditCardType   with (NOLOCK)  where CardTypeID=" + CardTypeID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        rs.Close();
                        Editing = true;
                    }


                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }
                    if (DataUpdated)
                    {
                        writer.Append("<p align=\"left\"><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editCreditCard.Editing", SkinID, LocaleSetting), DB.RSField(rs, "CardType"), DB.RSFieldInt(rs, "CardTypeID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<b>" + AppLogic.GetString("admin.editCreditCard.AddingCreditType", SkinID, LocaleSetting) + "<br/><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        writer.Append("<p>" + AppLogic.GetString("admin.editCreditCard.EnterCCTypeInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editcreditcard.aspx") + "?CardTypeID=" + CardTypeID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('Do you want to reset all fields to their starting values?');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editCreditCard.CCType", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append("                	<input maxLength=\"100\" size=\"30\" name=\"CardType\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "CardType")), "") + "\">\n");
                        writer.Append("                	<input type=\"hidden\" name=\"CardType_vldt\" value=\"[req][blankalert=" + AppLogic.GetString("admin.editCreditCard.EnterCCType", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
        private void Render()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from SkinPreview   with (NOLOCK)  where SkinPreviewID=" + SkinPreviewID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (AppLogic.NumLocaleSettingsInstalled() > 1)
                    {
                        writer.Append(CommonLogic.ReadFile("jscripts/tabs.js", true));
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p align=\"left\"><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }
                    if (DataUpdated)
                    {
                        writer.Append("<p align=\"left\"><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<p align=\"left\"><b>" + String.Format(AppLogic.GetString("admin.editskinpreview.EditingSkinPreview", SkinID, LocaleSetting), DB.RSField(rs, "Name"), DB.RSFieldInt(rs, "SkinPreviewID").ToString(), DB.RSFieldInt(rs, "SkinID").ToString()) + "</b></p>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"padding-top:5px;height:19px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editskinpreview.AddNewSkinPreview", SkinID, LocaleSetting) + ":</div>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        writer.Append("<p>" + AppLogic.GetString("admin.editskinpreview.SkinPreviewInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editSkinPreview.aspx") + "?GroupName=" + Server.UrlEncode(GroupName) + "&beginsWith=" + Server.UrlEncode(BeginsWith) + "&searchfor=" + Server.UrlEncode(SearchFor) + "&SkinPreviewID=" + SkinPreviewID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">" + AppLogic.GetString("admin.editskinpreview.SkinID", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append("                	<input maxLength=\"10\" size=\"10\" name=\"SkinID\" value=\"" + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldInt(rs, "SkinID") != 0, DB.RSFieldInt(rs, "SkinID").ToString(), ""), "") + "\"> " + AppLogic.GetString("admin.editskinpreview.SpecifySkin", SkinID, LocaleSetting) + "\n");
                        writer.Append("                	<input type=\"hidden\" name=\"SkinID_vldt\" value=\"[req][number][invalidalert=" + AppLogic.GetString("admin.common.ValidIntegerNumberPrompt", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editskinpreview.SkinPreviewName", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");

                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editskinpreview.EnterSkinPreview", SkinID, LocaleSetting), 100, 30, 0, 0, false));

                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editskinpreview.GroupName", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append("                	<input maxLength=\"100\" size=\"50\" name=\"GroupName\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "GroupName")), "") + "\">\n");
                        writer.Append("                	<input type=\"hidden\" name=\"GroupName_vldt\" value=\"[req][blankalert=" + AppLogic.GetString("admin.editskinpreview.EnterSkinPreviewGroup", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("  <tr>\n");
                        writer.Append("    <td valign=\"top\" align=\"right\">" + AppLogic.GetString("admin.common.Icon", SkinID, LocaleSetting) + ":\n");
                        writer.Append("</td>\n");
                        writer.Append("    <td valign=\"top\" align=\"left\">");
                        writer.Append("    <input type=\"file\" name=\"Image1\" size=\"50\" value=\"" + CommonLogic.IIF(Editing, "", "") + "\">\n");
                        String Image1URL = AppLogic.LookupImage("SkinPreviews", SkinPreviewID, "icon", SkinID, LocaleSetting);
                        String clicklink = String.Empty;
                        if (Image1URL.Length != 0)
                        {
                            clicklink = "<a href=\"javascript:void(0);\" onClick=\"DeleteImage('" + Image1URL + "','Pic1');\">Click here</a>";
                            if (Image1URL.IndexOf("nopicture") == -1)
                            {
                                writer.Append(String.Format(AppLogic.GetString("admin.editgallery.DeleteImage", SkinID, LocaleSetting), clicklink) + "<br/>\n");
                            }
                            writer.Append("<br/><img id=\"Pic1\" name=\"Pic1\" border=\"0\" src=\"" + Image1URL + "?" + CommonLogic.GetRandomNumber(1, 1000000).ToString() + "\">\n");
                        }
                        writer.Append("</td>\n");
                        writer.Append(" </tr>\n");

                        writer.Append("  <tr>\n");
                        writer.Append("    <td valign=\"top\" align=\"right\">" + AppLogic.GetString("admin.common.MediumPic", SkinID, LocaleSetting) + ":\n");
                        writer.Append("</td>\n");
                        writer.Append("    <td valign=\"top\" align=\"left\">");
                        writer.Append("    <input type=\"file\" name=\"Image2\" size=\"50\" value=\"" + CommonLogic.IIF(Editing, "", "") + "\">\n");
                        String Image2URL = AppLogic.LookupImage("SkinPreviews", SkinPreviewID, "medium", SkinID, LocaleSetting);
                        if (Image2URL.Length != 0)
                        {
                            clicklink = "<a href=\"javascript:void(0);\" onClick=\"DeleteImage('" + Image2URL + "','Pic2');\">Click here</a>";
                            if (Image2URL.IndexOf("nopicture") == -1)
                            {
                                writer.Append(String.Format(AppLogic.GetString("admin.editgallery.DeleteImage", SkinID, LocaleSetting), clicklink) + "<br/>\n");
                            }
                            writer.Append("<br/><img id=\"Pic2\" name=\"Pic2\" border=\"0\" src=\"" + Image2URL + "?" + CommonLogic.GetRandomNumber(1, 1000000).ToString() + "\">\n");
                        }
                        writer.Append("</td>\n");
                        writer.Append(" </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input class=\"normalButtons\" type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"normalButtons\" type=\"reset\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input class=\"normalButtons\" type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");

                        writer.Append("<script type=\"text/javascript\">\n");

                        writer.Append("function DeleteImage(imgurl,name)\n");
                        writer.Append("{\n");
                        writer.Append("window.open('" + AppLogic.AdminLinkUrl("deleteimage.aspx") + "?imgurl=' + imgurl + '&FormImageName=' + name,\"Admin_ML\",\"height=250,width=440,top=10,left=20,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no\")\n");
                        writer.Append("}\n");

                        writer.Append("</SCRIPT>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
        private void Render()
        {
            StringBuilder writer = new StringBuilder();

            if (!AppLogic.AppConfigBool("TurnOffHtmlEditorInAdminSite"))
            {
                writer.Append("<script language=\"Javascript\" src=\"Editor/scripts/innovaeditor.js\"></script>\n");
            }

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from Gallery   with (NOLOCK)  where GalleryID=" + GalleryID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editgallery.Editing", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "GalleryID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<b>" + AppLogic.GetString("admin.editgallery.AddNewGallery", SkinID, LocaleSetting) + "<br/><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");

                        if (!Editing)
                        {
                            writer.Append("function MakeSafeName(theForm)\n");
                            writer.Append("{\n");
                            writer.Append("var cn = document.Form1.Name.value;\n");
                            writer.Append("var cn2 = stripCharsNotInBag(cn,\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_1234567890\");\n");
                            writer.Append("document.Form1.DirName.value = cn2;\n");
                            writer.Append("document.Form1.DirName.focus();\n");
                            writer.Append("return (true);\n");
                            writer.Append("}\n");
                        }
                        writer.Append("</script>\n");

                        if (AppLogic.NumLocaleSettingsInstalled() > 1)
                        {
                            writer.Append(CommonLogic.ReadFile("jscripts/tabs.js", true));
                        }

                        writer.Append("<p>" + AppLogic.GetString("admin.editgallery.GalleryInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editgallery.aspx") + "?GalleryID=" + GalleryID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(document.forms[0]) && Form_Validator(document.forms[0]))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editgallery.GalleryName", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editgallery.EnterGalleryName", SkinID, LocaleSetting), 100, 30, 0, 0, false));
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editgallery.GalleryDirectory", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        if (!Editing)
                        {
                            writer.Append("                	<input maxLength=\"100\" size=\"30\" name=\"DirName\" value=\"" + CommonLogic.IIF(Editing, Server.HtmlEncode(DB.RSField(rs, "DirName")), "") + "\">\n");
                            writer.Append("                	<input type=\"hidden\" name=\"DirName_vldt\" value=\"[req][blankalert=" + AppLogic.GetString("admin.editgallery.EnterGalleryDirectory", SkinID, LocaleSetting) + "]\">\n");
                        }
                        else
                        {
                            writer.Append(DB.RSField(rs, "DirName"));
                        }
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("    <td valign=\"top\" align=\"right\">Icon:\n");
                        writer.Append("</td>\n");
                        writer.Append("    <td valign=\"top\" align=\"left\">");
                        writer.Append("    <input type=\"file\" name=\"Image1\" size=\"30\" value=\"" + CommonLogic.IIF(Editing, "", "") + "\">\n");
                        String Image1URL = AppLogic.LookupImage("Gallery", GalleryID, "icon", SkinID, LocaleSetting);
                        if (Image1URL.Length != 0)
                        {
                            if (Image1URL.IndexOf("nopicture") == -1)
                            {
                                String clicklink = "<a href=\"javascript:void(0);\" onClick=\"DeleteImage('" + Image1URL + "','GalleryPic');\">Click here</a>";
                                writer.Append(String.Format(AppLogic.GetString("admin.editgallery.DeleteImage", SkinID, LocaleSetting), clicklink) + "<br/>\n");
                            }
                            writer.Append("<br/><img id=\"GalleryPic\" name=\"GalleryPic\" border=\"0\" src=\"" + Image1URL + "?" + CommonLogic.GetRandomNumber(1, 1000000).ToString() + "\">\n");
                        }
                        writer.Append("</td>\n");
                        writer.Append(" </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"top\">Description:&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Description"), AppLogic.GetString("admin.common.Description", SkinID, LocaleSetting), true, true, false, "", 0, 0, AppLogic.AppConfigUSInt("Admin_TextareaHeight"), AppLogic.AppConfigUSInt("Admin_TextareaWidth"), true));

                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function DeleteImage(imgurl,name)\n");
                        writer.Append("{\n");
                        writer.Append("window.open('" + AppLogic.AdminLinkUrl("deleteimage.aspx") + "?imgurl=' + imgurl + '&FormImageName=' + name,\"AspDotNetStorefrontAdmin_ML\",\"height=250,width=440,top=10,left=20,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no\")\n");
                        writer.Append("}\n");
                        writer.Append("</SCRIPT>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
示例#22
0
        private bool HandleBlur(Editing.TerrainChangeParameters parameters)
        {
            var radius = parameters.OuterRadius;
            var amount = parameters.Amount / 550.0f;
            if (amount > 1) amount = 1;

            amount = 1 - amount;
            var changed = false;

            for(var i = 0; i < 145; ++i)
            {
                var p = Vertices[i].Position;
                var dist = (new Vector2(p.X, p.Y) - new Vector2(parameters.Center.X, parameters.Center.Y)).Length();
                if (dist > radius)
                    continue;

                changed = true;
                var totalHeight = 0.0f;
                var totalWeight = 0.0f;
                var rad = (int) (radius / Metrics.UnitSize);
                for(var j = -rad; j <= rad; ++j)
                {
                    var ty = parameters.Center.Y + j * Metrics.UnitSize;
                    for(var k = -rad; k <= rad; ++k)
                    {
                        var tx = parameters.Center.X + k * Metrics.UnitSize;
                        var xdiff = tx - p.X;
                        var ydiff = ty - p.Y;
                        var diff = xdiff * xdiff + ydiff * ydiff;
                        if (diff > radius * radius)
                            continue;

                        float height;
                        if (WorldFrame.Instance.MapManager.GetLandHeight(tx, 64.0f * Metrics.TileSize - ty, out height) ==
                            false)
                            height = p.Z;

                        var dist2 = (float) Math.Sqrt(diff);
                        totalHeight += (1 - dist2 / radius) * height;
                        totalWeight += (1 - dist2 / radius);
                    }
                }

                var h = totalHeight / totalWeight;
                switch(parameters.Algorithm)
                {
                    case Editing.TerrainAlgorithm.Flat:
                        p.Z = amount * p.Z + (1 - amount) * h;
                        break;

                    case Editing.TerrainAlgorithm.Linear:
                    {
                        var nremain = 1 - (1 - amount) * (1 - dist / radius);
                        p.Z = nremain * p.Z + (1 - nremain) * h;
                    }
                        break;

                    case Editing.TerrainAlgorithm.Quadratic:
                    {
                        var nremain = 1 - (float)Math.Pow(1 - amount, 1 + dist / radius);
                        p.Z = nremain * p.Z + (1 - nremain) * h;
                    }
                        break;

                    case Editing.TerrainAlgorithm.Trigonometric:
                    {
                        var nremain = 1 - (1 - amount) * (float)Math.Cos(dist / radius);
                        p.Z = nremain * p.Z + (1 - nremain) * h;
                    }
                        break;
                }

                if (p.Z < mMinHeight)
                    mMinHeight = p.Z;
                if (p.Z > mMaxHeight)
                    mMaxHeight = p.Z;

                Vertices[i].Position = p;
            }

            return changed;
        }
示例#23
0
        private void Render()
        {
            StringBuilder writer = new StringBuilder();

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from QuantityDiscount   with (NOLOCK)  where QuantityDiscountID=" + QuantityDiscountID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }
                    if (DataUpdated)
                    {
                        writer.Append("<p align=\"left\"><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
                    }



                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<b>" + String.Format(AppLogic.GetString("admin.editquantitydiscount.EditingQuantityDiscounts", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "QuantityDiscountID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editquantitydiscount.AddNewQuantityDiscount", SkinID, LocaleSetting) + "</div><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function QuantityDiscountForm_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        writer.Append("<p>" + AppLogic.GetString("admin.editquantitydiscount.QuantityDiscountInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form action=\"" + AppLogic.AdminLinkUrl("editquantitydiscount.aspx") + "?QuantityDiscountID=" + QuantityDiscountID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"QuantityDiscountForm\" name=\"QuantityDiscountForm\" onsubmit=\"return (validateForm(this) && QuantityDiscountForm_Validator(this))\" onReset=\"return confirm('Do you want to reset all fields to their starting values?');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.common.Name", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editquantitydiscount.EnterQuantityDiscount", SkinID, LocaleSetting), 100, 30, 0, 0, false));

                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }
            ltContent.Text = writer.ToString();
        }
示例#24
0
        private bool HandleElevateTerrain(Editing.TerrainChangeParameters parameters)
        {
            var amount = parameters.Amount * (float) parameters.TimeDiff.TotalSeconds;
            var changed = false;
            var radius = parameters.OuterRadius;

            for(var i = 0; i < 145; ++i)
            {
                var p = Vertices[i].Position;
                var dist = (new Vector2(p.X, p.Y) - new Vector2(parameters.Center.X, parameters.Center.Y)).Length();
                if (dist > radius)
                    continue;

                changed = true;
                var factor = dist / radius;

                switch(parameters.Algorithm)
                {
                    case Editing.TerrainAlgorithm.Flat:
                        p.Z += amount * (parameters.Inverted ? -1 : 1);
                        break;

                    case Editing.TerrainAlgorithm.Linear:
                        p.Z += (amount * (1.0f - factor)) * (parameters.Inverted ? -1 : 1);
                        break;

                    case Editing.TerrainAlgorithm.Quadratic:
                        p.Z += (((-amount) / (radius * radius) * (dist * dist)) + amount) * (parameters.Inverted ? -1 : 1);
                        break;

                    case Editing.TerrainAlgorithm.Trigonometric:
                        var cs = Math.Cos(factor * Math.PI / 2);
                        p.Z += (amount * (float) cs) * (parameters.Inverted ? -1 : 1);
                        break;
                }

                if (p.Z < mMinHeight)
                    mMinHeight = p.Z;
                if (p.Z > mMaxHeight)
                    mMaxHeight = p.Z;

                Vertices[i].Position = p;
            }

            return changed;
        }
示例#25
0
        private void RenderHtml()
        {
            StringBuilder writer = new StringBuilder();

            writer.Append("<script type='text/javascript' src='Scripts/tabs.js'></script>");

            if (DataUpdated)
            {
                writer.Append("<p><b><font color=blue>" + AppLogic.GetString("admin.editCreditCard.Updated", SkinID, LocaleSetting) + "</font></b></p>\n");
            }

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from PollAnswer   with (NOLOCK)  where PollAnswerID=" + PollAnswerID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p align=\"left\"><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        writer.Append("<p align=\"left\"><b>" + AppLogic.GetString("admin.editpollanswer.WithinPoll", SkinID, LocaleSetting) + "<a href=\"" + AppLogic.AdminLinkUrl("editPolls.aspx") + "?Pollid=" + PollID.ToString() + "\">" + AppLogic.GetPollName(PollID, LocaleSetting) + "</a> " + String.Format(AppLogic.GetString("admin.editpollanswer.PollID", SkinID, LocaleSetting), PollID.ToString()) + "</b</p>\n");
                        if (Editing)
                        {
                            writer.Append("<p align=\"left\"><b>" + String.Format(AppLogic.GetString("admin.editpollanswer.EditingPollAnswer", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "PollAnswerID").ToString()) + "</b></p>\n");
                        }
                        else
                        {
                            writer.Append("<p align=\"left\"><b>" + AppLogic.GetString("admin.editpollanswer.AddNewPollAnswer", SkinID, LocaleSetting) + ":</p></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        writer.Append("<p align=\"left\">" + AppLogic.GetString("admin.editpollanswer.PollAnswerInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form action=\"" + AppLogic.AdminLinkUrl("editpollanswer.aspx") + "?Pollid=" + PollID.ToString() + "&PollAnswerID=" + PollAnswerID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\" class=\"normalButtons\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\"  class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\" class=\"normalButtons\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">" + AppLogic.GetString("admin.editpollanswer.AnswerText", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editpollanswer.EnterAnswerText", SkinID, LocaleSetting), 100, 30, 0, 0, false));

                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");


                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\" class=\"normalButtons\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\"  class=\"normalButtons\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\" class=\"normalButtons\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }

            ltContent.Text = writer.ToString();
        }
示例#26
0
 public abstract bool OnChangeTerrain(Editing.TerrainChangeParameters parameters);
示例#27
0
        private void Render()
        {
            StringBuilder writer = new StringBuilder();

            if (!AppLogic.AppConfigBool("TurnOffHtmlEditorInAdminSite"))
            {
                writer.Append("<script language=\"Javascript\" src=\"Editor/scripts/innovaeditor.js\"></script>\n");
            }

            using (SqlConnection dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (IDataReader rs = DB.GetRS("select * from OrderOption   with (NOLOCK)  where OrderOptionID=" + OrderOptionID.ToString(), dbconn))
                {
                    if (rs.Read())
                    {
                        Editing = true;
                    }

                    if (ErrorMsg.Length != 0)
                    {
                        writer.Append("<p><b><font color=red>" + ErrorMsg + "</font></b></p>\n");
                    }


                    if (ErrorMsg.Length == 0)
                    {
                        if (Editing)
                        {
                            writer.Append("<p><b>" + String.Format(AppLogic.GetString("admin.editorderoption.EditingOrderOption", SkinID, LocaleSetting), DB.RSFieldByLocale(rs, "Name", LocaleSetting), DB.RSFieldInt(rs, "OrderOptionID").ToString()) + "<br/><br/></b>\n");
                        }
                        else
                        {
                            writer.Append("<div style=\"height:17;padding-top:3px;\" class=\"tablenormal\">" + AppLogic.GetString("admin.editorderoption.AddingNewOrderOption", SkinID, LocaleSetting) + "</div><br/></b>\n");
                        }

                        writer.Append("<script type=\"text/javascript\">\n");
                        writer.Append("function Form_Validator(theForm)\n");
                        writer.Append("{\n");
                        writer.Append("submitonce(theForm);\n");
                        writer.Append("return (true);\n");
                        writer.Append("}\n");
                        writer.Append("</script>\n");

                        if (AppLogic.NumLocaleSettingsInstalled() > 1)
                        {
                            writer.Append(CommonLogic.ReadFile("jscripts/tabs.js", true));
                        }

                        writer.Append("<p>" + AppLogic.GetString("admin.editorderoption.OrderOptionInfo", SkinID, LocaleSetting) + "</p>\n");
                        writer.Append("<form enctype=\"multipart/form-data\" action=\"" + AppLogic.AdminLinkUrl("editorderoption.aspx") + "?OrderOptionID=" + OrderOptionID.ToString() + "&edit=" + Editing.ToString() + "\" method=\"post\" id=\"Form1\" name=\"Form1\" onsubmit=\"return (validateForm(this) && Form_Validator(this))\" onReset=\"return confirm('" + AppLogic.GetString("admin.common.ResetAllFieldsPrompt", SkinID, LocaleSetting) + "');\">\n");
                        writer.Append("<input type=\"hidden\" name=\"IsSubmit\" value=\"true\">\n");
                        writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"100%\" colspan=\"2\" align=\"left\">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");
                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editorderoption.OrderOptionName", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Name"), "Name", false, true, true, AppLogic.GetString("admin.editorderoption.EnterOrderOption", SkinID, LocaleSetting), 100, 30, 0, 0, false));

                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"top\">" + AppLogic.GetString("admin.common.Description", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append(AppLogic.GetLocaleEntryFields(DB.RSField(rs, "Description"), "Description", true, true, false, "", 0, 0, AppLogic.AppConfigUSInt("Admin_TextareaHeight"), AppLogic.AppConfigUSInt("Admin_TextareaWidth"), true));

                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td align=\"right\" valign=\"middle\">*" + AppLogic.GetString("admin.editorderoption.DefaultIsChecked", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\">\n");
                        writer.Append(AppLogic.GetString("admin.common.Yes", SkinID, LocaleSetting) + "&nbsp;<INPUT TYPE=\"RADIO\" NAME=\"DefaultIsChecked\" value=\"1\" " + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldBool(rs, "DefaultIsChecked"), " checked ", ""), " checked ") + ">\n");
                        writer.Append(AppLogic.GetString("admin.common.No", SkinID, LocaleSetting) + "&nbsp;<INPUT TYPE=\"RADIO\" NAME=\"DefaultIsChecked\" value=\"0\" " + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldBool(rs, "DefaultIsChecked"), "", " checked "), "") + ">\n");
                        writer.Append("                </td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("              <tr valign=\"middle\">\n");
                        writer.Append("                <td width=\"25%\" align=\"right\" valign=\"middle\">" + AppLogic.GetString("admin.common.Cost", SkinID, LocaleSetting) + ":&nbsp;&nbsp;</td>\n");
                        writer.Append("                <td align=\"left\" valign=\"top\">\n");
                        writer.Append("                	<input maxLength=\"10\" size=\"10\" name=\"Cost\" value=\"" + CommonLogic.IIF(Editing, CommonLogic.IIF(DB.RSFieldDecimal(rs, "Cost") != System.Decimal.Zero, Localization.CurrencyStringForDBWithoutExchangeRate(DB.RSFieldDecimal(rs, "Cost")), ""), "") + "\"> " + AppLogic.GetString("admin.common.InFormat", SkinID, LocaleSetting) + "\n");
                        writer.Append("                	<input type=\"hidden\" name=\"Cost_vldt\" value=\"[number][invalidalert=" + AppLogic.GetString("admin.common.ValidDollarAmountPrompt", SkinID, LocaleSetting) + "]\">\n");
                        writer.Append("                	</td>\n");
                        writer.Append("              </tr>\n");

                        writer.Append("  <tr>\n");
                        writer.Append("    <td valign=\"top\" align=\"right\">Icon:\n");
                        writer.Append("</td>\n");
                        writer.Append("    <td valign=\"top\" align=\"left\">");
                        writer.Append("    <input type=\"file\" name=\"Image1\" size=\"30\" value=\"" + CommonLogic.IIF(Editing, "", "") + "\">\n");
                        String Image1URL = AppLogic.LookupImage("OrderOption", OrderOptionID, "icon", SkinID, LocaleSetting);
                        if (Image1URL.Length != 0)
                        {
                            if (Image1URL.IndexOf("nopicture") == -1)
                            {
                                String clicklink = "<a href=\"javascript:void(0);\" onClick=\"DeleteImage('" + Image1URL + "','CatPic');\">Click here</a>";
                                writer.Append(String.Format(AppLogic.GetString("admin.editgallery.DeleteImage", SkinID, LocaleSetting), clicklink) + "<br/>\n");
                            }
                            writer.Append("<br/><img id=\"CatPic\" name=\"CatPic\" border=\"0\" src=\"" + Image1URL + "?" + CommonLogic.GetRandomNumber(1, 1000000).ToString() + "\">\n");
                        }
                        writer.Append("</td>\n");
                        writer.Append(" </tr>\n");

                        writer.Append("<tr>\n");
                        writer.Append("<td></td><td align=\"left\" valign=\"top\"><br/>\n");
                        if (Editing)
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.Update", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                            writer.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"reset\" class=\"CPButton\" value=\"" + AppLogic.GetString("admin.common.Reset", SkinID, LocaleSetting) + "\" name=\"reset\">\n");
                        }
                        else
                        {
                            writer.Append("<input type=\"submit\" value=\"" + AppLogic.GetString("admin.common.AddNew", SkinID, LocaleSetting) + "\" name=\"submit\">\n");
                        }
                        writer.Append("        </td>\n");
                        writer.Append("      </tr>\n");
                        writer.Append("  </table>\n");
                        writer.Append("</form>\n");
                    }
                }
            }

            writer.Append("<script type=\"text/javascript\">\n");
            writer.Append("function DeleteImage(imgurl,name)\n");
            writer.Append("{\n");
            writer.Append("window.open('" + AppLogic.AdminLinkUrl("deleteimage.aspx") + "?imgurl=' + imgurl + '&FormImageName=' + name,\"AspDotNetStorefrontAdmin_ML\",\"height=250,width=440,top=10,left=20,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no\")\n");
            writer.Append("}\n");
            writer.Append("</SCRIPT>\n");
            ltContent.Text = writer.ToString();
        }
示例#28
0
 public abstract bool OnTextureTerrain(Editing.TextureChangeParameters parameters);
示例#29
0
 public void NavigateToMetaEditing(Picture sentPicture)
 {
     currentlyEditing = Editing.Metadata;
     ContentGridView.Visibility = Visibility.Collapsed;
     GridViewNav.Visibility = Visibility.Collapsed;
     Edit.Visibility = Visibility.Collapsed;
     MetaEdit.Visibility = Visibility.Visible;
     try { MetaEditTags.Text = sentPicture.Tags; }
     catch (ArgumentNullException) { MetaEditTags.Text = ""; }
     try { MetaEditCity.Text = sentPicture.City; }
     catch (ArgumentNullException) { MetaEditCity.Text = ""; }
     try { MetaEditCountry.Text = sentPicture.Country; }
     catch (ArgumentNullException) { MetaEditCountry.Text = ""; }
     try { MetaEditDate.Date = (DateTime)sentPicture.Date; }
     catch (Exception) { MetaEditDate.Date = DateTime.Now; }
     try { MetaEditAlbum.Text = sentPicture.Album; }
     catch (ArgumentNullException) { MetaEditAlbum.Text = ""; }
     try { MetaEditRating.Value = (double)sentPicture.Rating; }
     catch (Exception) { MetaEditRating.Value = 0; }
     try { MetaEditEvent.Text = sentPicture.Event; }
     catch (ArgumentNullException) { MetaEditEvent.Text = ""; }
     MetaEditObject.Source = sentPicture.ImageSource;
     MetaEditSaveButton.Tag = sentPicture.Id;
     ImagePopup.IsOpen = false;
     Header.header.ResetMetaEditButton();
 }