public void btEdit_Click(object sender, EventArgs e) { string sqlUpdate = "UPDATE tb_Unit SET UnitName=N'" + txtUnitName.Text + "' WHERE UnitID = '" + txtUnitID.Text + "'"; classUpdate up = new classUpdate(); up.Update(sqlUpdate, connect.DatabaseConnection(constr), "ຫົວໜ່ວຍລະຫັດ " + txtUnitID.Text + " ໄດ້ຮັບການແກ້ໄຂແລ້ວ"); show.ShowData("SELECT * FROM v_Unit", connect.DatabaseConnection(constr), dgvUnit); }
public void btEdit_Click(object sender, EventArgs e) { classUpdate update = new classUpdate(); update.Update("UPDATE tb_FoodType SET FoodTypeName=N'" + txtName.Text + "', FoodTypeDescription=N'" + txtDEs.Text + "' WHERE FoodTypeID = '" + txtID.Text + "'", connect.DatabaseConnection(constr), "ຂໍ້ມູນປະເພດອາຫານໄດ້ຖືກແກ້ໄຂແລ້ວ"); show.ShowData(sqlshow, connect.DatabaseConnection(constr), dgvFoodType); txtID.Text = autoID.SetID(constr, "foodTypeID", "tb_foodType", "FT", 2, 3, 3, "000"); }
public void btEdit_Click(object sender, EventArgs e) { sqlupdate = "UPDATE tb_boat SET boatTypeID = '" + System.Convert.ToString(cbBoatType.SelectedValue) + "', boatName = N'" + txtBoatName.Text + "', boatStatus = N'" + ComboBox1.SelectedItem.ToString() + "', boatPicture ='" + txtpicture.Text + "' Where boatID = '" + txtBoatID.Text + "'"; classUpdate EditData = new classUpdate(); EditData.Update(sqlupdate, connect.DatabaseConnection(constr), "ຂໍ້ມູນເຮືອໄດ້ຖືກແກ້ໄຂແລ້ວ"); selectData.ShowData(sqlshow, connect.DatabaseConnection(constr), dgvboat); Clear(); }
public void btEdit1_Click(object sender, EventArgs e) { classUpdate update = new classUpdate(); update.Update("UPDATE tb_FoodAndDrink SET FoodGroupID='" + System.Convert.ToString(cbfoodGroup.SelectedValue) + "', FoodTypeID='" + System.Convert.ToString(cbFoodType.SelectedValue) + "', FoodName=N'" + txtName1.Text + "', UnitID='" + System.Convert.ToString(cbUnit.SelectedValue) + "', FoodPrice = '" + txtPrice1.Text + "', foodPhotoPath='" + txtPath1.Text + "' WHERE FoodID='" + txtID1.Text + "'", connect.DatabaseConnection(constr), "ຂໍ້ມູນເຮືອໄດ້ຖືກແກ້ໄຂແລ້ວ"); show.ShowData(sqlshow, connect.DatabaseConnection(constr), dgvEmployee); txtID1.Text = autoID.SetID(constr, "FoodID", "tb_FoodAndDrink", "FD00", 2, 3); cleartxt(); }
public void btEdit_Click(object sender, EventArgs e) { classUpdate update = new classUpdate(); update.Update("UPDATE tb_FoodGroup SET FoodGroupName=N'" + txtName.Text + "', FoodGroupDescription=N'" + txtDEs.Text + "' WHERE FoodGroupID = '" + txtID.Text + "'", connect.DatabaseConnection(constr), "ຂໍ້ມູນກຸ່ມອາຫານໄດ້ຖືກແກ້ໄຂແລ້ວ"); show.ShowData(sqlshow, connect.DatabaseConnection(constr), dgvFoodType); txtID.Text = autoID.SetID(constr, "FoodGroupID", "tb_FoodGroup", "FG00", 2, 3); cleartxt(); }
public void ButtonX1_Click(object sender, EventArgs e) { if (txtHour.Text == "") { MessageBox.Show("ກະລຸນາປ້ອນຊົ່ວໂມງ"); return; } SqlCommand cm1 = new SqlCommand("select employeeID from tb_employee where employeeName = '" + Frm_Main.Default.btUser.Text + "'", ConstVar.connect.DatabaseConnection(ConstVar.constr)); SqlDataReader dr1 = default(SqlDataReader); dr1 = cm1.ExecuteReader(); dr1.Read(); ConstVar.emID = dr1[0].ToString(); // MsgBox(emID) string boatstate = "ບໍ່ວ່າງ"; string id = ""; // id = auto.SetID(constr, "SellID", "tb_Selling", "DLD", 3, 11, 11, "00000000000") id = Auto.SetID(ConstVar.constr, "SellID", "tb_Selling", "DLD", 3, 11, 11, "00000000000"); //MsgBox(id) string ServiceStyle = ""; if ((string)btRefresh.Tag == "ຈອງແລ້ວ") { ServiceStyle = System.Convert.ToString(1); } else if ((string)btRefresh.Tag == "ວ່າງ") { ServiceStyle = System.Convert.ToString(0); } string sqlboatStatusUpdate = "Update tb_Boat SET boatStatus = N'" + boatstate + "' WHERE boatid = '" + txtBoatID.Text + "'"; classUpdate up = new classUpdate(); up.Update(sqlboatStatusUpdate, ConstVar.connect.DatabaseConnection(ConstVar.constr)); var sql = "insert into tb_Selling(SellID, employeeID,boatID,dateCome, sellStatus,BoatSailHourInit, increase, discount, serveStyle) VALUES('" + id + "','" + ConstVar.emID + "','" + txtBoatID.Text.Trim() + "',getdate(),N'ຕຽມການ', '" + txtHour.Text + "',0,0, '" + ServiceStyle + "')"; ClassInsert save = new ClassInsert(); save.Insert(sql, ConstVar.connect.DatabaseConnection(ConstVar.constr)); this.Close(); show.ShowData("select * from v_Selling", ConstVar.connect.DatabaseConnection(ConstVar.constr), frm_MainService.Default.dgvOrder); show.ShowData("select * from v_SellDetail", ConstVar.connect.DatabaseConnection(ConstVar.constr), frm_MainService.Default.dgvOrderDetail); frm_MainService.Default.RadioButton3.Checked = true; }
public void btEdit_Click(object sender, EventArgs e) { //Dim sqlUpdate As String = "UPDATE tb_Employee SET employeeName = '" & txtEmployeeName.Text & "',employeeLastName='" & txtEmployeeLastName.Text & "',employeeDateOfBirth='" & dtbDob.Text & "',employeePosition='" & txtEmployeePosition.Text & "',employeePhoneNumber = '" & txtEmployeeTel.Text & "', employeeParentPhoneNumber='" & txtEmployeeParentTel.Text & "', employeeEmail='" & txtEmployeeEmail.Text & "',employeeVillage='" & txtEmployeeVillage.Text & "', employeeDistrict='" & txtEmployeeDistrict.Text & "', employeeProvince='" & cbProvince.SelectedValue.ToString & "', employeeSalary='" & txtEmployeeSalary.Text & "', employeePicture='" & txtPicturePath.Text & "' WHERE employeeID = '" & txtEmployeeID.Text & "'" //Dim up As New classUpdate //up.Update(sqlUpdate, connect.DatabaseConnection(constr), "ພະນັກງານລະຫັດ " & txtEmployeeID.Text & " ໄດ້ຮັບການແກ້ໄຂແລ້ວ") //show.ShowData("SELECT * FROM v_Employee", connect.DatabaseConnection(constr), dgvEmployee) if (btEdit.Text == "ສໍາເລັດ") { string sqlUpdate1 = "UPDATE tb_Employee SET employeeName = '" + txtEmployeeName.Text + "',employeeLastName='" + txtEmployeeLastName.Text + "',employeeDateOfBirth='" + dtbDob.Text + "',employeePosition='" + txtEmployeePosition.Text + "',employeePhoneNumber = '" + txtEmployeeTel.Text + "', employeeParentPhoneNumber='" + txtEmployeeParentTel.Text + "', employeeEmail='" + txtEmployeeEmail.Text + "',employeeVillage='" + txtEmployeeVillage.Text + "', employeeDistrict='" + txtEmployeeDistrict.Text + "', employeeProvince='" + cbProvince.SelectedValue.ToString() + "', employeeSalary='" + txtEmployeeSalary.Text + "', employeePicture='" + txtPicturePath.Text + "' WHERE employeeID = '" + txtEmployeeID.Text + "'"; classUpdate up1 = new classUpdate(); up1.Update(sqlUpdate1, connect.DatabaseConnection(constr), "ພະນັກງານລະຫັດ " + txtEmployeeID.Text + " ໄດ້ຮັບການແກ້ໄຂແລ້ວ"); show.ShowData("SELECT * FROM v_Employee", connect.DatabaseConnection(constr), dgvEmployee); Dispose(); } else { string sqlUpdate2 = "UPDATE tb_Employee SET employeeName = '" + txtEmployeeName.Text + "',employeeLastName='" + txtEmployeeLastName.Text + "',employeeDateOfBirth='" + dtbDob.Text + "',employeePosition='" + txtEmployeePosition.Text + "',employeePhoneNumber = '" + txtEmployeeTel.Text + "', employeeParentPhoneNumber='" + txtEmployeeParentTel.Text + "', employeeEmail='" + txtEmployeeEmail.Text + "',employeeVillage='" + txtEmployeeVillage.Text + "', employeeDistrict='" + txtEmployeeDistrict.Text + "', employeeProvince='" + cbProvince.SelectedValue.ToString() + "', employeeSalary='" + txtEmployeeSalary.Text + "', employeePicture='" + txtPicturePath.Text + "' WHERE employeeID = '" + txtEmployeeID.Text + "'"; classUpdate up2 = new classUpdate(); up2.Update(sqlUpdate2, connect.DatabaseConnection(constr), "ພະນັກງານລະຫັດ " + txtEmployeeID.Text + " ໄດ້ຮັບການແກ້ໄຂແລ້ວ"); show.ShowData("SELECT * FROM v_Employee", connect.DatabaseConnection(constr), dgvEmployee); } }