private void BasketForm_Load(object sender, EventArgs e) { selectedUser = new user(); setDataGrid(); if (dataFormDTO.userData.isAdmin) { tbName.ReadOnly = false; tbSecondName.ReadOnly = false; tbEmail.ReadOnly = false; } else { PickCustomer.Hide(); } tbName.Text = dataFormDTO.userData.firstName; tbSecondName.Text = dataFormDTO.userData.secondName; tbEmail.Text = dataFormDTO.userData.email; if (!ordered) { DeliveryLabel.Hide(); DeliveryText.Hide(); } else { List <ShopBasketPos> pos = basket.GetLines(); car c = dataFormDTO.db.cars.Find(pos[0].ProdID); DeliveryText.Text = c.deliveryTime + " дней"; } }
private void initTbData() { /* * if (!currentUserIsNull) * { * tbName.Text = currentUser.firstName; * tbSecondName.Text = currentUser.secondName; * tbEmail.Text = currentUser.email; * } */ if (!dataFormDTO.userData.isAdmin) { tbName.ReadOnly = true; tbSecondName.ReadOnly = true; tbEmail.ReadOnly = true; PickCustomer.Hide(); deleteOrder.Visible = false; updateOrder.Visible = false; } tbName.Text = dataFormDTO.userData.firstName; tbSecondName.Text = dataFormDTO.userData.secondName; tbEmail.Text = dataFormDTO.userData.email; }