Esempio n. 1
0
	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();
			}
		}
	}
Esempio n. 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;
		}
	}
    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;
		}
	}
    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;
		}
	}
Esempio n. 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;
        }
	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;
		}
	}
 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;
     }
 }
 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;
     }
 }
Esempio n. 9
0
    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();
    }
	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;
		}
	}
Esempio n. 11
0
	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;
		}
	}
Esempio n. 12
0
    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();
    }
Esempio n. 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();
			}
		}
	}
Esempio n. 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()
			: ""
		));
	}
Esempio n. 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();
    }
	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;
		}
	}
	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;
		}
	}
Esempio n. 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;
		}
	}
Esempio n. 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;
        }
    }
Esempio n. 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();
			}
		}
	}
Esempio n. 21
0
 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;
     }
 }
Esempio n. 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");
		}
	}
Esempio n. 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();
    }
Esempio n. 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;
		}
	}
	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;
		}
	}
Esempio n. 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);
			}
		}
	}
	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));	
	}
	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;
		}
	}
Esempio n. 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;
		}
	}