コード例 #1
0
        /// <summary>
        /// 收款确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            int id = Convert.ToInt32(Label1.Text);

            Model.OrderTab er = ot.GetModel(id);
            if (DropDownList8.Text == "0")
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('没选择收款状况!');</script>");
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>javascript:showDiv2();</script>");
            }
            else
            {
                er.Zhuangtai2 = Convert.ToInt32(DropDownList8.Text);
                er.Deposit    = er.Deposit + Convert.ToDecimal(TextBox1.Text);
                Model.Currentaccount cu = new Model.Currentaccount();
                cu.billnumber = er.OrderNumber;
                cu.type       = 2;
                cu.receipt    = DateTime.Now;
                cu.money      = Convert.ToDecimal(TextBox1.Text);
                int  b = cur.Add(cu);
                bool a = ot.Update(er);
                if (a == true && b > 0)
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('收款成功');</script>");
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('收款失败');</script>");
                    ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>javascript:showDiv2();</script>");
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// 下单
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void LinkButton3_Click(object sender, EventArgs e)
 {
     try
     {
         //获取button 控件
         LinkButton lb = (LinkButton)sender;
         //获取传过来的commwntid
         int            id = Convert.ToInt32(lb.CommandArgument);
         Model.OrderTab or = ot.GetModel(id);
         if (or.progress <= 1)
         {
             or.Zhuangtai1 = 1;
             or.progress   = 1;
             bool a = ot.Update(or);
             if (a == true)
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('下单成功');</script>");
                 bind(sql);
             }
             else
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('下单失败');</script>");
             }
         }
         else
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('该步奏已经执行过了');</script>");
         }
     }
     catch (Exception ee)
     {
         //Response.Write("<script>alert('确定异常 " + ee.Message + "')</script>");
         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('下单异常 " + ee.Message + "');</script>");
     }
 }
コード例 #3
0
ファイル: Modify.aspx.cs プロジェクト: sufeng136540/sufeng
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtMemberID.Text))
            {
                strErr += "MemberID格式错误!\\n";
            }
            if (this.txtMemberName.Text.Trim().Length == 0)
            {
                strErr += "MemberName不能为空!\\n";
            }
            if (this.txtMemberPhone.Text.Trim().Length == 0)
            {
                strErr += "MemberPhone不能为空!\\n";
            }
            if (this.txtMemberPhone1.Text.Trim().Length == 0)
            {
                strErr += "MemberPhone1不能为空!\\n";
            }
            if (this.txtMemberAdd.Text.Trim().Length == 0)
            {
                strErr += "MemberAdd不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtOrderdate.Text))
            {
                strErr += "Orderdate格式错误!\\n";
            }
            if (this.txtOrderNumber.Text.Trim().Length == 0)
            {
                strErr += "OrderNumber不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtStaffmemberID.Text))
            {
                strErr += "StaffmemberID格式错误!\\n";
            }
            if (this.txtStaffmembername.Text.Trim().Length == 0)
            {
                strErr += "Staffmembername不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtUserTabID.Text))
            {
                strErr += "UserTabID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtPhotoID.Text))
            {
                strErr += "PhotoID格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtvalidity.Text))
            {
                strErr += "validity格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtprogress.Text))
            {
                strErr += "progress格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtDeposit.Text))
            {
                strErr += "Deposit格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtAllMoney.Text))
            {
                strErr += "AllMoney格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtalllength.Text))
            {
                strErr += "alllength格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtImperial.Text))
            {
                strErr += "Imperial格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtQhWidth.Text))
            {
                strErr += "QhWidth格式错误!\\n";
            }
            if (this.txtBeizhuwg.Text.Trim().Length == 0)
            {
                strErr += "Beizhuwg不能为空!\\n";
            }
            if (this.txtBeizhuzz.Text.Trim().Length == 0)
            {
                strErr += "Beizhuzz不能为空!\\n";
            }
            if (this.txtZengsong.Text.Trim().Length == 0)
            {
                strErr += "Zengsong不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtZhuangtai1.Text))
            {
                strErr += "Zhuangtai1格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtZhuangtai2.Text))
            {
                strErr += "Zhuangtai2格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtBy1.Text))
            {
                strErr += "By1格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtBy2.Text))
            {
                strErr += "By2格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtBy3.Text))
            {
                strErr += "By3格式错误!\\n";
            }
            if (this.txtBy4.Text.Trim().Length == 0)
            {
                strErr += "By4不能为空!\\n";
            }
            if (this.txtBy5.Text.Trim().Length == 0)
            {
                strErr += "By5不能为空!\\n";
            }
            if (this.txtBy6.Text.Trim().Length == 0)
            {
                strErr += "By6不能为空!\\n";
            }
            if (this.txtBy7.Text.Trim().Length == 0)
            {
                strErr += "By7不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      id              = int.Parse(this.lblid.Text);
            int      MemberID        = int.Parse(this.txtMemberID.Text);
            string   MemberName      = this.txtMemberName.Text;
            string   MemberPhone     = this.txtMemberPhone.Text;
            string   MemberPhone1    = this.txtMemberPhone1.Text;
            string   MemberAdd       = this.txtMemberAdd.Text;
            DateTime Orderdate       = DateTime.Parse(this.txtOrderdate.Text);
            string   OrderNumber     = this.txtOrderNumber.Text;
            int      StaffmemberID   = int.Parse(this.txtStaffmemberID.Text);
            string   Staffmembername = this.txtStaffmembername.Text;
            int      UserTabID       = int.Parse(this.txtUserTabID.Text);
            int      PhotoID         = int.Parse(this.txtPhotoID.Text);
            DateTime validity        = DateTime.Parse(this.txtvalidity.Text);
            int      progress        = int.Parse(this.txtprogress.Text);
            decimal  Deposit         = decimal.Parse(this.txtDeposit.Text);
            decimal  AllMoney        = decimal.Parse(this.txtAllMoney.Text);
            decimal  alllength       = decimal.Parse(this.txtalllength.Text);
            decimal  Imperial        = decimal.Parse(this.txtImperial.Text);
            decimal  QhWidth         = decimal.Parse(this.txtQhWidth.Text);
            string   Beizhuwg        = this.txtBeizhuwg.Text;
            string   Beizhuzz        = this.txtBeizhuzz.Text;
            string   Zengsong        = this.txtZengsong.Text;
            int      Zhuangtai1      = int.Parse(this.txtZhuangtai1.Text);
            int      Zhuangtai2      = int.Parse(this.txtZhuangtai2.Text);
            decimal  By1             = decimal.Parse(this.txtBy1.Text);
            decimal  By2             = decimal.Parse(this.txtBy2.Text);
            decimal  By3             = decimal.Parse(this.txtBy3.Text);
            string   By4             = this.txtBy4.Text;
            string   By5             = this.txtBy5.Text;
            string   By6             = this.txtBy6.Text;
            string   By7             = this.txtBy7.Text;


            Maticsoft.Model.OrderTab model = new Maticsoft.Model.OrderTab();
            model.id              = id;
            model.MemberID        = MemberID;
            model.MemberName      = MemberName;
            model.MemberPhone     = MemberPhone;
            model.MemberPhone1    = MemberPhone1;
            model.MemberAdd       = MemberAdd;
            model.Orderdate       = Orderdate;
            model.OrderNumber     = OrderNumber;
            model.StaffmemberID   = StaffmemberID;
            model.Staffmembername = Staffmembername;
            model.UserTabID       = UserTabID;
            model.PhotoID         = PhotoID;
            model.validity        = validity;
            model.progress        = progress;
            model.Deposit         = Deposit;
            model.AllMoney        = AllMoney;
            model.alllength       = alllength;
            model.Imperial        = Imperial;
            model.QhWidth         = QhWidth;
            model.Beizhuwg        = Beizhuwg;
            model.Beizhuzz        = Beizhuzz;
            model.Zengsong        = Zengsong;
            model.Zhuangtai1      = Zhuangtai1;
            model.Zhuangtai2      = Zhuangtai2;
            model.By1             = By1;
            model.By2             = By2;
            model.By3             = By3;
            model.By4             = By4;
            model.By5             = By5;
            model.By6             = By6;
            model.By7             = By7;

            Maticsoft.BLL.OrderTab bll = new Maticsoft.BLL.OrderTab();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
コード例 #4
0
 /// <summary>
 /// 修改按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (zzspid == 0)
     {
         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请选择自制商品');</script>");
     }
     else
     {
         if (TextBox7.Text.Trim() == "")
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添客户名称');</script>");
         }
         else
         {
             if (TextBox8.Text.Trim() == "" && TextBox9.Text.Trim() == "")
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('至少添加一个电话号');</script>");
             }
             else
             {
                 if (TextBox10.Text.Trim() == "")
                 {
                     ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添客户地址');</script>");
                 }
                 else
                 {
                     if (TextBox1.Text.Trim() == "")
                     {
                         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添总长');</script>");
                     }
                     else
                     {
                         if (TextBox2.Text.Trim() == "")
                         {
                             ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添妃长');</script>");
                         }
                         else
                         {
                             if (TextBox3.Text.Trim() == "")
                             {
                                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添前后宽');</script>");
                             }
                             else
                             {
                                 if (TextBox11.Text.Trim() == "")
                                 {
                                     ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请选送货日期');</script>");
                                 }
                                 else
                                 {
                                     if (TextBox12.Text.Trim() == "")
                                     {
                                         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请添单据总金额');</script>");
                                     }
                                     else
                                     {
                                         DataSet ds = ot.GetList(" validity='" + TextBox11.Text + "'");
                                         if (ds.Tables[0].Rows.Count > 15)
                                         {
                                             ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('以达到送货上线');</script>");
                                         }
                                         else
                                         {
                                             Model.OrderTab ort = ot.GetModel(id);
                                             ort.MemberName   = TextBox7.Text;
                                             ort.MemberPhone  = TextBox8.Text;
                                             ort.MemberPhone1 = TextBox9.Text;
                                             ort.MemberAdd    = TextBox10.Text;
                                             ort.OrderNumber  = Label1.Text;
                                             ort.PhotoID1     = tp1;
                                             ort.PhotoID2     = tp2;
                                             ort.PhotoID3     = tp3;
                                             ort.PhotoID4     = tp4;
                                             ort.validity     = Convert.ToDateTime(TextBox11.Text);
                                             ort.progress     = 0;
                                             ort.AllMoney     = Convert.ToDecimal(TextBox12.Text);
                                             ort.alllength    = Convert.ToDecimal(TextBox1.Text);
                                             ort.Imperial     = Convert.ToDecimal(TextBox2.Text);
                                             ort.QhWidth      = Convert.ToDecimal(TextBox3.Text);
                                             ort.Beizhuwg     = TextBox5.Text;
                                             ort.Beizhuzz     = TextBox4.Text;
                                             ort.Zengsong     = TextBox6.Text;
                                             ort.Zhuangtai1   = 0;//草稿
                                             ort.HomemadeID   = zzspid;
                                             ct.DeleteList(" OrderNumber like '" + Label1.Text + "'");
                                             if (TextBox14.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox14.Text;
                                                 con.By1         = 1;
                                                 ct.Add(con);
                                             }
                                             if (TextBox15.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox15.Text;
                                                 con.By1         = 2;
                                                 ct.Add(con);
                                             }
                                             if (TextBox16.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox16.Text;
                                                 con.By1         = 3;
                                                 ct.Add(con);
                                             }
                                             if (TextBox17.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox17.Text;
                                                 con.By1         = 4;
                                                 ct.Add(con);
                                             }
                                             if (TextBox18.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox18.Text;
                                                 con.By1         = 5;
                                                 ct.Add(con);
                                             }
                                             if (TextBox19.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox19.Text;
                                                 con.By1         = 6;
                                                 ct.Add(con);
                                             }
                                             if (TextBox20.Text.Trim() != "")
                                             {
                                                 Model.ContractTab con = new Model.ContractTab();
                                                 con.OrderNumber = Label1.Text;
                                                 con.CommodityID = TextBox20.Text;
                                                 con.By1         = 7;
                                                 ct.Add(con);
                                             }
                                             bool a = ot.Update(ort);
                                             if (a == true)
                                             {
                                                 Response.Write(string.Format("<script>alert('修改成功!');location='zhiyuandanjulist.aspx'</script>"));
                                             }
                                             else
                                             {
                                                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('修改失败!');</script>");
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }