예제 #1
0
        private void cb_ok()
        {
            #region
            string name        = Fn.EncodeHtml(Req.GetForm("name").Trim());
            string sex         = Req.GetForm("sex").Trim();
            string address     = Fn.EncodeHtml(Req.GetForm("address").Trim());
            string tel         = Fn.EncodeHtml(Req.GetForm("tel").Trim());
            string fixtel      = Fn.EncodeHtml(Req.GetForm("fixtel").Trim());
            string bank        = Fn.EncodeHtml(Req.GetForm("bank").Trim());
            string bankaccount = Fn.EncodeHtml(Req.GetForm("bankaccount").Trim());
            string remark      = Fn.EncodeHtml(Req.GetForm("remark").Trim());

            //姓名
            if (name.Length == 0)
            {
                msgAjax.Error("请输入姓名;");
            }
            else if (name.Length > 30)
            {
                msgAjax.Error("姓名不超过30个字;");
            }

            //性别
            if (!Fn.IsByteBool(sex))
            {
                msgAjax.Error("请选择性别;");
            }


            //地址
            if (address.Length == 0)
            {
                msgAjax.Error("请输入地址;");
            }
            else if (address.Length > 300)
            {
                msgAjax.Error("地址不超过300个字;");
            }

            //手机 电话
            if (tel.Length == 0 && fixtel.Length == 0)
            {
                msgAjax.Error("手机和电话必填一个;");
            }
            else
            {
                if (tel.Length > 50)
                {
                    msgAjax.Error("手机不超过50个字;");
                }

                if (fixtel.Length > 50)
                {
                    msgAjax.Error("电话不超过50个字;");
                }
            }

            //开户行
            if (bank.Length == 0)
            {
                msgAjax.Error("请输入开户银行;");
            }
            else if (bank.Length > 50)
            {
                msgAjax.Error("开户银行不超过50个字;");
            }

            //银行账号
            if (bankaccount.Length == 0)
            {
                msgAjax.Error("请输入银行账号;");
            }
            else if (bankaccount.Length > 50)
            {
                msgAjax.Error("银行账号不超过50个字;");
            }

            //备注
            if (remark.Length > 600)
            {
                msgAjax.Error("备注不超过600个字;");
            }

            if (msgAjax.IsError)
            {
                return;
            }

            User_ApplyFor_1M mod = new User_ApplyFor_1M();
            mod.FK_User      = LoginInfo.UserID;
            mod.RealName     = name;
            mod.Sex          = byte.Parse(sex);
            mod.Address      = address;
            mod.Tel          = tel;
            mod.FixTel       = fixtel;
            mod.Bank_Name    = bank;
            mod.Bank_Account = bankaccount;
            mod.Remark       = remark;
            #endregion

            string sql = "FK_User,FK_AdminID,RealName,Sex,Address,Tel,FixTel,Bank_Name,Bank_Account,Remark";
            if (SqlData.Add(mod, sql))
            {
                msgAjax.Success("1");
            }
            else
            {
                msgAjax.Error("申请失败");
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Pro_ClassM ex_mod = new Pro_ClassM();

            ex_mod.ClassSN    = 1006;
            ex_mod.PClassSN   = 1;
            ex_mod.ClassName  = "";
            ex_mod.Taxis      = 34;
            ex_mod.ClassLevel = 2;

            //string[] arrObj = { "PClassSN", "ClassSN", "taxis", "classLevel", "Classname" };

            string s = "PClassSN,ClassSN,taxis,classLevel,Classname";

            //SQLData.Add(arrObj, ex_mod);
            SqlData.Add(ex_mod, s);


            //string sql = string.Empty;
            //string sql1 = string.Empty;

            //foreach (string s in arrObj)
            //{
            //    sql += s + ",";
            //    sql1 += "@" + s + ",";
            //}


            //sql = sql.TrimEnd(',');
            //sql1 = sql1.TrimEnd(',');
            //string sSQL = "insert into  " + table + "(" + sql + ") values(" + sql1 + ")";

            //IDataParameter[] dp = {
            //DbHelp.Def.AddParam("@ClassSN",LFn.GetAddRowID("Pro_Class","ClassSN")),
            //DbHelp.Def.AddParam("@PClassSN",pMod.PClassSN),
            //DbHelp.Def.AddParam("@ClassName",pMod.ClassName),
            //DbHelp.Def.AddParam("@Taxis",pMod.Taxis),
            //DbHelp.Def.AddParam("@ClassLevel",pMod.ClassLevel),
            //};

            //IDataParameter idp = new SqlParameter();
            //idp.Value = "";
            //idp.ParameterName = "";

            //Response.Write(sSQL);



            //object aaa = ex_mod;
            //FieldInfo[] fi = aaa.GetType().GetFields();

            //foreach (FieldInfo mi in fi)
            //{

            //    Response.Write("<br> " + mi.Name + " = " + mi.GetValue(ex_mod) + "<br>");
            //}

            //string aaa = "sdfds";

            //Response.Write(aaa.GetType() + "<br>");

            //FieldInfo[] fi1 = aaa.GetType().GetFields();

            //foreach (FieldInfo mi in fi1)
            //{
            //    Response.Write(mi.ReflectedType + "<br>");
            //}


            //FieldInfo[] fi = arrObj.GetType().GetFields();

            //foreach (MemberInfo mi in fi)
            //{
            //    Response.Write(mi.DeclaringType + "<br>");
            //}

            //Array a = (Array)fi.GetValue();

            //for (int i = 0; i < a.Length; i++)
            //{
            //    //Book b = (Book)a.GetValue(i);
            //    //Console.WriteLine(b.Price);
            //    Response.Write(a.GetValue(i)+"<br>");
            //}
        }