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; } }
public static int AddCommand(CommandInfo command) { int id = DataAccessProvider.Instance().AddCommand(command); DataCaching data = new DataCaching(); data.RemoveCache(key); return id; }
public override void UpdateCommandByLang(CommandInfo command, string lang) { SqlHelper.ExecuteNonQuery(this.ConnectionString, "Portal_Commands_UpdateByLang", lang, command.CommandID, command.CommandName); }
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); }
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); }
public static void AddCommandByLang(CommandInfo command, string lang) { DataAccessProvider.Instance().AddCommandByLang(command, lang); DataCaching data = new DataCaching(); data.RemoveCache(key); }
public static void UpdateCommand(CommandInfo command) { DataAccessProvider.Instance().UpdateCommand(command); DataCaching data = new DataCaching(); data.RemoveCache(key); }