private void SaveItem() { if ((string.IsNullOrEmpty(hdPickListItemId.Value)) && (hdMode.Value == "ADD")) { int order = System.Convert.ToInt32(txtOrder.Text); PickList pl = PickList.AddNewPickListItem(hdPickListId.Value, txtItemText.Text, txtCode.Text, order, ""); if (chkIsDefaultItem.Checked) { PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId); } } else { PickList pl = PickList.GetPickListItemById(hdPickListId.Value, hdPickListItemId.Value); pl.Shorttext = txtCode.Text; pl.Text = txtItemText.Text; int orderValue = System.Convert.ToInt32(txtOrder.Text); pl.Id = orderValue; PickList.SavePickListItem(pl); if ((chkIsDefaultItem.Checked) && (string.IsNullOrEmpty(hdIsDefault.Value))) { PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId); } if ((!chkIsDefaultItem.Checked) && (!string.IsNullOrEmpty(hdIsDefault.Value))) { PickList.SetAsDefaultItem(hdPickListId.Value, ""); } } PLS.ClearPickListCache(); IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>(); refresher.RefreshAll(); }
protected void btnSave_ClickAction(object sender, EventArgs e) { this._pickListView = (IPickListView)this.BindingSource.Current; PickListAttributes att = GetAttributes(); PickList pl = PickList.GetPickListById(_pickListView.Id.ToString()); pl.Text = txtPicklistName.Text; pl.Shorttext = att.ToString(); if (chkIsManaged.Checked) { pl.Id = 1; } else { pl.Id = 0; } PickList.SavePickList(pl); PLS.ClearPickListCache(); }
private void SaveItem() { if (String.IsNullOrEmpty(txtItemText.Text)) { throw new ValidationException(GetLocalResourceObject("error_InvalidItemName").ToString()); } if ((string.IsNullOrEmpty(hdPickListItemId.Value)) && (hdMode.Value == "ADD")) { int order = Convert.ToInt32(txtOrder.Text); PickList pl = PickList.AddNewPickListItem(hdPickListId.Value, txtItemText.Text, txtCode.Text, order, ""); if (chkIsDefaultItem.Checked) { PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId); } } else { PickList pl = PickList.GetPickListItemById(hdPickListId.Value, hdPickListItemId.Value); pl.Shorttext = txtCode.Text; pl.Text = txtItemText.Text; int orderValue = Convert.ToInt32(txtOrder.Text); pl.Id = orderValue; PickList.SavePickListItem(pl); if ((chkIsDefaultItem.Checked) && (string.IsNullOrEmpty(hdIsDefault.Value))) { PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId); } if ((!chkIsDefaultItem.Checked) && (!string.IsNullOrEmpty(hdIsDefault.Value))) { PickList.SetAsDefaultItem(hdPickListId.Value, ""); } } PLS.ClearPickListCache(); IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>(); refresher.RefreshAll(); }