Exemple #1
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                int         commandId = ConvertUtility.ToInt32(txtID.Text);
                CommandInfo command   = CommandController.GetCommand(commandId);

                if (command == null)
                {
                    command = CommandController.GetCommandWithoutControlPath(commandId);
                }

                command.CommandParams   = txtParams.Text;
                command.CommandUrl      = txtUrl.Text;
                command.CommandParentID = ConvertUtility.ToInt32(dropParent.SelectedValue);
                command.CommandKey      = dropCommandKeys.SelectedValue;
                command.CommandOrder    = ConvertUtility.ToInt32(dropIndex.SelectedValue);
                command.CommandEnable   = chkEnable.Checked;
                command.CommandVisible  = chkVisble.Checked;
                command.IsSuperUser     = chkIsSuperUser.Checked;
                CommandController.UpdateCommand(command);
                int i = 0;
                foreach (DataGridItem item in dgrNameFollowLang.Items)
                {
                    CommandInfo _commandInfo = new CommandInfo();

                    TextBox txtName = (TextBox)item.FindControl("txtName");
                    _commandInfo.CommandName = txtName.Text;

                    _commandInfo.CommandID = commandId;

                    CommandController.UpdateCommandByLang(_commandInfo, item.Cells[1].Text);
                    i++;
                }

                lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS;
            }
            catch (Exception ex)
            {
                lblUpdateStatus.Text = ex.Message;
            }
        }