Exemplo n.º 1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtpeixunban_id.Text))
            {
                strErr += "peixunban_id格式错误!\\n";
            }
            if (this.txtstart_detail.Text.Trim().Length == 0)
            {
                strErr += "start_detail不能为空!\\n";
            }
            if (this.txtend_detail.Text.Trim().Length == 0)
            {
                strErr += "end_detail不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtnum.Text))
            {
                strErr += "num格式错误!\\n";
            }
            if (this.txtnum_detail.Text.Trim().Length == 0)
            {
                strErr += "num_detail不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtcleaning_fee.Text))
            {
                strErr += "cleaning_fee格式错误!\\n";
            }
            if (this.txtfapiao_taitou.Text.Trim().Length == 0)
            {
                strErr += "fapiao_taitou不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtbasketball_time.Text))
            {
                strErr += "basketball_time格式错误!\\n";
            }
            if (this.txtfantang.Text.Trim().Length == 0)
            {
                strErr += "fantang不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtfangka_print.Text))
            {
                strErr += "fangka_print格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtyuedu_shuoming.Text))
            {
                strErr += "yuedu_shuoming格式错误!\\n";
            }
            if (this.txtfengongsi.Text.Trim().Length == 0)
            {
                strErr += "fengongsi不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtdate.Text))
            {
                strErr += "date格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      id              = int.Parse(this.lblid.Text);
            int      peixunban_id    = int.Parse(this.txtpeixunban_id.Text);
            string   start_detail    = this.txtstart_detail.Text;
            string   end_detail      = this.txtend_detail.Text;
            int      num             = int.Parse(this.txtnum.Text);
            string   num_detail      = this.txtnum_detail.Text;
            decimal  cleaning_fee    = decimal.Parse(this.txtcleaning_fee.Text);
            string   fapiao_taitou   = this.txtfapiao_taitou.Text;
            string   basketball_time = this.txtbasketball_time.Text;
            string   fantang         = this.txtfantang.Text;
            int      fangka_print    = int.Parse(this.txtfangka_print.Text);
            int      yuedu_shuoming  = int.Parse(this.txtyuedu_shuoming.Text);
            string   fengongsi       = this.txtfengongsi.Text;
            DateTime date            = DateTime.Parse(this.txtdate.Text);


            Maticsoft.Model.branch_company model = new Maticsoft.Model.branch_company();
            model.id              = id;
            model.peixunban_id    = peixunban_id;
            model.start_detail    = start_detail;
            model.end_detail      = end_detail;
            model.num             = num;
            model.num_detail      = num_detail;
            model.cleaning_fee    = cleaning_fee;
            model.fapiao_taitou   = fapiao_taitou;
            model.basketball_time = basketball_time;
            model.fantang         = fantang;
            model.fangka_print    = fangka_print;
            model.yuedu_shuoming  = yuedu_shuoming;
            model.fengongsi       = fengongsi;
            model.date            = date;

            Maticsoft.BLL.branch_company bll = new Maticsoft.BLL.branch_company();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Exemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsDateTime(txtstart_time.Text))
            {
                strErr += "开始时间格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtend_time.Text))
            {
                strErr += "结束时间格式错误!\\n";
            }
            if (this.txtname.Text.Trim().Length == 0)
            {
                strErr += "培训班名称不能为空!\\n";
            }
            if (this.txtcontact.Text.Trim().Length == 0)
            {
                strErr += "联系人不能为空!\\n";
            }


            if (this.txtphone.Text.Trim().Length == 0)
            {
                strErr += "联系电话不能为空!\\n";
            }
            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      id         = int.Parse(id_load);
            DateTime start_time = DateTime.Parse(this.txtstart_time.Text);
            DateTime end_time   = DateTime.Parse(this.txtend_time.Text);
            string   name       = this.txtname.Text;
            string   contact    = this.txtcontact.Text;
            int      sinal      = 2;
            string   beizhu     = this.txtbeizhu.Text;
            string   phone      = this.txtphone.Text;

            Maticsoft.Model.peixunban1 model = new Maticsoft.Model.peixunban1();
            model.id         = id;
            model.start_time = start_time;
            model.end_time   = end_time;
            model.name       = name;
            model.contact    = contact;
            model.sinal      = sinal;
            model.beizhu     = beizhu;
            model.phone      = phone;


            Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1();
            bll.Update(model);

            #region 开始branch_company表的数据更新
            Maticsoft.BLL.branch_company   bnc_bll = new BLL.branch_company();
            Maticsoft.Model.branch_company bnc_mod = bnc_bll.GetModel_bypeixunban(id);


            if (this.txtstart_detail.Text.Trim().Length == 0)
            {
                strErr += "入住具体时间不能为空!\\n";
            }
            if (this.txtend_detail.Text.Trim().Length == 0)
            {
                strErr += "退房具体时间不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtnum.Text))
            {
                strErr += "人数格式错误!\\n";
            }

            if (!PageValidate.IsDecimal(txtcleaning_fee.Text))
            {
                strErr += "清洁费用格式错误!\\n";
            }
            if (this.txtfapiao_taitou.Text.Trim().Length == 0)
            {
                strErr += "发票抬头不能为空!\\n";
            }

            if (this.txtfantang.Text.Trim().Length == 0)
            {
                strErr += "饭堂订餐不能为空!\\n";
            }
            //if (!PageValidate.IsNumber(txtfangka_print.Text))
            //{
            //    strErr += "fangka_print格式错误!\\n";
            //}


            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }


            string  start_detail    = this.txtstart_detail.Text;
            string  end_detail      = this.txtend_detail.Text;
            int     num             = int.Parse(this.txtnum.Text);
            string  num_detail      = this.txtnum_detail.Text;
            decimal cleaning_fee    = decimal.Parse(this.txtcleaning_fee.Text);
            string  fapiao_taitou   = this.txtfapiao_taitou.Text;
            string  basketball_time = this.txtbasketball_time.Text;
            string  fantang         = this.txtfantang.Text;
            //int fangka_print1 = int.Parse(this.txtfangka_print.Text);



            Maticsoft.Model.branch_company model_branch = new Maticsoft.Model.branch_company();
            model_branch.id              = bnc_mod.id;
            model_branch.peixunban_id    = id;
            model_branch.start_detail    = start_detail;
            model_branch.end_detail      = end_detail;
            model_branch.num             = num;
            model_branch.num_detail      = num_detail;
            model_branch.cleaning_fee    = cleaning_fee;
            model_branch.fapiao_taitou   = fapiao_taitou;
            model_branch.basketball_time = basketball_time;
            model_branch.fantang         = fantang;
            model_branch.fangka_print    = Convert.ToInt16(fangka_print.SelectedValue);
            model_branch.fengongsi       = bnc_mod.fengongsi;
            model_branch.date            = DateTime.Today;
            model_branch.xishu_yongpin   = Convert.ToInt16(xishu.SelectedValue);
            Maticsoft.BLL.branch_company bll_branch = new Maticsoft.BLL.branch_company();
            bll_branch.Update(model_branch);
            #endregion
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }