protected void cmdAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                CommandInfo command = new CommandInfo();
                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 = false;

                int commandId = CommandController.AddCommand(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.AddCommandByLang(_commandInfo, item.Cells[1].Text);
                    i++;
                }
                lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS;
            }
            catch (Exception ex)
            {
                lblUpdateStatus.Text = ex.Message;
            }
        }
예제 #2
0
 public static int AddCommand(CommandInfo command)
 {
     int id = DataAccessProvider.Instance().AddCommand(command);
     DataCaching data = new DataCaching();
     data.RemoveCache(key);
     return id;
 }
예제 #3
0
 public override void UpdateCommandByLang(CommandInfo command, string lang)
 {
     SqlHelper.ExecuteNonQuery(this.ConnectionString, "Portal_Commands_UpdateByLang", lang, command.CommandID, command.CommandName);
 }
예제 #4
0
 public override void UpdateCommand(CommandInfo command)
 {
     SqlHelper.ExecuteNonQuery(this.ConnectionString, "Portal_Commands_Update", command.CommandID, command.CommandParentID,
                               command.CommandKey, command.CommandParams, command.CommandUrl, command.CommandOrder,
                               command.CommandVisible, command.CommandEnable, command.IsSuperUser);
 }
예제 #5
0
 public override int AddCommand(CommandInfo command)
 {
     return (int)SqlHelper.ExecuteScalar(this.ConnectionString, "Portal_Commands_Insert", command.CommandParentID,
                                 command.CommandKey, command.CommandParams, command.CommandUrl, command.CommandOrder,
                                            command.CommandVisible, command.CommandEnable, false);
 }
예제 #6
0
 public static void AddCommandByLang(CommandInfo command, string lang)
 {
     DataAccessProvider.Instance().AddCommandByLang(command, lang);
     DataCaching data = new DataCaching();
     data.RemoveCache(key);
 }
예제 #7
0
 public static void UpdateCommand(CommandInfo command)
 {
     DataAccessProvider.Instance().UpdateCommand(command);
     DataCaching data = new DataCaching();
     data.RemoveCache(key);
 }