public void UpdateRackDetails() { try { rack = new RackMaster(); rack.rackId = Convert.ToInt32(txtRackID.Text); rack.rackName = txtRackName.Text; rack.rackStatus = cmbRackStatus.Text == "Active" ? 1 : 0; rackBL = new RackMasterBL(); if (rackBL.UpdateRackMasterDetails(rack) > 0) { MessageBox.Show("Rack Details Are Updated..", "Information", MessageBoxButtons.OK); } else { MessageBox.Show("Rack Details Are Not Updated..", "Information", MessageBoxButtons.OK); } } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); MessageBox.Show("Rack Details Are Not Updated..", "Information", MessageBoxButtons.OK); } }
public void LoadRackId() { rackBL = new RackMasterBL(); int count = rackBL.RetrieveRackId(); txtRackID.Text = Convert.ToString(++count); }
public void GetRackDetailsFromDB() { DataTable dt = new DataTable(); RackMasterBL rackBL = new RackMasterBL(); dt = rackBL.GetRackDetails(); for (int i = 0; i < dt.Rows.Count; i++) { dataGridView1.Rows.Add(); dataGridView1["RackId", i].Value = dt.Rows[i]["Rack_Id"]; dataGridView1["RackName", i].Value = dt.Rows[i]["Rack_Name"]; dataGridView1["RackStatus", i].Value = dt.Rows[i]["Rack_Status"].ToString() == "1" ? "Active" : "In Active"; } }
public void DeleteRackDetails() { try { rackBL = new RackMasterBL(); int rackId = Convert.ToInt32(txtRackID.Text); if (rackBL.DeleteRackMasterDetails(rackId) > 0) { MessageBox.Show("Rack Details Are Deleted..", "Information", MessageBoxButtons.OK); } else { MessageBox.Show("Rack Details Are Not Deleted..", "Information", MessageBoxButtons.OK); } } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); MessageBox.Show("Rack Details Are Not Updated..", "Information", MessageBoxButtons.OK); } }