using Point_Of_Sale_Managment; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BiskLog_Point_Of_Sale.Products_Module { public partial class ProductsMainHolder : Form { Form Active; public ProductsMainHolder() { InitializeComponent(); } public void MoveToProduct() { branchActive.Visible = true; rolesActive.Visible = false; pref1Active.Visible = false; tagsActive.Visible = false; stockActive.Visible = false; ProductListForm products = new ProductListForm(this); products.TopLevel = false; if (Active != null) { content.Controls.Remove(Active); } Active = products; content.Controls.Add(products); products.BringToFront(); products.LoadRecords(); products.Show(); } private void Label3_Click(object sender, EventArgs e) { MoveToProduct(); } public void MoveToStock(string productCode = null, string quantity = null, string productName = null,string basename = null) { stockActive.Visible = false; branchActive.Visible = false; rolesActive.Visible = false; pref1Active.Visible = true; tagsActive.Visible = false; StockForm user = new StockForm(this, code: productCode, oldquantity: quantity, productname: productName,baseunit:basename); user.TopLevel = false; if (Active != null) { content.Controls.Remove(Active); } content.Controls.Add(user); Active = user; user.BringToFront(); user.Show(); } private void Label2_Click(object sender, EventArgs e) { MoveToStock(); } private void ProductsMainHolder_SizeChanged(object sender, EventArgs e) { if (Active != null) { Active.WindowState = FormWindowState.Minimized; Active.WindowState = FormWindowState.Maximized; } } private void ProductsMainHolder_Load(object sender, EventArgs e) { MoveToProduct(); } public void MoveToPrices(string procode = null, string price = null, string name = null) { branchActive.Visible = false; rolesActive.Visible = true; pref1Active.Visible = false; tagsActive.Visible = false; stockActive.Visible = false; Prices changePrices = new Prices(this, code: procode, name: name, previous_price: price); changePrices.TopLevel = false; if (Active != null) { content.Controls.Remove(Active); } Active = changePrices; content.Controls.Add(changePrices); changePrices.BringToFront(); changePrices.Show(); } private void Label4_Click(object sender, EventArgs e) { MoveToPrices(); } public void MoveToTags(string productCode = null, string productName = null, string price = null, string quantity = null, string barcode = null) { branchActive.Visible = false; rolesActive.Visible = false; pref1Active.Visible = false; tagsActive.Visible = true; stockActive.Visible = false; TagsAndCodes tags = new TagsAndCodes(this, productCode, productName, price, quantity, barcode); tags.TopLevel = false; if (Active != null) { content.Controls.Remove(Active); } Active = tags; content.Controls.Add(tags); tags.BringToFront(); tags.Show(); } private void Label1_Click(object sender, EventArgs e) { MoveToTags(); } private void label5_Click(object sender, EventArgs e) { branchActive.Visible = false; rolesActive.Visible = false; pref1Active.Visible = false; tagsActive.Visible = false; stockActive.Visible = true; RestockHistory restockHistory = new RestockHistory(); restockHistory.TopLevel = false; if (Active != null) { content.Controls.Remove(Active); } Active = restockHistory; content.Controls.Add(restockHistory); restockHistory.BringToFront(); restockHistory.Show(); } } }