Ejemplo n.º 1
0
 private void ShowInfo(int id)
 {
     Maticsoft.BLL.hui_kuan_dan   bll   = new Maticsoft.BLL.hui_kuan_dan();
     Maticsoft.Model.hui_kuan_dan model = bll.GetModel(id);
     this.lblid.Text = model.id.ToString();
     this.lblhuikuan_neirong.Text   = model.huikuan_neirong;
     this.lblxiangmu_mingcheng.Text = model.xiangmu_mingcheng;
     this.lblxiangmu_zongkuan.Text  = model.xiangmu_zongkuan.ToString();
     this.lblyifu_jine.Text         = model.yifu_jine.ToString();
     this.lblzhifu_shijian.Text     = model.zhifu_shijian.ToString();
     this.lblbenci_jine.Text        = model.benci_jine.ToString();
     this.lblyuji_yukuan.Text       = model.yuji_yukuan.ToString();
     this.lblsupplier_id.Text       = model.supplier_id.ToString();
     this.lblleibie.Text            = model.leibie.ToString();
     this.lblbeizhu.Text            = model.beizhu;
 }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txthuikuan_neirong.Text.Trim().Length == 0)
            {
                strErr += "huikuan_neirong不能为空!\\n";
            }
            if (this.txtxiangmu_mingcheng.Text.Trim().Length == 0)
            {
                strErr += "xiangmu_mingcheng不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtxiangmu_zongkuan.Text))
            {
                strErr += "xiangmu_zongkuan格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtyifu_jine.Text))
            {
                strErr += "yifu_jine格式错误!\\n";
            }
            //if(!PageValidate.IsDateTime(txtzhifu_shijian.Text))
            //{
            //    strErr+="zhifu_shijian格式错误!\\n";
            //}
            if (!PageValidate.IsDecimal(txtbenci_jine.Text))
            {
                strErr += "benci_jine格式错误!\\n";
            }
            //if(!PageValidate.IsDateTime(txtyuji_yukuan.Text))
            //{
            //    strErr+="yuji_yukuan格式错误!\\n";
            //}

            //if(!PageValidate.IsNumber(txtleibie.Text))
            //{
            //    strErr+="leibie格式错误!\\n";
            //}
            //if(this.txtbeizhu.Text.Trim().Length==0)
            //{
            //    strErr+="beizhu不能为空!\\n";
            //}

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string  huikuan_neirong   = this.txthuikuan_neirong.Text;
            string  xiangmu_mingcheng = this.txtxiangmu_mingcheng.Text;
            decimal xiangmu_zongkuan  = decimal.Parse(this.txtxiangmu_zongkuan.Text);
            decimal yifu_jine         = decimal.Parse(this.txtyifu_jine.Text);

            decimal benci_jine = decimal.Parse(this.txtbenci_jine.Text);

            int    supplier_id = int.Parse(this.DropDownList1.Text);
            string beizhu      = this.txtbeizhu.Text;

            Maticsoft.Model.hui_kuan_dan model = new Maticsoft.Model.hui_kuan_dan();
            model.huikuan_neirong   = huikuan_neirong;
            model.xiangmu_mingcheng = xiangmu_mingcheng;
            model.xiangmu_zongkuan  = xiangmu_zongkuan;
            model.yifu_jine         = yifu_jine;
            if (txtzhifu_shijian.Text != "")
            {
                model.zhifu_shijian = DateTime.Parse(this.txtzhifu_shijian.Text);
            }
            model.benci_jine = benci_jine;
            if (txtyuji_yukuan.Text != "")
            {
                model.yuji_yukuan = DateTime.Parse(this.txtyuji_yukuan.Text);
            }
            model.supplier_id = supplier_id;
            if (txtleibie.Text != "")
            {
                model.leibie = Convert.ToInt16(txtleibie.Text);
            }
            model.beizhu = beizhu;

            Maticsoft.BLL.hui_kuan_dan bll = new Maticsoft.BLL.hui_kuan_dan();
            bll.Add(model);
            Session["hui_mod"] = model;
            Maticsoft.Common.MessageBox.ShowAndOpennew(this, "保存成功!", "print.aspx");
        }