private void btn_update_Click(object sender, EventArgs e) { try { InvObjectClass obj2 = new InvObjectClass(); // obj2.itemCode = txtItemCode.Text; obj2.itemName = txt_itemName.Text; obj2.itemDesc = rtxt_itemDesc.Text; obj2.itemGroup = cmb_group.Text; obj2.itemprice = Convert.ToDouble(txt_unitPrice.Text); obj2.storage = txt_storage.Text; obj2.shelfLife = txt_shelfLife.Text; obj2.warehouse = txtWarehouse.Text.ToString(); obj2.fromDate = dtp_fromdate.Value.ToString(); obj2.toDate = dtp_todate.Value.ToString(); if (chkBoxCon.Checked == true) { obj2.condition = "continue"; } else { obj2.condition = "Continue"; } int res = obj2.update(); MsgBox.Show(res); ClearFormData(this); } catch { MsgBox.Error("Please select the item code"); } }
private void btn_submit_Click(object sender, EventArgs e) { try { InvObjectClass obj = new InvObjectClass(); obj.itemCode = txtItemCode.Text; obj.itemName = txt_itemName.Text; obj.itemDesc = rtxt_itemDesc.Text; obj.itemGroup = cmb_group.SelectedItem.ToString(); obj.itemprice = (Convert.ToDouble(txt_unitPrice.Text)); obj.storage = txt_storage.Text; obj.shelfLife = txt_shelfLife.Text; obj.PurchasedQty = Convert.ToInt32(txtPurchasedQty.Text); obj.RequiredLvl = Convert.ToInt32(txtRequiredQty.Text); obj.ReorderLvl = Convert.ToInt32(txtReorderLvl.Text); obj.warehouse = txtWarehouse.Text.ToString(); obj.fromDate = dtp_fromdate.Value.ToString(); obj.toDate = dtp_todate.Value.ToString(); if (chkBoxCon.Checked == true) { obj.condition = "continue".ToString(); } else { obj.condition = "Dis-Continue"; } obj.save(); if (obj.tot > 1 && obj.tot < 3) { MsgBox.Show(1); ClearFormData(this); } } catch { MsgBox.Error("Please check the form again"); } }