public ActionResult AccessTypeSave() { SystemConfigureLib.AccessTypeControllerr accessTypeControllerr = new SystemConfigureLib.AccessTypeControllerr(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string accesstype_id = CommonLib.Common.Validate.IsNullString(Request.Params["AccessTypeID"]); if (accesstype_id == "") { accesstype_id = accessTypeControllerr.add(data); if (accesstype_id == null) { return RedirectToRoute("accesstype-add"); } } else { accessTypeControllerr.save(data); } return RedirectToRoute("accesstype-add"); }
public string ExamRecord() { JxLib.UserExamController userExamController = new JxLib.UserExamController(); HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"]; DatabaseLib.Tools tools = new DatabaseLib.Tools(); System.Collections.Hashtable data = tools.paramToData(context.Request.Form); string user_id = context.Request.Cookies["user_id"].Value; data["StudentID"] = user_id; userExamController.ExamLog(data); Models.Result result = new Models.Result(); if (userExamController.Result) { result.code = "200"; } else { result.code = "0"; } result.message = userExamController.Message; return Newtonsoft.Json.JsonConvert.SerializeObject(result).Replace("\"", "'"); }
public virtual void delete(string id) { DatabaseLib.DatabaseFactory dataFactory = new DatabaseLib.DatabaseFactory(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); //获取数据访问操作端 DatabaseLib.IDatabase dataClient = dataFactory.CreateClient(BaseLib.SystemType.Web); string strSql = this.SqlText + id; strSql = tools.fixSqlText(strSql); dataClient.SqlText = strSql; dataClient.Execute(CommandType.Text); this.Message = dataClient.Message; this.Result = dataClient.Result; }
public ActionResult UserSave() { SystemConfigureLib.UserController userController = new SystemConfigureLib.UserController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string user_id = CommonLib.Common.Validate.IsNullString(Request.Params["UserID"]); if (user_id == "") { user_id = userController.add(data); if (user_id == null) { return RedirectToRoute("user-add"); } } else { userController.save(data); } return RedirectToRoute("user-add"); }
public ActionResult UseCouponSave() { JxLib.CouponController couponController = new JxLib.CouponController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); System.Collections.Hashtable item = couponController.loadByPassword(data["Password"].ToString()); if (item == null || item["IsUse"].ToString() != "0") { //报错跳转页面 return Redirect("/manage/coupon/result"); } return Redirect("/manage/coupon/result/"+ item["CouponID"].ToString()); }
public ActionResult StudentCouponSave() { JxLib.CouponController couponController = new JxLib.CouponController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string password = couponController.getPassword(); data.Add("Password", password); string coupon_id = couponController.add(data); //失败应该有一个错误页面 if (coupon_id == "") { return RedirectToRoute("manage-student-list"); } return RedirectToRoute("manage-student-list"); }
public ActionResult MenuSave() { SystemConfigureLib.MenuController menuController = new SystemConfigureLib.MenuController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable menu_data = tools.paramToData(strParam); string menu_id = CommonLib.Common.Validate.IsNullString(Request.Params["MenuID"]); if (menu_id == "") { menu_id = menuController.add(menu_data); if (menu_id == null) { return RedirectToRoute("menu-add"); } } else { menuController.save(menu_data); } return RedirectToRoute("menu-add"); }
public ActionResult ExamTypeSave() { JxLib.ExamTypeController examtypeController = new JxLib.ExamTypeController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string examtype_id = CommonLib.Common.Validate.IsNullString(Request.Params["ExamTypeID"]); if (examtype_id == "") { examtype_id = examtypeController.add(data); if (examtype_id == null) { return RedirectToRoute("examtype-add"); } } else { examtypeController.save(data); } return RedirectToRoute("examtype-add"); }
public ActionResult DeptSave() { SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string dept_id = CommonLib.Common.Validate.IsNullString(Request.Params["DeptID"]); if (dept_id == "") { dept_id = deptController.add(data); if (dept_id == null) { return RedirectToRoute("dept-add"); } } else { deptController.save(data); } return RedirectToRoute("dept-add"); }
/// <summary> /// 合并模板sql语句和数据为执行sql语句 /// </summary> /// <param name="strSql">模板sql语句</param> /// <param name="data">hashtable类型的数据集合</param> /// <returns>执行的sql语句字符串</returns> public string extendSql(string strSql, System.Collections.Hashtable data) { DatabaseLib.Tools tools = new DatabaseLib.Tools(); foreach (System.Collections.DictionaryEntry item in data) { string strKey = "@" + item.Key + "@"; string strValue = item.Value.ToString(); strSql = strSql.Replace(strKey, strValue); } strSql = tools.fixSqlText(strSql); return strSql; }
public ActionResult StudentEnterSave() { JxLib.StudentController studentController = new JxLib.StudentController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); CacheLib.Cookie cookie = new CacheLib.Cookie(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string user_id = cookie.GetCookie("user_id"); //深大驾校测试代码 data.Add("SchoolID", "1"); //data.Add("StudentID", "00001"); data.Add("StudentID", user_id); data.Add("EnterDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); studentController.save(data); studentController.saveEnter(data); if (studentController.Result) { return RedirectToRoute("enter-success"); } else { return RedirectToRoute("home"); } }
public ActionResult MyCoupon() { JxLib.CouponController couponController = new JxLib.CouponController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); CacheLib.Cookie cookie = new CacheLib.Cookie(); string user_id = cookie.GetCookie("user_id"); List<System.Collections.Hashtable> list = couponController.getByStuentId(user_id); ViewData["data"] = list; ViewData["title"] = "我的优惠卷"; return View(); }