private void ucQuickLaunch_Load(object sender, EventArgs e) { try { QuickLaunchItemsSP spQuickLaunchItems = new QuickLaunchItemsSP(); btnFocus.SendToBack(); AssignButtonText(); } catch (Exception ex) { MessageBox.Show("QL:5" + ex.Message, "Openmiracle", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
/// <summary> /// Function to Update values in tbl_QuickLaunchItems Table /// </summary> /// <param name="infoQuickLaunchItems"></param> public void QuickLaunchItemsEdit(QuickLaunchItemsInfo infoQuickLaunchItems) { QuickLaunchItemsSP SPQuickLaunchItems = new QuickLaunchItemsSP(); try { SPQuickLaunchItems.QuickLaunchItemsEdit(infoQuickLaunchItems); } catch (Exception ex) { MessageBox.Show("QLIBll 2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to get all the Non Selected values from tbl_QuickLaunchItems Table /// </summary> /// <param name="isSelected"></param> /// <returns></returns> public List <DataTable> QuickLaunchNonSelectedViewAll(bool isSelected) { QuickLaunchItemsSP SPQuickLaunchItems = new QuickLaunchItemsSP(); List <DataTable> listObj = new List <DataTable>(); try { listObj = SPQuickLaunchItems.QuickLaunchNonSelectedViewAll(isSelected); } catch (Exception ex) { MessageBox.Show("QLIBll 1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(listObj); }
/// <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) { MessageBox.Show("MC:1 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void SaveorEdit() { try { QuickLaunchItemsInfo infoQuickLaunchItems = new QuickLaunchItemsInfo(); QuickLaunchItemsSP spQuickLaunchItems = new QuickLaunchItemsSP(); if (dtblSelected.Rows.Count >= 1) { foreach (DataRow row in dtblSelected.Rows) { infoQuickLaunchItems.ItemsName = row.ItemArray[0].ToString(); infoQuickLaunchItems.QuickLaunchItemsId = Convert.ToDecimal(row.ItemArray[1]); infoQuickLaunchItems.Status = true; infoQuickLaunchItems.Extra1 = string.Empty; infoQuickLaunchItems.Extra2 = string.Empty; spQuickLaunchItems.QuickLaunchItemsEdit(infoQuickLaunchItems); } foreach (DataRow row2 in dtblNonSelected.Rows) { infoQuickLaunchItems.ItemsName = row2.ItemArray[0].ToString(); infoQuickLaunchItems.QuickLaunchItemsId = Convert.ToDecimal(row2.ItemArray[1]); infoQuickLaunchItems.Status = false; infoQuickLaunchItems.Extra1 = string.Empty; infoQuickLaunchItems.Extra2 = string.Empty; spQuickLaunchItems.QuickLaunchItemsEdit(infoQuickLaunchItems); } Messages.SavedMessage(); base.Close(); } else { MessageBox.Show("Select atleast one form in quick launch", "Openmiracle", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } catch (Exception ex) { formMDI.infoError.ErrorString = "MC:3 " + ex.Message; } }
public void AssignButtonText() { try { QuickLaunchItemsSP spQuickLaunchItems = new QuickLaunchItemsSP(); DataTable dtblSelectedItems = spQuickLaunchItems.QuickLaunchNonSelectedViewAll(true); for (int i = 0; i < 19; i++) { string strText = (i >= dtblSelectedItems.Rows.Count) ? string.Empty : dtblSelectedItems.Rows[i]["itemsName"].ToString(); switch (i) { case 0: btn1.Text = strText; break; case 1: btn2.Text = strText; break; case 2: btn3.Text = strText; break; case 3: btn4.Text = strText; break; case 4: btn5.Text = strText; break; case 5: btn6.Text = strText; break; case 6: btn7.Text = strText; break; case 7: btn8.Text = strText; break; case 8: btn9.Text = strText; break; case 9: btn10.Text = strText; break; case 10: btn11.Text = strText; break; case 11: btn12.Text = strText; break; case 12: btn13.Text = strText; break; case 13: btn14.Text = strText; break; case 14: btn15.Text = strText; break; case 15: btn16.Text = strText; break; case 16: btn17.Text = strText; break; case 17: btn18.Text = strText; break; case 18: btn19.Text = strText; break; } } } catch (Exception ex) { MessageBox.Show("QL:2" + ex.Message, "Openmiracle", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }