private void lnkXoaMayCamOnKhach_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { gridMayGoiRa.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection; if (gridMayGoiRa.SelectedItems.Count > 0) { GridEXRow row = gridMayGoiRa.SelectedItems[0].GetRow(); int ID = Convert.ToInt32(row.Cells["ID"].Value.ToString()); MessageBox.MessageBoxBA msgBox = new MessageBox.MessageBoxBA(); string Result = msgBox.Show(this, "Bạn có đồng ý xóa line này?", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.YesNoCancel, Taxi.MessageBox.MessageBoxIconBA.Question); if (Result == DialogResult.Yes.ToString()) { if (LineGoiRa.Delete(ID)) { this.GetDSMayGoiRa(); new MessageBox.MessageBoxBA().Show("Xóa thông tin line thành công"); } else { new MessageBox.MessageBoxBA().Show("Lỗi xóa thông tin line thành công"); } } } }
private void btnLuu_Click(object sender, EventArgs e) { bool bOK = false; MessageBox.MessageBoxBA msg = new MessageBox.MessageBoxBA(); g_IP = StringTools.TrimSpace(txtIP.Text); g_Line_Vung = StringTools.TrimSpace(txtLine_Vung.Text); int line = 0; if (!int.TryParse(g_Line_Vung, out line)) { line = 0; msg.Show("Bạn phải nhập lại line, mỗi line trên một dòng.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.Yes); return; } g_IsActive = true; bOK = LineGoiRa.Insert(g_IP, g_Line_Vung, cboPhanLoaiMay.SelectedValue.ToString(), g_IsActive); if (bOK) { new MessageBox.MessageBoxBA().Show("Tạo thông tin máy tính thành công"); this.Close(); } else { new MessageBox.MessageBoxBA().Show("Lỗi tạo thông tin máy tính thành công"); } }
private void GetDSMayGoiRa() { gridMayGoiRa.DataMember = "ListGoiRa"; gridMayGoiRa.SetDataBinding(LineGoiRa.GetDSLineGoiRa(), "ListGoiRa"); }