public int Add(QiandaoN obj) { StringBuilder sqlBuilder = new StringBuilder(); sqlBuilder.Append("insert into qd_qiandao(qdName,userName,userPhone,qdAddress,qdTime) "); sqlBuilder.Append("values('{0}','{1}','{2}','{3}','{4}')"); string sql = string.Format(sqlBuilder.ToString(), obj.qdName, obj.userName, obj.userPhone, obj.qdAddress, DateTime.Now); try { return(Convert.ToInt32(SQLHelper.Update(sql))); } catch (SqlException ex) { throw new Exception("数据库操作出现异常!具体信息:\r\n" + ex.Message); } }
//public ActionResult qiandaoHiyi() //{ // Qiandao obj = new QiandaoBLL().GetObjByTime(); // return PartialView("_Qiandao",obj); //} #region 无刷新添加签到 public ActionResult AddQd(QiandaoN obj) { obj = new QiandaoN { //qdName,userName,userPhone,qdAddress,qdTime qdName = obj.qdName, userName = obj.userName, userPhone = obj.userPhone, qdAddress = obj.qdAddress, qdTime = DateTime.Now, }; int result = new QiandaoBLL().Add(obj); if (Request.IsAjaxRequest()) { return(this.Content("签到成功!")); } else { return(this.Content("不是Ajax提交")); } }
public int Add(QiandaoN obj) { return(new QiandaoDAL().Add(obj)); }