예제 #1
0
        private void Bind_ResourceList()
        {
            //-- Get the values for the selected language
            this.LangValueUnCommitted = LangValueAPI.LoadUnCommitList(this.LangID, this.LangInterfaceID);
            this.LangValueActive      = LangValueAPI.LoadActiveList(this.LangID, this.LangInterfaceID);

            grdResourceList.DataSource = LangValueAPI.Resourcelist(this.LangID, this.LangInterfaceID);
            grdResourceList.DataBind();
        }
예제 #2
0
        protected void lnkCommit_Command(object source, CommandEventArgs e)
        {
            int langID = Int32.Parse(e.CommandArgument.ToString());

            LangValueAPI.Commit(UserContext.UserID, langID);
            Bind_LanguageGrid();

            foreach (DictionaryEntry item in Cache)
            {
                Cache.Remove(item.Key.ToString());
            }
        }
예제 #3
0
 private void grdResourceList_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "COMMIT")
     {
         int langResourceID = Int32.Parse(grdResourceList.DataKeys[e.Item.ItemIndex].ToString());
         LangValueAPI.Commit(UserContext.UserID, this.LangID, this.LangInterfaceID, langResourceID);
         Bind_ResourceList();
         foreach (DictionaryEntry item in Cache)
         {
             Cache.Remove(item.Key.ToString());
         }
     }
 }
예제 #4
0
        private void grdResourceList_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            int resourceID = Int32.Parse(grdResourceList.DataKeys[e.Item.ItemIndex].ToString());

            int     otherLangValueID = Int32.Parse(((Label)e.Item.FindControl("lblOtherLangValueID")).Text);
            Label   lblRecordLock    = (Label)e.Item.FindControl("lblRecordLock");
            TextBox txtOtherValue    = (TextBox)e.Item.FindControl("txtOtherValue");

            //-- Get existing langvalue or create a new one (one doesn't exist for the language being entered)
            LangValue langValue = new LangValue();

            if (otherLangValueID > 0)
            {
                langValue            = LangValueAPI.GetEntity(otherLangValueID);
                langValue.RecordLock = new Guid(lblRecordLock.Text);
            }
            else
            {
                langValue.LangID          = this.LangID;
                langValue.LangInterfaceID = this.LangInterfaceID;
                langValue.LangResourceID  = resourceID;
                langValue.UserID          = UserContext.UserID;
            }

            langValue.LangEntryValue = txtOtherValue.Text;

            try
            {
                LangValueAPI.Save(langValue);
                foreach (DictionaryEntry item in Cache)
                {
                    Cache.Remove(item.Key.ToString());
                }
            }
            catch (ApplicationException ex)
            {
                lblMessage.Text     = ex.Message;
                lblMessage.CssClass = "WarningMessage";
            }
            catch
            {
                throw;
            }
            grdResourceList.EditItemIndex = -1;
            Response.Redirect("Resource.aspx?langID=" + this.LangID.ToString() + "&langInterfaceID=" + this.LangInterfaceID.ToString());
        }
예제 #5
0
        private void Bind_FlagRepeater()
        {
            ArrayList flagList = null;

            bool languagePreviewMode = false;

            if (Request.Cookies["LanguagePreviewMode"] != null)
            {
                languagePreviewMode = (Request.Cookies["LanguagePreviewMode"].Value.ToString() == "1");
            }

            flagList = LangValueAPI.LoadFlagList(!languagePreviewMode);

            if (Boolean.Parse(ConfigurationSettings.AppSettings["ShowLanguageFlags"].ToString()) == true)
            {
                rptFlag.Visible    = true;
                rptFlag.DataSource = flagList;
                rptFlag.DataBind();
            }
            else
            {
                ddlLanguageList.Visible = true;

                ddlLanguageList.DataTextField  = "LangEntryValue";
                ddlLanguageList.DataValueField = "LangCode";

                ddlLanguageList.DataSource = flagList;
                ddlLanguageList.DataBind();

                if (Request.QueryString["l"] != null && ddlLanguageList.Items.FindByValue(Request.QueryString["l"].ToString()) != null)
                {
                    ddlLanguageList.SelectedValue = Request.QueryString["l"].ToString();
                }
                else if (Request.Cookies["currentCulture"] != null && ddlLanguageList.Items.FindByValue(Request.Cookies["currentCulture"].Value) != null)
                {
                    ddlLanguageList.SelectedValue = Request.Cookies["currentCulture"].Value;
                }
            }
        }
예제 #6
0
        private void grdInterfaceList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            int langInterfaceID = Int32.Parse(grdInterfaceList.DataKeys[e.Item.ItemIndex].ToString());

            switch (e.CommandName)
            {
            case "COMMIT":
                LangValueAPI.Commit(UserContext.UserID, this.LangID, langInterfaceID);
                foreach (DictionaryEntry item in Cache)
                {
                    Cache.Remove(item.Key.ToString());
                }

                break;

            case "RESOURCE":
                Response.Redirect("Resource.aspx?langID=" + this.LangID.ToString() + "&langInterfaceID=" + langInterfaceID.ToString());
                break;
            }

            grdInterfaceList.EditItemIndex = -1;

            Bind_InterfaceGrid(this.LangID);
        }