本文整理汇总了C#中Inventory.UpdateMedicine方法的典型用法代码示例。如果您正苦于以下问题:C# Inventory.UpdateMedicine方法的具体用法?C# Inventory.UpdateMedicine怎么用?C# Inventory.UpdateMedicine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory.UpdateMedicine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
med = new Inventory();
if (txtMedicineId.Text == "" || txtMedicineId.Text == null)
{
Response.Write("<script> window.alert('Please Select a Medicine to Edit before Saving.')</script>");
}
else
{
if (txtMedicineName.Text == "" || txtMedicineName.Text == null)
{
Response.Write("<script> window.alert('Medicine Field Should not be Empty.')</script>");
}
else
{
if (txtQuantity.Text == "" || txtQuantity.Text == null)
{
Response.Write("<script> window.alert('Quantity Field Should not be Empty.')</script>");
}
else
{
bool checker = med.UpdateMedicine(Convert.ToInt32(txtMedicineId.Text.Trim()), txtMedicineName.Text.Trim(),
ddlCategory.Text.Trim(), Convert.ToInt32(txtQuantity.Text.Trim()));
if (checker == true)
Response.Write("<script> window.alert('Updated Medicine Successful.')</script>");
else
Response.Write("<script> window.alert('Updating is Unsuccessful.')</script>");
gridViewMedicine.DataBind();
}
}
}
}