示例#1
0
        protected string validSaveData()
        {
            string result = "";

            //double chk_num;
            //double out_weg;
            for (int i = 0; i < gvDetails.Rows.Count; i++)//
            {
                string   ci  = (i + 1).ToString();
                CheckBox chk = (CheckBox)gvDetails.Rows[i].FindControl("chkRec");
                if (chk.Checked == true)
                {
                    TextBox tx = new TextBox();
                    tx = (TextBox)gvDetails.Rows[i].FindControl("txtPrice");
                    if (!StrHlp.IsNumeric(tx.Text))
                    {
                        result = "第" + ci + "行的價格不正確!";
                        break;
                    }

                    tx = (TextBox)gvDetails.Rows[i].FindControl("txtSec_price");
                    if (!StrHlp.IsNumeric(tx.Text))
                    {
                        result = "第" + ci + "行的重量價格不正確!";
                        break;
                    }

                    tx = (TextBox)gvDetails.Rows[i].FindControl("txtMould_fee");
                    if (!StrHlp.IsNumeric(tx.Text))
                    {
                        result = "第" + ci + "行的最低消費金額不正確!";
                        break;
                    }
                    tx = (TextBox)gvDetails.Rows[i].FindControl("txtFormer_free");
                    if (!StrHlp.IsNumeric(tx.Text))
                    {
                        result = "第" + ci + "行的版費不正確!";
                        break;
                    }
                    if (result != "")
                    {
                        break;
                    }
                }
            }

            if (result != "")
            {
                StrHlp.WebMessageBox(this.Page, result);
            }


            return(result);
        }