private void EditService() { ClearPanel(); Services = new ServiceBox(); Services.Dock = DockStyle.Fill; Services.ID = ViewBox.LvServices.SelectedItems[0].SubItems[0].Text; DataSet ds = ServiceController.GetItemByID(Services.ID); if (ds.Tables[0].Rows.Count != 0) { Services.TxtCode.Enabled = false; Services.TxtCode.Text = ds.Tables[0].Rows[0].ItemArray[2].ToString(); Services.TxtName.Text = ds.Tables[0].Rows[0].ItemArray[3].ToString(); Services.TxtLocation.Text = ds.Tables[0].Rows[0].ItemArray[9].ToString(); Services.MU.Text = ds.Tables[0].Rows[0].ItemArray[4].ToString(); Services.DpCellPrice.Value = Convert.ToDecimal(ds.Tables[0].Rows[0].ItemArray[0]); Services.dpCostPrice.Value = Convert.ToDecimal(ds.Tables[0].Rows[0].ItemArray[1]); Services.DpCrate.Value = Convert.ToDecimal(ds.Tables[0].Rows[0].ItemArray[6]); Services.DpDiscount.Value = Convert.ToDecimal(ds.Tables[0].Rows[0].ItemArray[11]); Services.dpReorder.Value = Convert.ToDecimal(ds.Tables[0].Rows[0].ItemArray[8]); Services.ISActive.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0].ItemArray[5]); Services.IsDis.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0].ItemArray[10]); Services.IsImp.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0].ItemArray[7]); Services.Isrw.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0].ItemArray[12]); MainPanel.Controls.Add(Services); } this.WindowState = FormWindowState.Maximized; this.Size = DefaultSize; this.StartPosition = FormStartPosition.CenterScreen; Services.BtnSave.ToolTipText = "Update(" + Services.ID + ")"; Services.BtnClose.Click += btnServices_Click; }
public void AddNewService() { ClearPanel(); Services = new ServiceBox(); Services.Dock = DockStyle.Fill; int width = (Services.Width > this.Width) ? Services.Width : this.Width; int height = (Services.Height > (this.Height - MarginTop)) ? (Services.Height + MarginTop) : this.Height; MainPanel.Controls.Add(Services); this.WindowState = FormWindowState.Maximized; // this.Size = DefaultSize; this.StartPosition = FormStartPosition.CenterScreen; Services.BtnSave.ToolTipText = "Save"; Services.BtnClose.Click += btnServices_Click; }
public SettingsPage() { InitializeComponent(); Current_Category.HeightRequest = 100; var user = Constants.current_user; if (user != null) { user_fname.Text = user.data.first_name; user_lname.Text = user.data.last_name; user_email.Text = user.data.email; trendNotif.IsToggled = user.data.settings.trend_notification; locationNotif.IsToggled = user.data.settings.location_notification; Points.Text = user.data.points; } var position = 1; foreach (var cons in Constants.CurrentCategoryOrder) { Device.BeginInvokeOnMainThread(async() => { await Task.Delay(300); switch (position) { case (1): var btn = new DragBtn { Text = "Food", ClassId = "1", FontSize = 15, BackgroundColor = Color.Transparent }; Current_Category.Children.Add(btn, Constraint.RelativeToParent((parent) => { return(0); }), Constraint.RelativeToParent((parent) => { return(0); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); })); if (cons == 1) { btn.CurrentDropBox = FoodBox; btn.OnDragCompleted(FoodBox); FoodBox.OnDraggableDropped(btn); } else if (cons == 2) { btn.CurrentDropBox = ServiceBox; btn.OnDragCompleted(ServiceBox); ServiceBox.OnDraggableDropped(btn); } else if (cons == 3) { btn.CurrentDropBox = CleanlinessBox; btn.OnDragCompleted(CleanlinessBox); CleanlinessBox.OnDraggableDropped(btn); } else if (cons == 4) { btn.CurrentDropBox = VibeBox; btn.OnDragCompleted(VibeBox); VibeBox.OnDraggableDropped(btn); } position++; break; case (2): var btn2 = new DragBtn { Text = "Service", ClassId = "2", FontSize = 15, BackgroundColor = Color.Transparent }; Current_Category.Children.Add(btn2, Constraint.RelativeToParent((parent) => { return(0); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); })); if (cons == 1) { btn2.CurrentDropBox = FoodBox; btn2.OnDragCompleted(FoodBox); FoodBox.OnDraggableDropped(btn2); } else if (cons == 2) { btn2.CurrentDropBox = ServiceBox; btn2.OnDragCompleted(ServiceBox); ServiceBox.OnDraggableDropped(btn2); } else if (cons == 3) { btn2.CurrentDropBox = CleanlinessBox; btn2.OnDragCompleted(CleanlinessBox); CleanlinessBox.OnDraggableDropped(btn2); } else if (cons == 4) { btn2.CurrentDropBox = VibeBox; btn2.OnDragCompleted(VibeBox); VibeBox.OnDraggableDropped(btn2); } position++; break; case (3): var btn3 = new DragBtn { Text = "Cleanliness", ClassId = "3", FontSize = 15, BackgroundColor = Color.Transparent }; Current_Category.Children.Add(btn3, Constraint.RelativeToParent((parent) => { return(0); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); })); if (cons == 1) { btn3.CurrentDropBox = FoodBox; btn3.OnDragCompleted(FoodBox); FoodBox.OnDraggableDropped(btn3); } else if (cons == 2) { btn3.CurrentDropBox = ServiceBox; btn3.OnDragCompleted(ServiceBox); ServiceBox.OnDraggableDropped(btn3); } else if (cons == 3) { btn3.CurrentDropBox = CleanlinessBox; btn3.OnDragCompleted(CleanlinessBox); CleanlinessBox.OnDraggableDropped(btn3); } else if (cons == 4) { btn3.CurrentDropBox = VibeBox; btn3.OnDragCompleted(VibeBox); VibeBox.OnDraggableDropped(btn3); } position++; break; case (4): var btn4 = new DragBtn { Text = "Vibe", ClassId = "4", FontSize = 15, BackgroundColor = Color.Transparent }; Current_Category.Children.Add(btn4, Constraint.RelativeToParent((parent) => { return(0); }), Constraint.RelativeToParent((parent) => { return(.15); }), Constraint.RelativeToParent((parent) => { return(.1); }), Constraint.RelativeToParent((parent) => { return(.1); })); if (cons == 1) { btn4.CurrentDropBox = FoodBox; btn4.OnDragCompleted(FoodBox); FoodBox.OnDraggableDropped(btn4); } else if (cons == 2) { btn4.CurrentDropBox = ServiceBox; btn4.OnDragCompleted(ServiceBox); ServiceBox.OnDraggableDropped(btn4); } else if (cons == 3) { btn4.CurrentDropBox = CleanlinessBox; btn4.OnDragCompleted(CleanlinessBox); CleanlinessBox.OnDraggableDropped(btn4); } else if (cons == 4) { btn4.CurrentDropBox = VibeBox; btn4.OnDragCompleted(VibeBox); VibeBox.OnDraggableDropped(btn4); } position++; break; } }); } }