public Form_PriceList_Edit(bool xbEditUndefined,usrc_PriceList_Edit.eShopType xeShopType,NavigationButtons.Navigation xnav) { InitializeComponent(); if (xnav != null) { nav = xnav; } else { nav = new NavigationButtons.Navigation(); nav.bDoModal = true; nav.m_eButtons = NavigationButtons.Navigation.eButtons.OkCancel; } m_eShopType = xeShopType; bEditUndefined = xbEditUndefined; m_tbl_PriceList = new SQLTable(DBSync.DBSync.DB_for_Tangenta.m_DBTables.GetTable(typeof(PriceList))); m_tbl_PriceList.CreateTableTree(DBSync.DBSync.DB_for_Tangenta.m_DBTables.items); this.Text = lngRPM.s_PriceListType.s; }
public bool Init(long Currency_ID,usrc_PriceList_Edit.eShopType xeShopType,string ShopsInUse, NavigationButtons.Navigation xnav, ref string Err) { m_eShopType = xeShopType; m_Currency_ID = Currency_ID; if (m_xPriceList == null) { m_xPriceList = new xPriceList(); } if (xnav != null) { if (xnav.LastStartupDialog_TYPE.Equals("TangentaSampleDB.Form_Items_Samples")) { return DoEditPriceList(Currency_ID, xnav, ref Err); } } if (m_xPriceList.Get_PriceLists_of_Currency(Currency_ID, ref xPriceList_Count, ref Err)) { if (xPriceList_Count > 0) { this.cmb_PriceListType.DataSource = m_xPriceList.List_xPriceList; this.cmb_PriceListType.DisplayMember = "xPriceList_Name"; this.cmb_PriceListType.ValueMember = "xPriceList_ID"; } else { bool bAsk = ((ShopsInUse.Contains("B") && (xeShopType == usrc_PriceList_Edit.eShopType.ShopB) ) || ((ShopsInUse.Contains("C") && (xeShopType == usrc_PriceList_Edit.eShopType.ShopC)))); if (bAsk) { bool bDialogResult = true; if (xnav.m_eButtons == NavigationButtons.Navigation.eButtons.PrevNextExit) { bDialogResult = true; } else { bDialogResult = XMessage.Box.ShowTopMost(this, lngRPM.s_NoPriceList_AskToCreatePriceList, "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes; } if (bDialogResult) { return DoEditPriceList(Currency_ID, xnav, ref Err); } } } return true; } else { LogFile.Error.Show(Err); return false; } }