예제 #1
0
    public void UpdateText()
    {
        if (!this.ValidateFields(7))
        {
            return;
        }

        string aboutHebrewTextContactAndAbout   = this.Master._GlobalFunctions.ConvertToUtf8(this.aboutContactAndAboutTextHe.Text);
        string contactHebrewTextContactAndAbout = this.Master._GlobalFunctions.ConvertToUtf8(this.contactContactAndAboutTextHe.Text);

        MainContactAbout v = (MainContactAbout)this.Master._PapaDal.Get("mainContactAbout", "0");

        if (v == null)
        {
            try
            {
                MainContactAbout e = new MainContactAbout
                {
                    MainContactAboutID = this.Master._PapaDal.GetNextAvailableID("mainContactAbout"),
                    AboutEn            = this.aboutContactAndAboutTextEn.Text,
                    AboutHe            = aboutHebrewTextContactAndAbout,
                    ContactEn          = this.contactContactAndAboutTextEn.Text,
                    ContactHe          = contactHebrewTextContactAndAbout,
                    LastUpdate         = TimeNow.TheTimeNow,
                    spLastUpdate       = TimeNow.TheTimeNow.ToString()
                };

                this.Master._PapaDal.Add("mainContactAbout", e);
                this.Master._Logger.Log(new AdminException(". Main Contact And About Text Was Successfully Updated"),
                                        MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(15, "White", "Main Contact And About Text"));
            }
            catch (Exception e)
            {
                this.Master._Logger.Error(e, MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(16, "Red", "Main Contact And About Text"));
            }
        }
        else
        {
            try
            {
                v.AboutEn      = this.aboutContactAndAboutTextEn.Text;
                v.AboutHe      = aboutHebrewTextContactAndAbout;
                v.ContactEn    = this.contactContactAndAboutTextEn.Text;
                v.ContactHe    = contactHebrewTextContactAndAbout;
                v.LastUpdate   = TimeNow.TheTimeNow;
                v.spLastUpdate = TimeNow.TheTimeNow.ToString();

                this.Master._PapaDal.Update("mainContactAbout", v, TimeNow.TheTimeNow);
                this.Master._Logger.Log(new AdminException(". Main Contact And About Text Was Successfully Updated"),
                                        MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(17, "White", "Main Contact And About Text"));
            }
            catch (Exception e)
            {
                this.Master._Logger.Error(e, MethodBase.GetCurrentMethod().Name);
                this.Notify(this.Master._Notifier.Notify(18, "Red", "Main Contact And About Text"));
            }
        }
    }
예제 #2
0
    private void DivSwitcher(int action)
    {
        if (action <= 0)
        {
            this.Master._Logger.Error(new AdminException
                                          (". action <= 0"), MethodBase.GetCurrentMethod().Name);
            this.Notify(this.Master._Notifier.Notify(0, "Red", ""));
            return;
        }

        this.ShowAboutContactAndAboutUpdateInfo(false);
        this.ShowContactAndAboutPicUpdateInfo(false);

        this.mainContactAndAbout.Visible   = false;
        this.addContactAndAboutPic.Visible = false;
        this.removeUpdatePic.Visible       = false;
        this.aboutContactAndAbout.Visible  = false;
        this.contactAndAboutNotify.Visible = false;

        this.mainContactAndAbout.Attributes["class"]   = "mailNo";
        this.addContactAndAboutPic.Attributes["class"] = "mailNo";
        this.removeUpdatePic.Attributes["class"]       = "mailNo";
        this.aboutContactAndAbout.Attributes["class"]  = "mailNo";
        this.contactAndAboutNotify.Attributes["class"] = "mailNo";

        switch (action)
        {
        case 1:
            this.mainContactAndAbout.Visible             = true;
            this.mainContactAndAbout.Attributes["class"] = "mailYes";
            break;

        case 2:
            this.addContactAndAboutPic.Visible             = true;
            this.addContactAndAboutPic.Attributes["class"] = "mailYes";
            if (this.contactAndAboutHiddenUp.Value == "")
            {
                this.ShowContactAndAboutEnableDisable(false);
                this.ShowContactAndAboutFile(true);
                this.ShowContactAndAboutPicture(false);
                this.ShowContactAndAboutPicUpdateInfo(false);
            }
            else
            {
                this.ShowContactAndAboutEnableDisable(true);
                this.ShowContactAndAboutFile(true);
                this.ShowContactAndAboutPicture(true);
                this.ShowContactAndAboutPicUpdateInfo(true);
            }
            break;

        case 3:
            this.removeUpdatePic.Visible             = true;
            this.removeUpdatePic.Attributes["class"] = "mailYes";
            break;

        case 4:
            this.aboutContactAndAbout.Visible             = true;
            this.aboutContactAndAbout.Attributes["class"] = "mailYes";
            this.ShowAboutContactAndAboutUpdateInfo(true);

            if (this.Master._PapaDal.GetCount("mainContactAbout") > 0)
            {
                MainContactAbout g = (MainContactAbout)this.Master._PapaDal.Get("mainContactAbout", "0");
                this.aboutContactAndAboutTextHe.Text   = g.AboutHe;
                this.aboutContactAndAboutTextEn.Text   = g.AboutEn;
                this.contactContactAndAboutTextHe.Text = g.ContactHe;
                this.contactContactAndAboutTextEn.Text = g.ContactEn;
                this.aboutContactAndAboutLabel.Text    = g.spLastUpdate;
            }
            break;

        case 5:
            this.contactAndAboutNotify.Visible             = true;
            this.contactAndAboutNotify.Attributes["class"] = "mailYes";
            break;

        default:
            break;
        }
    }