/// <summary> /// 分页获取数据列表 /// </summary> //public DataSet GetList(int PageSize,int PageIndex,string strWhere) //{ //return dal.GetList(PageSize,PageIndex,strWhere); //} #endregion BasicMethod #region ExtensionMethod /// <summary> /// 保存表单数据 /// </summary> /// <returns></returns> public string SaveFormContent() { string Mid = HttpContext.Current.Request.QueryString["Mid"].ToString(); string word = HttpContext.Current.Request["Word"].ToString(); string msg = "提交失败!"; if (HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname] != null) { if (Common.WordProcess.IsNum(Mid)) { string Syear = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Syear"].ToString(); string Sgrade = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString(); string Sclass = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString(); string Wsid = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Sid"].ToString(); string Wip = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["LoginIp"].ToString(); string Sname = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Sname"].ToString(); string Snum = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["Snum"].ToString(); string Wterm = HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString(); Model.TxtFormBack rmodel = new Model.TxtFormBack(); BLL.TxtFormBack rbll = new BLL.TxtFormBack(); rmodel.Rmid = Int32.Parse(Mid); rmodel.Ragree = 0; rmodel.Rclass = Int32.Parse(Sclass); rmodel.Rgrade = Int32.Parse(Sgrade); rmodel.Rip = Wip; rmodel.Rscore = 0; rmodel.Rsid = Int32.Parse(Wsid); rmodel.Rsnum = Snum; rmodel.Rterm = Int32.Parse(Wterm); rmodel.Rtime = DateTime.Now; rmodel.Rwords = HttpUtility.HtmlEncode(word); rmodel.Ryear = Int32.Parse(Syear); int Rid = rbll.GetRid(Wsid, Mid); rmodel.Rid = Rid; if (Rid > 0) { if (rbll.UpdateContent(rmodel)) //如果提交过表单,再更新提交的内容 { msg = "修改内容成功!"; } else { msg = "老师已评价,不可修改!"; } } else { rbll.Add(rmodel);//否则提交表单内容 msg = "提交内容成功!"; } } else { msg = "Mid参数格式错误!"; } } else { msg = "未登录,无权限!cookies无效"; } return(msg); }
/// <summary> /// 分页获取数据列表 /// </summary> //public DataSet GetList(int PageSize,int PageIndex,string strWhere) //{ //return dal.GetList(PageSize,PageIndex,strWhere); //} #endregion BasicMethod #region ExtensionMethod /// <summary> /// 保存表单数据 /// </summary> /// <returns></returns> public string SaveFormContent() { string Mid = HttpContext.Current.Request.QueryString["Mid"].ToString(); string word = HttpContext.Current.Request["Word"].ToString(); string msg = "提交失败!"; if (HttpContext.Current.Request.Cookies[Common.CookieHelp.stuCookieNname] != null) { if (Common.WordProcess.IsNum(Mid)) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); int Syear = cook.Syear; int Sgrade = cook.Sgrade; int Sclass = cook.Sclass; int Wsid = cook.Sid; string Wip = cook.LoginIp; string Sname = cook.Sname; string Snum = cook.Snum; int Wterm = cook.ThisTerm; Model.TxtFormBack rmodel = new Model.TxtFormBack(); BLL.TxtFormBack rbll = new BLL.TxtFormBack(); rmodel.Rmid = Int32.Parse(Mid); rmodel.Ragree = 0; rmodel.Rclass = Sclass; rmodel.Rgrade = Sgrade; rmodel.Rip = Wip; rmodel.Rscore = 0; rmodel.Rsid = Wsid; rmodel.Rsnum = Snum; rmodel.Rterm = Wterm; rmodel.Rtime = DateTime.Now; rmodel.Rwords = HttpUtility.HtmlEncode(word); rmodel.Ryear = Syear; int Rid = rbll.GetRid(Wsid.ToString(), Mid); rmodel.Rid = Rid; if (Rid > 0) { if (rbll.UpdateContent(rmodel)) //如果提交过表单,再更新提交的内容 { msg = "修改内容成功!"; } else { msg = "老师已评价,不可修改!"; } } else { rbll.Add(rmodel);//否则提交表单内容 msg = "提交内容成功!"; } } else { msg = "Mid参数格式错误!"; } } else { msg = "未登录,无权限!cookies无效"; } return(msg); }