Beispiel #1
0
        //添加
        protected void SubmitButtom_Click(object sender, EventArgs e)
        {
            if (!CheckSave())
            {
                return;
            }

            if (this.RegionID.Checked)
            {
                string   itemTypeText = this.ItemType.Text.Trim();
                DateTime itemBuyDate1 = Convert.ToDateTime(this.ItemBuyDate1.Text.Trim());
                DateTime itemBuyDate2 = Convert.ToDateTime(this.ItemBuyDate2.Text.Trim());

                ItemInfo item = new ItemInfo();
                item.ItemName   = this.ItemName.Text.Trim();
                item.ItemPrice  = Convert.ToDecimal(this.ItemPrice.Text.Trim());
                item.RegionType = this.RegionTypeHid.Value;

                try
                {
                    bll.CheckRegion(item.RegionType, itemBuyDate1, itemBuyDate2);
                }
                catch (Exception ex)
                {
                    Utility.Alert(this, ex.Message);
                    return;
                }

                DataTable list = bll.GetRegionList(item, itemTypeText, itemBuyDate1, itemBuyDate2);
                this.RegionList.DataSource = list;
                this.RegionList.DataBind();

                RegionCount = list.Rows.Count;

                ClientScript.RegisterStartupScript(this.GetType(), "show", "$(function(){$('#dialog').dialog('open')})", true);
            }
            else
            {
                Buttom2_Click(sender, e);
            }
        }