public override void editBtn_Click(object sender, EventArgs e) { btnStatus = "edit"; operation.Text = "Edit Salary Deatils"; MainClass.enable(panel5); EmpIDTxt.Enabled = false; }
public override void editBtn_Click(object sender, EventArgs e) { if (operationTxt.Text != "Edit") { operationTxt.Text = "Edit"; MainClass.enable(panel5); } else { operationTxt.Text = "View"; MainClass.disable(panel5); } }
public override void addBtn_Click(object sender, EventArgs e) { if (btnStatus == "add") { btnStatus = "view"; } else if (btnStatus == "view") { btnStatus = "add"; operation.Text = "Add Salary Details"; MainClass.enable(panel5); } }
public override void addBtn_Click(object sender, EventArgs e) { if (btnStatus == "add") { btnStatus = "view"; MainClass.disable(panel5); } else { btnStatus = "add"; MainClass.enable(panel5); } }
public override void btnUpdate_Click(object sender, EventArgs e) { if (btnStatus == "update") { btnStatus = "view"; lblMain.Text = "View"; MainClass.disable(panel6); } else { btnStatus = "update"; lblMain.Text = "Update Reservation"; MainClass.enable(panel6); } }
private void usersGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (operationTxt.Text == "View" || operationTxt.Text == "Add") { MainClass.disable(panel5); } else { MainClass.enable(panel5); } if (e.RowIndex != -1 && e.ColumnIndex != -1) { DataGridViewRow row = usersGridView.Rows[e.RowIndex]; userID = Convert.ToInt32(row.Cells["userId"].Value.ToString()); userNameTxt.Text = row.Cells["userName"].Value.ToString(); rolesDropDown.Text = row.Cells["roleId"].Value.ToString(); } }
private void MemberGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (btnStatus == "view" || btnStatus == "add") { MainClass.disable(panel6); } else { MainClass.enable(panel6); } try { int i; i = Convert.ToInt32(MemberGridView.SelectedCells[0].Value.ToString()); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select * from libraryMember where member_ID='" + i + "'"; cmd.ExecuteNonQuery(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); foreach (DataRow dr in dt.Rows) { txtMemberID.Text = dr["member_ID"].ToString(); txtFName.Text = dr["FirstName"].ToString(); txtLName.Text = dr["LastName"].ToString(); txtAddress.Text = dr["address"].ToString(); txtContact.Text = dr["contactNo"].ToString(); AddDate.Text = dr["addDate"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } con.Close(); }
public override void editBtn_Click(object sender, EventArgs e) { if (btnStatus == "edit") { btnStatus = "view"; operation.Text = "View Student"; MainClass.disable(panel5); } else { if (firstName_txt.Text != "") { btnStatus = "edit"; operation.Text = "Edit Student"; MainClass.enable(panel5); } else { MainClass.showMsg("Select a record first", "error", "error"); } } }
private void overdueGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (btnStatus == "view" || btnStatus == "add") { MainClass.disable(panel6); } else { MainClass.enable(panel6); } try { int i; i = Convert.ToInt32(overdueGridView.SelectedCells[0].Value.ToString()); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select * from libraryOverDue where overdue_ID='" + i + "'"; cmd.ExecuteNonQuery(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); foreach (DataRow dr in dt.Rows) { txtOverDueID.Text = dr["overdue_ID"].ToString(); txtMemberID.Text = dr["member_ID"].ToString(); DueDate.Text = dr["dueDate"].ToString(); txtDueDays.Text = dr["noOfDueDays"].ToString(); totalAmount.Text = dr["totalAmount"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } con.Close(); }
private void studentGridView_CellClick(object sender, DataGridViewCellEventArgs e) { viewBtn.Enabled = true; if (advanceSearchPanel.Visible == true) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { DataGridViewRow row = studentGridView.Rows[e.RowIndex]; sid = Convert.ToInt32(row.Cells["id"].Value.ToString()); var im = (from x in obj.students where x.sid == sid select x.image).First(); if (im == null) { } else { byte[] arr = im.ToArray(); MemoryStream ms = new MemoryStream(arr); i = Image.FromStream(ms); advSearchPicBox.Image = i; advSearchPicBox.SizeMode = PictureBoxSizeMode.StretchImage; } } } if (btnStatus == "view" || btnStatus == "add") { MainClass.disable(panel5); } else { MainClass.enable(panel5); } if (e.RowIndex != -1 && e.ColumnIndex != -1) { DataGridViewRow row = studentGridView.Rows[e.RowIndex]; sid = Convert.ToInt32(row.Cells["id"].Value.ToString()); NIC_txt.Text = row.Cells["nicId"].Value.ToString(); firstName_txt.Text = row.Cells["fName"].Value.ToString(); lastName_txt.Text = row.Cells["lName"].Value.ToString(); birthDay_txt.Text = row.Cells["birthDate"].Value.ToString(); address_txt.Text = row.Cells["address"].Value.ToString(); telephone_txt.Text = row.Cells["telephone"].Value.ToString(); genderDropDown.SelectedItem = row.Cells["gender"].Value.ToString(); gradeDropDown.SelectedItem = row.Cells["grade"].Value.ToString(); classDropDown.SelectedItem = row.Cells["cls"].Value; imageExist = true; var im = (from x in obj.students where x.sid == sid select x.image).First(); if (im == null) { studentImage.Image = Properties.Resources.user1; } else { byte[] arr = im.ToArray(); MemoryStream ms = new MemoryStream(arr); i = Image.FromStream(ms); studentImage.Image = i; studentImage.SizeMode = PictureBoxSizeMode.StretchImage; } } }
public override void editBtn_Click(object sender, EventArgs e) { edit = 1; MainClass.enable(panel6); }
public override void editBtn_Click(object sender, EventArgs e) { btnStatus = "edit"; operation.Text = "Edit Role"; MainClass.enable(panel5); }
public override void editBtn_Click(object sender, EventArgs e) { edit = 1; MainClass.enable(panel6); imagePathTxt.Enabled = false; }