protected void btnOK_Click(object sender, EventArgs e) { string scheme = tbScheme.Text.Trim(); if (scheme == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入方案地址!"); return; } Regex regex = new Regex(@"([\w-]+\.)+[\w-]+.([^a-z])(/[\w- ./?%&=]*)?|[a-zA-Z0-9\-\.][\w-]+.([^a-z])(/[\w- ./?%&=]*)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); Match m = regex.Match(scheme); if (!m.Success) { Shove._Web.JavaScript.Alert(this, "地址格式错误,请仔细检查。"); return; } scheme = scheme.ToLower(); if (!scheme.Contains("scheme.aspx?id=")) { Shove._Web.JavaScript.Alert(this, "方案地址格式错误,请仔细检查。"); return; } scheme = scheme.Split(new string[] { "scheme.aspx?id=" }, StringSplitOptions.None)[1].Trim().Split('&')[0].Trim(); //if (new DAL.Tables.T_Schemes().GetCount("ID=" + scheme + " and WinMoney>0") < 1) //{ // Shove._Web.JavaScript.Alert(this, "方案地址不存在或方案未中奖。"); // return; //} DAL.Tables.T_RecallingAllBuyStar t = new DAL.Tables.T_RecallingAllBuyStar(); if (t.GetCount("SchemesID=" + scheme + "") > 0) { Shove._Web.JavaScript.Alert(this.Page, "此方案已存在!"); return; } t.SchemesID.Value = scheme; t.Insert(); Shove._Web.Cache.ClearCache("Admin_RecallingRecord_BindData"); Shove._Web.JavaScript.Alert(this.Page, "操作成功!", "RecallingRecord.aspx"); }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Del") { DAL.Tables.T_RecallingAllBuyStar t = new DAL.Tables.T_RecallingAllBuyStar(); t.Delete("SchemesID=" + e.Item.Cells[6].Text + ""); Shove._Web.Cache.ClearCache("Admin_RecallingRecord_BindData"); Shove._Web.JavaScript.Alert(this.Page, "删除成功!", "RecallingRecord.aspx"); } }