private void btnsave_Click(object sender, EventArgs e) { BO.ComputerParts parts = new BO.ComputerParts(); parts.PartID = int.Parse(txtPartID.Text); parts.ComputerCase = txtCase.Text; parts.ComputerMouse = txtMouse.Text; parts.ComputerKeyboard = txtKeyboard.Text; parts.ComputerHeadSet = txtHeadSets.Text; parts.ComputerMonitor = txtMonitor.Text; parts.ComputerMousePad = txtMousePad.Text; parts.ComputerCPU = txtProcessor.Text; parts.ComputerGraphicCard = txtGrahpicCard.Text; parts.ComputerMotherboard = txtMotherBoard.Text; parts.ComputerRAM = txtRam.Text; parts.ComputerSSD = txtSsd.Text; parts.ComputerHDD = txtHDD.Text; parts.ComputerPSU = txtPsu.Text; parts.ComputerCooler = txtCooler.Text; parts.UpdatedBy = txtUpdateBy.Text; parts.UpdateDate = DateTime.Parse(txtUpdateDate.Text); parts.LastUpdate = int.Parse(txtUpdateNo.Text); var result = computerParts.Modify(parts); if (result != null) { ComputerParts cp = new ComputerParts(); cp.InitData(); this.Close(); } }
private void btnRefresh_Click(object sender, EventArgs e) { this.Hide(); ComputerParts parts = new ComputerParts(); parts.ShowDialog(); }
private void radButton1_Click(object sender, EventArgs e) { ComputerParts computerParts = new ComputerParts(); computerParts.ShowDialog(); }
private void ValidateFields() { if (txtSsd.Text == "") { erpSSD.SetError(txtSsd, "This cannot be blank"); } if (txtHDD.Text == "") { erpHDD.SetError(txtHDD, "This cannot be blank"); } if (txtCooler.Text == "") { erpCooler.SetError(txtCooler, "This cannot be blank"); } if (txtGrahpicCard.Text == "") { erpGraphicCard.SetError(txtGrahpicCard, "This cannot be blank"); } if (txtKeyboard.Text == "") { erpKeyboard.SetError(txtKeyboard, "This cannot be blank"); } if (txtHeadSets.Text == "") { erpHeadSets.SetError(txtHeadSets, "This cannot be blank"); } if (txtMonitor.Text == "") { erpMonitor.SetError(txtMonitor, "This cannot be blank"); } if (txtMousePad.Text == "") { erpMousePad.SetError(txtMousePad, "This cannot be blank"); } if (txtMouse.Text == "") { erpMouse.SetError(txtMouse, "This cannot be blank"); } //if (txtPricePerHOur.Text == "") //{ // erpPricePerhour.SetError(txtPricePerHOur,"This cannot be blank"); //} if (txtPsu.Text == "") { erpPSU.SetError(txtPsu, "This cannot be blank"); } if (txtRam.Text == "") { erpRam.SetError(txtRam, "This cannot be blank"); } if (txtMotherBoard.Text == "") { erpMotherBoard.SetError(txtMotherBoard, "This cannot be blank"); } if (txtProcessor.Text == "") { erpProcessor.SetError(txtProcessor, "This cannot be blank"); } if (txtCase.Text == "") { erpCase.SetError(txtCase, "This cannot be blank"); } else { BO.ComputerParts computerParts = new BO.ComputerParts(); computerParts.ComputerSSD = txtSsd.Text; computerParts.ComputerHeadSet = txtHeadSets.Text; computerParts.ComputerCPU = txtProcessor.Text; computerParts.ComputerMonitor = txtMonitor.Text; computerParts.ComputerGraphicCard = txtGrahpicCard.Text; computerParts.ComputerMouse = txtMouse.Text; computerParts.ComputerMousePad = txtMousePad.Text; computerParts.ComputerRAM = txtRam.Text; computerParts.ComputerCase = txtCase.Text; computerParts.ComputerHDD = txtHDD.Text; computerParts.ComputerKeyboard = txtKeyboard.Text; computerParts.ComputerPSU = txtPsu.Text; computerParts.ComputerCooler = txtCooler.Text; computerParts.ComputerCase = txtCase.Text; computerParts.ComputerMotherboard = txtMotherBoard.Text; computerParts.Insertby = txtInsertBy.Text; computerParts.InserDate = DateTime.Parse(txtInsertDate.Text); _computerPartsBll.ADD(computerParts); ComputerParts computerPartss = new ComputerParts(); computerPartss.InitData(); this.Close(); } }