Exemplo n.º 1
0
        public void BindNumber()
        {
            string MaxNumber = fmcost.GetMaxNumber(" where Goods_categories=" + DDlfylb.SelectedValue + " and Goods_ifType=1").ToString().Trim();
            //string numbers = fmcost.GetModels(" where Goods_categories=" + DDlfylb.SelectedValue + " and Goods_ifType=1 ").Goods_number;
            string number = fmcost.GetModel(Convert.ToInt32(DDlfylb.SelectedValue)).Goods_number;

            if (MaxNumber == "1")
            {
                txtBH.Value = number + "001";
            }
            else
            {
                txtBH.Value = "000" + (Convert.ToInt32(MaxNumber) + 1).ToString();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 费用大类录入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            //string id = "";
            Model.Goods frmfysz = new Model.Goods();
            frmfysz.Goods_name = txt_name.Value;
            string MaxNumber = fmcost.GetMaxNumber(" where Goods_ifType=0").ToString().Trim();

            if (MaxNumber == "1")
            {
                frmfysz.Goods_number = "0001";
            }
            else
            {
                frmfysz.Goods_number = "000" + (Convert.ToInt32(MaxNumber) + 1);
            }
            frmfysz.Goods_ifType = 0;
            if (ids == "")
            {
                int Result = fmcost.Add(frmfysz);
                if (Result > 0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.Window_Close();</script>");
                    //   alert('保存成功');parent.document.getElementById('btnsercher').click();parent.Window_Close();
                    Bind();
                    BindGv(pageSize, pageIndex);
                }
            }
            else
            {
                frmfysz.id = Convert.ToInt32(ids);
                if (fmcost.Update(frmfysz))
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('更新成功');parent.Window_Close();</script>");
                }
            }
        }