/// <summary> /// Function to fill NonSelected Items List /// </summary> public void FillNonSelectedList() { try { QuickLaunchItemsSP spQuickLaunchItems = new QuickLaunchItemsSP(); dtblNonSelected = spQuickLaunchItems.QuickLaunchNonSelectedViewAll(false); lstbxNonSelected.DataSource = dtblNonSelected; lstbxNonSelected.ValueMember = "quickLaunchItemsId"; lstbxNonSelected.DisplayMember = "itemsName"; dtblSelected = spQuickLaunchItems.QuickLaunchNonSelectedViewAll(true); lstbxSelected.DataSource = dtblSelected; lstbxSelected.ValueMember = "quickLaunchItemsId"; lstbxSelected.DisplayMember = "itemsName"; } catch (Exception ex) { formMDI.infoError.ErrorString = "MC:1 " + ex.Message; } }
/// <summary> /// Save or edit function, Here checking the items in the list /// </summary> private void SaveorEdit() { try { QuickLaunchItemsInfo infoQuickLaunchItems = new QuickLaunchItemsInfo(); QuickLaunchItemsSP spQuickLaunchItems = new QuickLaunchItemsSP(); if (dtblSelected.Rows.Count >= 1) { foreach (DataRow dRoW in dtblSelected.Rows) { infoQuickLaunchItems.ItemsName = dRoW.ItemArray[0].ToString(); infoQuickLaunchItems.QuickLaunchItemsId = Convert.ToDecimal(dRoW.ItemArray[1]); infoQuickLaunchItems.Status = true; infoQuickLaunchItems.Extra1 = string.Empty; infoQuickLaunchItems.Extra2 = string.Empty; spQuickLaunchItems.QuickLaunchItemsEdit(infoQuickLaunchItems); } foreach (DataRow dRoW in dtblNonSelected.Rows) { infoQuickLaunchItems.ItemsName = dRoW.ItemArray[0].ToString(); infoQuickLaunchItems.QuickLaunchItemsId = Convert.ToDecimal(dRoW.ItemArray[1]); infoQuickLaunchItems.Status = false; infoQuickLaunchItems.Extra1 = string.Empty; infoQuickLaunchItems.Extra2 = string.Empty; spQuickLaunchItems.QuickLaunchItemsEdit(infoQuickLaunchItems); } Messages.SavedMessage(); this.Close(); } else { MessageBox.Show("Select atleast one form in quick launch", "Oneaccount", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { formMDI.infoError.ErrorString = "MC:3 " + ex.Message; } }