コード例 #1
0
ファイル: default.ascx.cs プロジェクト: mrscylla/volotour.ru
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		bool noRedirect = false;
		bool successAction = true;
		if (e.CommandName == "save")
		{
			if (!SaveConfig())
			{
				successAction = false;
				noRedirect = true;
			}
		}
		else if (e.CommandName == "apply")
		{
			if (!SaveConfig())
				successAction = false;
			noRedirect = true;
		}

		if (!noRedirect)
		{
		    Page.Response.Redirect(Request.QueryString["back_url"] ?? "UpdateSystem.aspx");
		}
		else
		{
			if (successAction)
			{
				successMessage.Visible = true;
				LoadData();
			}
		}
	}
コード例 #2
0
    protected void OnCommand(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
            case "save":
                {
                    if (IsValid)
                    {
                        TrySave();
						if(this.errorMessage.Length == 0)
							GoBack();
                    }
                }
                break;
            case "apply":
                {
                    if (IsValid)
                    {
						TrySave();
						if(this.errorMessage.Length == 0)
                            Response.Redirect("UserSettings.aspx");						
                    }
                }
                break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #3
0
    protected void OnAdvertisingBannerEdit(object sender, BXTabControlCommandEventArgs e)
	{

		switch (e.CommandName)
		{
            case "save":
                {
                    if (IsValid)
                    {
                        TrySaveAdvertisingBanner();
                        if (EditorError == AdvertisingBannerEditorError.None)
                            GoBack(); 
                    }
                }
                break;
            case "apply":
                {
                    if (IsValid)
                    {
                        TrySaveAdvertisingBanner();
                        if (EditorError == AdvertisingBannerEditorError.None)
                        {
                            ChargeId = _charge.Id;
                            Response.Redirect(string.Format("AdvertisingBannerEdit.aspx?id={0}&tabindex={1}", ChargeId.ToString(), TabControl.SelectedIndex));
                        }
                    }
                }
                break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #4
0
    protected void OnBlogCategoryEdit(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
            case "save":
                {
                    if (IsValid)
                    {
                        TrySaveBlogCategory();
                        if (EditorError == BlogCategoryEditorError.None)
                            GoBack(); 
                    }
                }
                break;
            case "apply":
                {
                    if (IsValid)
                    {
                        TrySaveBlogCategory();
                        if (EditorError == BlogCategoryEditorError.None)
                            Response.Redirect(string.Format("BlogCategoryEdit.aspx?id={0}&tabindex={1}", BlogCategoryId.ToString(), TabControl.SelectedIndex));
                    }
                }
                break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #5
0
        protected void OnTabControlCommand(object sender, BXTabControlCommandEventArgs e)
        {
            SuccesForm.Visible = false;
            try
            {

                switch (e.CommandName)
                {
                    case "save":
                        {
                            if (TabControl.GetSelected().ID == "MainSettingsTab")
                            {
                                try
                                {
                                    customerProfile.name = name.Text;
                                    customerProfile.secondname = secondname.Text;
                                    customerProfile.midlename = midlename.Text;
                                    customerProfile.pasport_date = DateTime.Parse(pasportdate.Text);
                                    customerProfile.pasport_ser = pasportser.Text;
                                    customerProfile.pasport_num = pasportnum.Text;
                                    customerProfile.pasport_ufms = pasportufms.Text;
                                    customerProfile.pasport_ufms_code = pasportufms_code.Text;
                                    customerProfile.address_reg = addresreg.Text;
                                    customerProfile.address_fact = addressfakt.Text;
                                    customerProfile.address_email = address_email.Text;
                                    customerProfile.gsmnumber = phonenumber.Text;
                                    customerProfile.Save();
                                }
                                catch(Exception ex)
                                {
                                    hasErrors = true;
                                    LastError = ex.Message;
                                }
                            }
                            else if (TabControl.GetSelected().ID == "PasswordTab")
                            {
                                if (oldpassword.Text == "")
                                {
                                    hasErrors = true;
                                    LastError = "Старый пароль не должен быть пустым.";
                                    break;
                                }
                                if (newpassword.Text == newpassword1.Text)
                                {
                                    string login = Bitrix.Security.BXPrincipal.Current.Identity.Name;
                                    BXUserCollection list = BXEntity<BXUser, BXUserCollection, BXUser.Scheme>.GetList(
                                                            new BXFilter(new IBXFilterItem[1]
                                    {
                                        (IBXFilterItem) new BXFilterItem(BXEntity<BXUser, BXUserCollection, BXUser.Scheme>.Fields.UserName, BXSqlFilterOperators.Equal, login)
                                    }),
                                                            new BXOrderBy(new BXOrderByPair[1]
                                    {
                                        new BXOrderByPair(BXEntity<BXUser, BXUserCollection, BXUser.Scheme>.Fields.UserName, BXOrderByDirection.Asc)
                                    }));
                                    if (list.Count() > 0)
                                    {
                                        BXUser user = list[0];
                                        if (!user.ChangePassword(oldpassword.Text, newpassword.Text))
                                        {
                                            hasErrors = true;
                                            LastError = "Пароль не изменен. Старый пароль указан не верно.";
                                        }
                                        else
                                        {
                                            user.Save();
                                            SuccesForm.Visible = true;
                                        }
                                    }
                                }
                                else
                                {
                                    hasErrors = true;
                                    LastError = "Введенные новые пароли не совпадают.";
                                }

                            }

                        }
                        break;
                    case "apply":
                        ////{
                        //     if (IsValid && EditorError == categorieEditorError.None)
                        //     {
                        //          TrySave();
                        //          if (EditorError == categorieEditorError.None && Entity != null)
                        //              Response.Redirect(string.Format("InfotoursCategorieEdit.aspx?id={0}&tabindex={1}", Entity.id.ToString(), TabControl.SelectedIndex));
                        //       }
                        //   }
                        //   break;
                        // case "cancel":
                        //     GoBack();
                        break;
                }
            }
            catch (Exception ex)
            {
                hasErrors = true;
                LastError = ex.Message;
            }


            ErrorForm.Visible = hasErrors;
            ErrorMessage.Text = LastError;
        }
コード例 #6
0
	protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
	{
		if (bigError)
			return;
		switch (e.CommandName)
		{
			case "save":
				DoSave();
				if (showMessage != -1)
					GoBack();
				break;
			case "apply":
				DoSave();
				if (showMessage != -1)
					Response.Redirect(Request.RawUrl);
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #7
0
 protected void OnTabControlCommand(object sender, BXTabControlCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "save":
             {
                 if (IsValid && EditorError == categorieEditorError.None)
                 {
                     TrySave();
                     if (EditorError == categorieEditorError.None)
                         GoBack("~/bitrix/admin/InfotoursCategories.aspx");
                 }
             }
             break;
         case "apply":
             {
                 if (IsValid && EditorError == categorieEditorError.None)
                 {
                     TrySave();
                     if (EditorError == categorieEditorError.None && Entity != null)
                         Response.Redirect(string.Format("InfotoursCategorieEdit.aspx?id={0}&tabindex={1}", Entity.id.ToString(), TabControl.SelectedIndex));
                 }
             }
             break;
         case "cancel":
             GoBack();
             break;
     }
 }
コード例 #8
0
 protected void OnEntityEdit(object sender, BXTabControlCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "save":
             {
                 if (IsValid && this.editorError == StorageConfigEditorError.None)
                 {
                     TrySaveEntity();
                     if (this.editorError == StorageConfigEditorError.None)
                         GoBack();
                 }
             }
             break;
         case "apply":
             {
                 if (IsValid && this.editorError == StorageConfigEditorError.None)
                 {
                     TrySaveEntity();
                     if (this.editorError == StorageConfigEditorError.None)
                         Response.Redirect(string.Format("StorageConfigEdit.aspx?id={0}&tabindex={1}", this.entityId.ToString(), TabControl.SelectedIndex));
                 }
             }
             break;
         case "cancel":
             GoBack();
             break;
     }
 }
コード例 #9
0
ファイル: MenuEdit.aspx.cs プロジェクト: mrscylla/volotour.ru
    protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
    {
        if (string.IsNullOrEmpty(Path))
            return;

        BXPublicMenuItemCollection menu = new BXPublicMenuItemCollection();

        switch (e.CommandName.ToLower())
        {
            case "apply":
            case "save":
                for (int i = 1; i < tblItems.Rows.Count; i++)
                {
                    TextBox title = tblItems.Rows[i].Cells[0].Controls[0] as TextBox;
                    TextBox link = tblItems.Rows[i].Cells[1].Controls[0] as TextBox;
                    TextBox sort = tblItems.Rows[i].Cells[2].Controls[0] as TextBox;
                    CheckBox delete = tblItems.Rows[i].Cells[3].Controls[0] as CheckBox;

                    if (!delete.Checked &&
                        !string.IsNullOrEmpty(title.Text.Trim()))
                    {
						BXPublicMenuItem item = new BXPublicMenuItem();
                        item.Link = link.Text;
                        item.Title = title.Text;
                        int weight;
                        if (int.TryParse(sort.Text, out weight))
                            item.Sort = weight;
                        else
                            item.Sort = 10;

                        menu.Add(item);
                    }

                }
				BXPublicMenu.Menu.Save(CurDir, MenuType, menu);
				if (e.CommandName.ToLower() == "apply")
					Response.Redirect(Request.RawUrl);
                break;
        }
		GoBack();
    }
コード例 #10
0
	protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
			case "save":
				DoSave();
				if (showMessage != -1)
					GoBack();
				break;
			case "apply":
				DoSave();
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #11
0
ファイル: BlogEdit.aspx.cs プロジェクト: mrscylla/volotour.ru
	protected void OnBlogEdit(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
            case "save":
                {
                    if (IsValid && EditorError == BlogEditorError.None)
                    {
						if (!Permissions.Validate(null))
						{
							foreach (var err in Permissions.Errors)
								errorMessage.AddErrorText(err);
							break;
						}

                        TrySaveBlog();
                        if (EditorError == BlogEditorError.None)
                            GoBack(); 
                    }
                }
                break;
            case "apply":
                {
                    if (IsValid && EditorError == BlogEditorError.None)
                    {
                        if (!Permissions.Validate(null))
						{
							foreach (var err in Permissions.Errors)
								errorMessage.AddErrorText(err);
							break;
						}
						
						TrySaveBlog();
                        if (EditorError == BlogEditorError.None)
                            Response.Redirect(string.Format("BlogEdit.aspx?id={0}&tabindex={1}", BlogId.ToString(), TabControl.SelectedIndex));
                    }
                }
                break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #12
0
ファイル: VoteEdit.aspx.cs プロジェクト: mrscylla/volotour.ru
    protected void OnVoteEdit(object sender, BXTabControlCommandEventArgs e)
    {

        if (e.CommandName == "save")
        {
            double vv =0;
            double.TryParse(VoteValue.Text, out vv);
            _vote.Value = vv;
            _vote.Update();
            GoBack();
        }
        else if (e.CommandName == "apply")
        {
            int val = 0;
            int.TryParse(VoteValue.Text, out val);
            _vote.Value = val;
            _vote.Update();
            _vote.Save();
        }
        else
            GoBack();
    }
コード例 #13
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		bool noRedirect = false;
		bool successAction = true;
		if (e.CommandName == "save")
		{
			if (!SaveIBlock())
			{
				successAction = false;
				noRedirect = true;
			}
		}
		else if (e.CommandName == "apply")
		{
			if (!SaveIBlock())
				successAction = false;
			noRedirect = true;
		}

		if (!noRedirect)
		{
			Page.Response.Redirect(String.Format("IBlockAdmin.aspx?type_id={0}", typeId));
		}
		else
		{
			if (successAction)
			{
				successMessage.Visible = true;
				LoadData();
			}
		}
	}
コード例 #14
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		if (e.CommandName != "save" && e.CommandName != "apply")
			GoBack("AuthRolesList.aspx");

		if (!SaveRole())
			return;

		if (e.CommandName == "save")
			GoBack("AuthRolesList.aspx");

		Response.Redirect(string.Concat(
			"AuthRolesEdit.aspx?id=",
			roleId.ToString(),
			
			"&ok=",

			!string.IsNullOrEmpty(BackUrl)
			? "&" + BXConfigurationUtility.Constants.BackUrl + "=" + HttpUtility.UrlEncode(BackUrl)
			: "",

			BXTabControl1.SelectedIndex > 0
			? "&tabindex=" + BXTabControl1.SelectedIndex.ToString()
			: ""
		));
	}
コード例 #15
0
    protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
    {
        if (string.IsNullOrEmpty(Path))
            return;

        switch (e.CommandName.ToLower())
        {
            case "apply":
            case "save":
                SaveMenu(true);
                BXPublicMenu.Menu.Save(CurDir, MenuType,  Menu);
				break;
        }
        if (e.CommandName.ToLower() == "apply")
			Response.Redirect(Request.RawUrl);
        else
           GoBack();
    }
コード例 #16
0
	protected void OnForumCategoryEdit(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
			case "save":
				if (SaveCategoryData())
					GoBack();
				break;
			case "apply":
				if (SaveCategoryData())
					Response.Redirect("ForumCategoryEdit.aspx?id="+ id.ToString());
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #17
0
	protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
	{
		if (fatalError)
			return;
		if (e.CommandName != "cancel" && !IsValid)
			return;

		switch (e.CommandName)
		{
			case "save":
				DoCreateFolder();
				if (_ShowMessage != -1)
					GoBack();
				break;
			case "apply":
				DoCreateFolder();
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #18
0
	protected void OnForumEdit(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
			case "save":
				if (SaveForumData())
					GoBack();
				break;
			case "apply":
				if (SaveForumData())
					Response.Redirect(String.Format("ForumEdit.aspx?id={0}&tabindex={1}", id.ToString(), TabControl.SelectedIndex));
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #19
0
    protected void OnTabControlCommand(object sender, BXTabControlCommandEventArgs e)
    {
        if (PageError != AppOptimizationError.None)
            return;

        try
        {
            switch (e.CommandName)
            {
                case "save":
                    {
                        if (IsValid)
                        {
                            TrySave();
                            GoBack();
                        }
                    }
                    break;
                case "apply":
                    {
                        if (IsValid)
                        {
                            TrySave();
                            Response.Redirect(Request.RawUrl);
                        }
                    }
                    break;
                case "cancel":
                    GoBack();
                    break;
            }
        }
        catch (Exception exc)
        {
            PageError |= AppOptimizationError.Custom;
            CustomPageErrorMessage = exc.Message;
        }
    }
コード例 #20
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		bool noRedirect = false;
		bool successAction = true;
		if (e.CommandName == "save")
		{
			if (!SaveType())
			{
				successAction = false;
				noRedirect = true;
			}
		}
		else if (e.CommandName == "apply")
		{
			if (!SaveType())
				successAction = false;
			noRedirect = true;
		}

		if (!noRedirect)
		{
			Page.Response.Redirect("IBlockTypeList.aspx");
		}
		else
		{
			if (successAction)
			{
				successMessage.Visible = true;
				LoadData();
			}
		}
	}
コード例 #21
0
ファイル: SiteEdit.aspx.cs プロジェクト: mrscylla/volotour.ru
 protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
 {
     switch (e.CommandName.ToLower())
     {
         case "save":
             if (ValidateFields())
             {
                 SaveSite(false);
             }
             break;
         case "apply":
             if (ValidateFields())
             {
                 SaveSite(true);
             } 
             break;
         case "cancel":
             //zg, Bitrix, 2008.06.05
             //Response.Redirect("SiteAdmin.aspx"); 
             GoBack();
             break;
         default:
             break;
     }
 }
コード例 #22
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		if (fatalError)
			return;
		bool needRedirect = false;
		switch (e.CommandName)
		{
			case "apply":
			case "save":
				try
				{
					bool save = e.CommandName.Equals("save");
					string templateId;
					DoSave(out templateId);
					if (!save)
						Response.Redirect("TemplateEdit.aspx?id=" + templateId);
					needRedirect = true;
				}
				catch (ThreadAbortException)
				{
				}
				catch (PublicException ex)
				{
					ErrorMessage.Visible = true;
					ErrorMessage.Content += Encode(ex.Message);
				}
				catch (Exception ex)
				{
					ErrorMessage.Visible = true;
					ErrorMessage.Content += GetMessage("Error.SaveUnknown");
					BXLogService.LogAll(ex, 0, BXLogMessageType.Error, AppRelativeVirtualPath);
				}
				break;
			case "cancel":
				needRedirect = true;
				break;
			default:
				break;
		}
		if (needRedirect)
		{
			string backUrl = Request.QueryString[BXConfigurationUtility.Constants.BackUrl];
			Response.Redirect(!string.IsNullOrEmpty(backUrl) ? backUrl : "~/bitrix/admin/Template.aspx");
		}
	}
コード例 #23
0
    protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
    {
        bool redirect = true;
        if (e.CommandName == "save")
        {
            if (InputMainValidator())
                SaveButton_Click(sender, e);
            else
                redirect = false;
        }
        else if (e.CommandName == "apply")
        {
            if (InputMainValidator())
                ApplyButton_Click(sender, e);
            redirect = false;
        }
        if (redirect)
            Page.Response.Redirect("Mailer.aspx");
		ShowOk();
    }
コード例 #24
0
	protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
			case "save":
				if (TrySave())
				{
					changed = Item;
					ReturnBack();
				}
				break;
			case "apply":
				TrySave();
				break;
			case "cancel":
				ReturnBack();
				break;
		}
	}
コード例 #25
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{		
		switch (e.CommandName.ToLower())
		{
			case "save":
				if (!SaveIBlockElement())
					return;
				GoBack("IBlockListAdmin.aspx?iblock_id=" + iblockId.ToString());				
				break;
			case "apply":				
				if (!SaveIBlockElement())
					return;
				Reload(BXTabControl1.SelectedIndex);
				break;
			case "cancel":
				GoBack("IBlockListAdmin.aspx?iblock_id=" + iblockId.ToString());
				break;
		}
	}
コード例 #26
0
	protected void mainTabControl_Command(object sender, BXTabControlCommandEventArgs e)
	{
		UserTypeIdRequired.Enabled = 
		UserTypeIdValidator.Enabled = 
		FieldNameRequired.Enabled = 
		FieldNameValidator.Enabled = 
		cvFieldName.Enabled =
			(userTypeId == null);
		
		Page.Validate(ValidationGroup);
		if (e.CommandName == "save" && (/*userTypeId != null ||*/ Page.IsValid))
		{
			D.StartHidden = true;
			if (Store != null)
			{
				EventArguments ea = new EventArguments();
				ea.State = Gather();
				Store(this, ea);
			}
		}
	}
コード例 #27
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		//bool noRedirect = false;
		//bool successAction = true;
		if (e.CommandName == "cancel" || (e.CommandName == "save" && SaveSection()))
			GoBack();
		else if (e.CommandName == "apply" && SaveSection())
			Page.Response.Redirect(String.Format("IBlockSectionEdit.aspx?type_id={0}&iblock_id={1}&section_id={2}&id={3}&tabindex={4}", typeId, iblockId, sectionId, sectionId, BXTabControl1.SelectedIndex));	
	}
コード例 #28
0
	protected void OnTagEdit(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName)
		{
			case "save":
				{
					if (canModify && IsValid && ErrorMessage == null)
					{
						TrySaveTag();
						if (ErrorMessage == null)
							GoBack();
					}
				}
				break;
			case "apply":
				{
					if (canModify && IsValid && ErrorMessage == null)
					{
						TrySaveTag();
						if (ErrorMessage == null)
							Response.Redirect(string.Format("SearchContentTagEdit.aspx?id={0}{1}", TagId, TabControl.SelectedIndex > 0 ? ("&tabindex=" + TabControl.SelectedIndex) : ""));
					}
				}
				break;
			case "cancel":
				GoBack();
				break;
		}
	}
コード例 #29
0
	protected void BXTabControl1_Command(object sender, BXTabControlCommandEventArgs e)
	{
		switch (e.CommandName.ToLower())
		{
			case "save":
				if (ValidateFields())
				{
					SaveLanguage(false);
				}
				break;
			case "apply":
				if (ValidateFields())
				{
					SaveLanguage(true);
				}
				break;
			case "cancel":
				Response.Redirect("Language.aspx");
				break;
			default:
				break;
		}
	}