Ejemplo n.º 1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ddlMonth.SelectedValue))
            {
                this.Popup("请选择月份");
                return;
            }
            if (string.IsNullOrEmpty(ddlDeptId.SelectedValue))
            {
                this.Popup("请选择门店");
                return;
            }
            if (string.IsNullOrEmpty(txtAmount.Text))
            {
                this.Popup("请输入指标");
                return;
            }
            if (!this.JudgeIsNum(txtAmount.Text))
            {
                this.Popup("指标请输入数字");
                return;
            }
            //添加
            string  month  = ddlMonth.SelectedValue;
            string  deptId = ddlDeptId.SelectedValue;
            decimal amount = Convert.ToDecimal(txtAmount.Text);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            busiq = new BusiComm.BusiQuery(strcons);
            if (busiq.ExistKPI(month, deptId))
            {
                this.Popup("指标已存在,请重新选择!");
                return;
            }
            if (!busiq.InsertKPI(month, deptId, amount))
            {
                this.Popup("添加指标失败,请重试!");
            }
            else
            {
                Button1_Click(null, null);
            }
        }