private void updateItem(string category, string itemCode, string itemName) { //Update data itemBLL u = new itemBLL(); u.item_cat = category; u.item_code = itemCode; u.item_name = itemName; u.item_material = ""; u.item_mb = ""; u.item_color = ""; u.item_quo_ton = 0; u.item_best_ton = 0; u.item_pro_ton = 0; u.item_quo_ct = 0; u.item_pro_ct_from = 0; u.item_pro_ct_to = 0; u.item_capacity = 0; u.item_quo_pw_pcs = 0; u.item_quo_rw_pcs = 0; u.item_pro_pw_pcs = 0; u.item_pro_rw_pcs = 0; u.item_pro_pw_shot = 0; u.item_pro_rw_shot = 0; u.item_pro_cooling = 0; u.item_wastage_allowed = 0.05f; u.item_assembly = 0; u.item_production = 0; u.item_updtd_date = DateTime.Now; u.item_updtd_by = MainDashboard.USER_ID; //Updating data into database //bool success = dalItem.Update(u); bool success = dalItem.NewUpdate(u); //if data is updated successfully then the value = true else false if (success == true) { //data updated successfully //MessageBox.Show("Item successfully updated "); } else { //failed to update user MessageBox.Show("Failed to updated item"); } }
private void updateItem() { //Update data u.item_code = txtItemCode.Text; u.item_name = txtItemName.Text; u.item_material = cmbMaterialType.Text; u.item_mb = cmbMasterBatch.Text; u.item_mb_rate = Convert.ToSingle(txtMBRate.Text); u.item_color = txtColor.Text; u.item_quo_ton = tool.Int_TryParse(txtQuoTon.Text); u.item_best_ton = tool.Int_TryParse(txtBestTon.Text); u.item_pro_ton = tool.Int_TryParse(txtProTon.Text); u.item_quo_ct = tool.Int_TryParse(txtQuoCT.Text); u.item_pro_ct_from = tool.Int_TryParse(txtProCTFrom.Text); u.item_pro_ct_to = tool.Int_TryParse(txtProCTTo.Text); u.item_capacity = tool.Int_TryParse(txtCapacity.Text); u.item_quo_pw_pcs = tool.Float_TryParse(txtQuoPWPcs.Text); u.item_quo_rw_pcs = tool.Float_TryParse(txtQuoRWPcs.Text); u.item_pro_pw_pcs = tool.Float_TryParse(txtProPWPcs.Text); u.item_pro_rw_pcs = tool.Float_TryParse(txtProRWPcs.Text); u.item_pro_pw_shot = tool.Float_TryParse(txtProPWShot.Text); u.item_pro_rw_shot = tool.Float_TryParse(txtProRWShot.Text); u.item_pro_cooling = tool.Int_TryParse(txtProCooling.Text); u.item_wastage_allowed = tool.Float_TryParse(txtWastageAllowed.Text); if (cbAssembly.Checked) { u.item_assembly = 1; } else { u.item_assembly = 0; } if (cbProduction.Checked) { u.item_production = 1; } else { u.item_production = 0; } u.item_updtd_date = DateTime.Now; u.item_updtd_by = MainDashboard.USER_ID; //Updating data into database //bool success = dalItem.Update(u); bool success = dalItem.NewUpdate(u); //if data is updated successfully then the value = true else false if (success == true) { //data updated successfully MessageBox.Show("Item successfully updated "); this.Close(); } else { //failed to update user MessageBox.Show("Failed to updated item"); } }
private void updateItem() { //Update data itemBLL u = new itemBLL(); u.item_cat = cmbCat.Text; if (!join) { itemParentCode = txtItemCode.Text; parentCust = cmbCust.Text; } else { itemChildCode = txtItemCode.Text; } u.item_code = txtItemCode.Text; u.item_name = txtItemName.Text; u.item_material = cmbMat.Text; u.item_mb = cmbMB.Text; u.item_color = txtColor.Text; u.item_quo_ton = 0; u.item_best_ton = 0; u.item_pro_ton = 0; u.item_quo_ct = 0; u.item_pro_ct_from = 0; u.item_pro_ct_to = 0; u.item_capacity = tool.Int_TryParse(txtCapacity.Text); u.item_quo_pw_pcs = tool.Float_TryParse(txtQuoPWpcs.Text); u.item_quo_rw_pcs = tool.Float_TryParse(txtQuoRWpcs.Text); u.item_pro_pw_pcs = tool.Float_TryParse(txtPWpcs.Text); u.item_pro_rw_pcs = tool.Float_TryParse(txtRWpcs.Text); u.item_pro_pw_shot = tool.Float_TryParse(txtPWshot.Text); u.item_pro_rw_shot = tool.Float_TryParse(txtRWshot.Text); u.item_pro_cooling = 0; u.item_wastage_allowed = 0.05f; if (cbAssembly.Checked) { u.item_assembly = 1; } else { u.item_assembly = 0; } if (cbProduction.Checked) { u.item_production = 1; } else { u.item_production = 0; } u.item_updtd_date = DateTime.Now; u.item_updtd_by = MainDashboard.USER_ID; //Updating data into database //bool success = dalItem.Update(u); bool success = dalItem.NewUpdate(u); //if data is updated successfully then the value = true else false if (success == true) { //data updated successfully MessageBox.Show("Item successfully updated "); if (!join) { pairCustomer(); } } else { //failed to update user //MessageBox.Show("Failed to updated item"); } }