private int Verifycompanyform() { Model.PersonInfo personinfo = new Model.PersonInfo(); personinfo.BelongArea = Request.Form["city"]; personinfo.Contact = Request.Form["contact_name"]; personinfo.ContactIDCardFile = corporate_id_card_front; personinfo.ContactIDCardNumber = corporate_id_card_reverse; DAL.PersonInfo.Add(personinfo); Model.PersonInfo temp_personinfo = DAL.PersonInfo.GetModel(); Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.CertifiationIndex = temp_personinfo.ID.ToString(); registeruser.CertifiationStatus = 3; DAL.RegisterUser.Update(registeruser); string json = "{\"code\":200}"; Response.Write(json); Response.End(); //select top 1 * from tra.dbo.订单 order by 下单时间 desc --时间倒序排列取第一条 // companyinfo. //string map_level = Request.Form["map_level"]; //string corporate = Request.Form["corporate"]; //string province = Request.Form["province"]; //string city = Request.Form["city"]; //string town = Request.Form["town"]; //string address = Request.Form["address"]; //string post_code = Request.Form["post_code"]; //string contact_phone = Request.Form["contact_phone"]; //string contact_email = Request.Form["contact_email"]; //string contact_qq = Request.Form["contact_qq"]; //string contact_wechat = Request.Form["contact_wechat"]; return(1); }
/// <summary> /// 更新一条数据,根据ID /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool Update(Model.PersonInfo model) { string strSql = "update PersonInfo set Contact=@Contact, ContactIDCardNumber=@ContactIDCardNumber, ContactIDCardFile=@ContactIDCardFile, CertificationTime=@CertificationTime, BelongArea=@BelongArea where ID = " + model.ID.ToString(); SqlParameter Contact = new SqlParameter("Contact", SqlDbType.NVarChar); Contact.Value = model.Contact; SqlParameter ContactIDCardNumber = new SqlParameter("ContactIDCardNumber", SqlDbType.NVarChar); ContactIDCardNumber.Value = model.ContactIDCardNumber; SqlParameter ContactIDCardFile = new SqlParameter("ContactIDCardFile", SqlDbType.NVarChar); ContactIDCardFile.Value = model.ContactIDCardFile; SqlParameter CertificationTime = new SqlParameter("CertificationTime", SqlDbType.DateTime); CertificationTime.Value = model.CertificationTime; SqlParameter BelongArea = new SqlParameter("BelongArea", SqlDbType.NVarChar); BelongArea.Value = model.BelongArea; return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { Contact, ContactIDCardNumber, ContactIDCardFile, CertificationTime, BelongArea }, connectionString) == 1 ? true : false); }
/// <summary> /// 增加一个用户信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool Add(Model.PersonInfo model) { string strSql = "insert into PersonInfo(Contact, ContactIDCardNumber, ContactIDCardFile, CertificationTime, BelongArea) values(@Contact, @ContactIDCardNumber, @ContactIDCardFile, @CertificationTime, @BelongArea)"; SqlParameter Contact = new SqlParameter("Contact", SqlDbType.NVarChar); Contact.Value = model.Contact; SqlParameter ContactIDCardNumber = new SqlParameter("ContactIDCardNumber", SqlDbType.NVarChar); ContactIDCardNumber.Value = model.ContactIDCardNumber; SqlParameter ContactIDCardFile = new SqlParameter("ContactIDCardFile", SqlDbType.NVarChar); ContactIDCardFile.Value = model.ContactIDCardFile; SqlParameter CertificationTime = new SqlParameter("CertificationTime", SqlDbType.DateTime); CertificationTime.Value = model.CertificationTime; SqlParameter BelongArea = new SqlParameter("BelongArea", SqlDbType.NVarChar); BelongArea.Value = model.BelongArea; return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { Contact, ContactIDCardNumber, ContactIDCardFile, CertificationTime, BelongArea }, connectionString) == 1 ? true : false); }
/// <summary> /// 得到一个实体对象 /// </summary> /// <param name="Id"></param> /// <returns></returns> public static Model.PersonInfo GetModel(string Contact) { string strSql = "select * from PersonInfo where Contact = '" + Contact + "'"; Model.PersonInfo model = new Model.PersonInfo(); DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString); model.Contact = Contact; if (ds.Tables[0].Rows.Count > 0) { model.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]); model.ContactIDCardNumber = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardNumber"]); model.ContactIDCardFile = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardFile"]); model.CertificationTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["CertificationTime"]); model.BelongArea = Convert.ToString(ds.Tables[0].Rows[0]["BelongArea"]); return(model); } else { return(null); } }