private void btnGetByLastNameClient_Click(object sender, EventArgs e) { string LasftName = textBoxGetByLastNameClient.Text; if (LasftName.Length >= 2) { var ClientGetDataBase = clientlogic.GetByLastName(LasftName); if (ClientGetDataBase.Count() > 0) { _gridClient(ClientGetDataBase); } else { CallBackForm callbackMessage = new CallBackForm(); callbackMessage.ErrorMessage = "Клиентов c такой фамилией нет"; callbackMessage.Show(); } } else { CallBackForm callbackMessage = new CallBackForm(); callbackMessage.ErrorMessage = "Поле не может содержать менее 2 символов"; callbackMessage.Show(); } }
public ActionResult FindlastName(string lastname) { var clients = _clientlogic.GetByLastName(lastname); return(View("Index", clients)); }