private void DeleteTuanGou() { int tuanID = Utils.GetQueryInt("ID"); int result = TuanGouDAO.Instance.Delete(tuanID); Ajax.Message(result); }
private void EditStatu() { int tuanID = Utils.GetQueryInt("ID"); int statu = Utils.GetQueryInt("statu"); int result = TuanGouDAO.Instance.UpdateStatu(tuanID, statu); Ajax.Message(result); }
/// <summary> /// 用户登陆验证 /// </summary> public void ValidateUser() { if (Utils.GetQueryString("op") != "") //Ajax请求 { Ajax.Message(-1000, "您未登录或登录超时,请重新登录后再执行此操作!"); } else { Response.Write("<html><head><script src=\"/js/dialog.js\" type=\"text/javascript\"></script><script type=\"text/javascript\">$topWindow().location='/error.aspx?url=" + Utils.UrlEncode(Request.Url.PathAndQuery) + "&error=-1000';</script></head><bory></body>"); Response.End(); } }
private void AddTuanGou() { TuanGou tuanGou = new TuanGou(); tuanGou.Title = Utils.GetFormString("txt_Title"); tuanGou.CityID = Utils.GetFormInt("ddl_City"); tuanGou.SiteID = Utils.GetFormInt("hid_SiteID"); tuanGou.CategoryID = Utils.GetFormInt("ddl_Category"); tuanGou.Description = Utils.GetFormString("txt_Description"); //如果有包含html标记需要htmldecode tuanGou.MarketPrice = TryConvert.ToDecimal(Request.Form["txt_MarketPrice"]); tuanGou.TuanPrice = TryConvert.ToDecimal(Request.Form["txt_TuanPrice"]); tuanGou.Rebate = TryConvert.ToSingle(Request.Form["txt_Rebate"]); tuanGou.TotalCount = Utils.GetFormInt("txt_TotalCount"); tuanGou.BuyCount = Utils.GetFormInt("txt_BuyCount"); tuanGou.ClickCount = Utils.GetFormInt("txt_ClickCount"); tuanGou.CommentCount = Utils.GetFormInt("txt_CommentCount"); tuanGou.PointCount = Utils.GetFormInt("txt_PointCount"); tuanGou.BeginTime = Convert.ToDateTime(Request.Form["txt_BeginTime"]); tuanGou.EndTime = Convert.ToDateTime(Request.Form["txt_EndTime"]); tuanGou.TuanUrl = Utils.GetFormString("txt_TuanUrl"); tuanGou.ImageThumbUrl = Utils.GetFormString("txt_ImageThumbUrl"); tuanGou.ImageUrl = Utils.GetFormString("txt_ImageUrl"); tuanGou.MerchantName = Utils.GetFormString("txt_MerchantName"); tuanGou.MerchantPhone = Utils.GetFormString("txt_MerchantPhone"); tuanGou.MerchantAddress = Utils.GetFormString("txt_MerchantAddress"); tuanGou.Longitude = TryConvert.ToDouble(Request.Form["txt_Longitude"]); tuanGou.Latitude = TryConvert.ToDouble(Request.Form["txt_Latitude"]); tuanGou.Rank = TryConvert.ToByte(Request.Form["txt_Rank"]); tuanGou.OrderID = Utils.GetFormInt("txt_OrderID"); tuanGou.Statu = TryConvert.ToByte(Request.Form["rdo_Statu"]); tuanGou.AddDate = DateTime.Now; int result; tuanID = Utils.GetQueryInt("ID"); if (tuanID < 1) { tuanGou.UserID = loginUser.UserID; result = TuanGouDAO.Instance.Add(tuanGou); } else { tuanGou.TuanID = tuanID; result = TuanGouDAO.Instance.Update(tuanGou); } Ajax.Message(result); }
private void AddSite() { TuanSite model = new TuanSite(); model.SiteID = Utils.GetQueryInt("ID"); model.UserID = loginUser.UserID; model.CityID = Utils.GetFormInt("ddl_City"); model.SiteName = Utils.GetFormString("txt_SiteName"); model.SiteUrl = Utils.GetFormString("txt_SiteUrl"); if (model.SiteUrl.EndsWith("/")) { model.SiteUrl = model.SiteUrl.TrimEnd('/'); } model.LogoUrl = Utils.GetFormString("txt_LogoUrl"); model.ApiTypeID = (byte)Utils.GetFormInt("ddl_ApiTypeID"); model.ApiUrl = Utils.GetFormString("txt_ApiUrl"); model.QQ = Utils.GetFormString("txt_QQ"); model.SiteType = 1; //Utils.GetFormString("rdo_SiteType"); model.Rank = TryConvert.ToByte(Utils.GetFormInt("txt_Rank")); model.Trust = TryConvert.ToByte(Utils.GetFormInt("txt_Trust")); model.Description = string.Empty; model.Master = string.Empty; model.ContactPerson = string.Empty; model.Phone = string.Empty; model.Email = string.Empty; model.OpenDate = DateTime.Now; model.AddDate = DateTime.Now; model.IsVerify = 1; int result = 0; if (model.SiteID > 0) { result = TuanSiteDAO.Instance.Update(model); } else { result = TuanSiteDAO.Instance.Add(model); } Ajax.Message(result); }
protected void Page_Load(object sender, EventArgs e) { int siteID = Utils.GetFormInt("siteID"); int apiTypeID = Utils.GetFormInt("apiTypeID"); string apiUrl = Utils.GetFormString("apiUrl"); int rank = Utils.GetFormInt("rank"); if (siteID == -1) { Ajax.Message(-1, "不存在网站信息。"); } if (apiTypeID == 0) { Ajax.Message(-1, "未指定API地址类型。"); } if (apiUrl.Length == 0) { Ajax.Message(-1, "API地址为空。"); } int getCount = 0; try { IList <TuanGou> tuanGouList = ApiProvider.GetTuanGouList(apiTypeID, apiUrl); if (tuanGouList != null && tuanGouList.Count > 0) { for (int i = 0; i < tuanGouList.Count; i++) { tuanGouList[i].SiteID = siteID; tuanGouList[i].Rank = (byte)rank; getCount += TuanGouDAO.Instance.AddOrUpdate(tuanGouList[i]); } } } catch (Exception ex) { Ajax.Message(-1, ex.Message.Replace("\\", "\\\\").Replace("'", "\\'")); } Ajax.Message(1, getCount.ToString()); }
/// <summary> /// 重写系统异常类 /// </summary> protected override void OnError(EventArgs e) { Exception ex = Server.GetLastError().GetBaseException(); if (ex != null) { string msg = string.Format("错误信息:{0}", ex.Message); if (Utils.GetQueryString("op") != "") //Ajax请求 { Ajax.Message(-1001, msg.Replace("\\", "\\\\").Replace("'", "\\'")); } else { Message.Dialog("系统运行时遇到未处理错误!", msg, "-1", MessageIcon.Error, 0); } Server.ClearError(); } base.OnError(e); }
/// <summary> /// 后台登陆验证 /// </summary> public void ValidateUser() { if (loginUser == null) { if (Utils.GetQueryString("op") != "") //Ajax请求 { Ajax.Message(-1000, "您未登录或登录超时,请重新登录后再执行此操作!"); } else { //Response.Write("<html><head><script src=\"/js/dialog.js\" type=\"text/javascript\"></script><script type=\"text/javascript\">$topWindow().location='/error.aspx?url=" + // Utils.UrlEncode(Request.Url.PathAndQuery) + "&error=-1000';</script></head><bory></body>"); //Response.End(); } } else { if (loginUser.UsergroupID > 3) { Message.Dialog("您没有权限访问网站系统后台中心!", "/index.aspx", MessageIcon.Warning); } } }
/// <summary> /// 删除团购网站 /// </summary> public void DeleteTuanSite() { int result = TuanSiteDAO.Instance.Delete(Utils.GetQueryInt("ID")); Ajax.Message(result); }