protected void AddValue_Click(object sender, ImageClickEventArgs e) { ChancelerryDBDataContext chancDb = new ChancelerryDBDataContext(); DictionarysValues newValue = new DictionarysValues(); newValue.active = true; newValue.fk_dictionary = Convert.ToInt32(DictionarysList.SelectedValue); newValue.value = " "; chancDb.DictionarysValues.InsertOnSubmit(newValue); chancDb.SubmitChanges(); divForTable.Controls.Clear(); divForTable.Controls.Add(CreateTable(Convert.ToInt32(DictionarysList.SelectedValue))); }
protected void AddValue_Click(object sender, ImageClickEventArgs e) { ChancelerryDb chancDb = new ChancelerryDb(new NpgsqlConnection(WebConfigurationManager.AppSettings["ConnectionStringToPostgre"])); DictionarysValues newValue = new DictionarysValues(); newValue.Active = true; newValue.FkDictionary = Convert.ToInt32(DictionarysList.SelectedValue); newValue.Value = " "; chancDb.DictionarysValues.InsertOnSubmit(newValue); chancDb.SubmitChanges(); divForTable.Controls.Clear(); divForTable.Controls.Add(CreateTable(Convert.ToInt32(DictionarysList.SelectedValue))); }
public void DelValueButtonClick(object sender, EventArgs e) { ImageButton delButton = (ImageButton)sender; int id = Convert.ToInt32(delButton.CommandArgument); ChancelerryDBDataContext chancDb = new ChancelerryDBDataContext(); DictionarysValues currentValues = (from a in chancDb.DictionarysValues where a.dictionaryValueID == id select a).FirstOrDefault(); if (currentValues != null) { currentValues.active = false; chancDb.SubmitChanges(); } divForTable.Controls.Clear(); divForTable.Controls.Add(CreateTable(Convert.ToInt32(DictionarysList.SelectedValue))); }
public void SaveValueButtonClick(object sender, EventArgs e) { ImageButton saveButton = (ImageButton)sender; int id = Convert.ToInt32(saveButton.CommandArgument); ChancelerryDBDataContext chancDb = new ChancelerryDBDataContext(); DictionarysValues currentValues = (from a in chancDb.DictionarysValues where a.dictionaryValueID == id select a).FirstOrDefault(); if (currentValues != null) { TextBox myTextBox = (TextBox)divForTable.FindControl("dictValue_" + id); currentValues.value = myTextBox.Text; chancDb.SubmitChanges(); } divForTable.Controls.Clear(); divForTable.Controls.Add(CreateTable(Convert.ToInt32(DictionarysList.SelectedValue))); }
public void SaveValueButtonClick(object sender, EventArgs e) { ImageButton saveButton = (ImageButton)sender; int id = Convert.ToInt32(saveButton.CommandArgument); ChancelerryDb chancDb = new ChancelerryDb(new NpgsqlConnection(WebConfigurationManager.AppSettings["ConnectionStringToPostgre"])); DictionarysValues currentValues = (from a in chancDb.DictionarysValues where a.DictionaryValueID == id select a).FirstOrDefault(); if (currentValues != null) { TextBox myTextBox = (TextBox)divForTable.FindControl("dictValue_" + id); currentValues.Value = myTextBox.Text; chancDb.SubmitChanges(); } divForTable.Controls.Clear(); divForTable.Controls.Add(CreateTable(Convert.ToInt32(DictionarysList.SelectedValue))); }