コード例 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Page.Validate("AddEdit");
            if (Page.IsValid)
            {
                try
                {
                    ItemService.AddOrUpdatePriceList(RowID,
                                                     Convert.ToInt32(cboItem.SelectedValue),
                                                     Convert.ToInt32(cboSupplier.SelectedValue),
                                                     ddlUnit.SelectedItem.Text,
                                                     dtpDate.SelectedDate.GetValueOrDefault(),
                                                     Convert.ToDecimal(ntbUnitPrice.Value));

                    ReloadCurrentPage();
                }
                catch (Exception ex)
                {
                    WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, ex.Message, LabelStyleNames.ErrorMessage);
                }
            }
        }