温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:网博直销系统软件源码
当前文件:
WangBoDirect/admin/hy_no.aspx.cs,打开代码结构图
WangBoDirect/admin/hy_no.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
12
public partial class admin_hy_no : System.Web.UI.Page 13
{ 14
protected void Page_Load(object sender, EventArgs e) 15
{ 16
if (!IsPostBack) 17
{ 18
if (Session["aid"] == null) 19
{ Response.Write("<script language=javascript>top.location.href='login.aspx';alert('您未登录!');</script>"); } 20
else 21
{ 22
bind(); 23
if (Request.QueryString["gid"] != null) 24
{ 25
update(); 26
} 27
if (Request.QueryString["sid"] != null) 28
{ 29
sdate(); 30
} 31
} 32
} 33
} 34
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) 35
{ 36
GridView1.PageIndex = e.NewPageIndex; 37
bind(); 38
} 39
void bind() 40
{ 41
string sql = "select * from webhww_hy where webhww_sh=" + false + " and webhww_sort=0 "; 42
GridView1.DataSource = access.GreatDs(sql); 43
GridView1.DataBind(); 44
} 45
void sdate() 46
{ 47
access.DoSql("delete * from webhww_tqsq where webhww_hyxm='" + access.GreatDs("select * from webhww_hy where id=" + Request.QueryString["sid"] + "").Tables[0].Rows[0]["webhww_hyxm"].ToString() + "'"); 48
access.DoSql("delete * from webhww_hy where id="+Request.QueryString["sid"]+""); 49
bind(); 50
} 51
//更新收益 52
void update() 53
{ 54
string str = "select * from webhww_hy where id="+Request.QueryString["gid"]+""; 55
DataTable dt = access.GreatDs(str).Tables[0]; 56
//间接零售额的10% 57
string sql1 = "select * from webhww_hy where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'"; 58
DataTable dt1 = new DataTable(); 59
dt1 = access.GreatDs(sql1).Tables[0]; 60
access.DoSql("update webhww_hy set webhww_jjlsey=webhww_jjlsey+" + int.Parse(dt.Rows[0]["webhww_xgje"].ToString()) + ",webhww_jjlsen=webhww_jjlsen-" +int.Parse(dt.Rows[0]["webhww_xgje"].ToString()) + " where webhww_hybh='" + dt1.Rows[0]["webhww_tjrbh"].ToString() + "'"); 61
//直接零售额的20% 62
access.DoSql("update webhww_hy set webhww_zjlsey=webhww_zjlsey+" + int.Parse(dt.Rows[0]["webhww_xgje"].ToString()) + ",webhww_zjlsen=webhww_zjlsen-" + int.Parse(dt.Rows[0]["webhww_xgje"].ToString()) + " where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'"); 63
access.DoSql("update webhww_hy set webhww_hysr=webhww_hysr+" + double.Parse(dt.Rows[0]["webhww_xgje"].ToString()) * 0.2 + " where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'"); 64
//间接零售额的10% 65
access.DoSql("update webhww_hy set webhww_hysr=webhww_hysr+" + double.Parse(dt.Rows[0]["webhww_xgje"].ToString()) * 0.1 + " where webhww_hybh='" + access.GreatDs("select * from webhww_hy where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'").Tables[0].Rows[0]["webhww_tjrbh"].ToString() + "'"); 66
update1(dt.Rows[0]["webhww_tjrbh"].ToString(), int.Parse(dt.Rows[0]["webhww_xgje"].ToString())); 67
//Response.Redirect("hy_ok.aspx"); 68
access.DoSql("update webhww_hy set webhww_sh=" + true + " where id=" + Request.QueryString["gid"] + ""); 69
//开拓提成 70
string sqlkt = "select * from webhww_hy where webhww_tjrbh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "' and webhww_sh=" + true + " order by id asc"; 71
DataTable dtkt = new DataTable(); 72
dtkt = access.GreatDs(sqlkt).Tables[0]; 73
if (dtkt.Rows.Count == 3) 74
{ 75
double kttc = 0; 76
for (int i = 0; i < 3; i++) 77
{ 78
kttc += double.Parse(dtkt.Rows[i]["webhww_xgje"].ToString()); 79
} 80
access.DoSql("update webhww_hy set webhww_hysr=webhww_hysr+" + kttc * 0.1 + " where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'"); 81
} 82
string sqlkt2 = "select * from webhww_hy where webhww_tjrbh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "' and webhww_sh=" + true + " order by id desc"; 83
DataTable dtkt2 = new DataTable(); 84
dtkt2 = access.GreatDs(sqlkt2).Tables[0]; 85
if (dtkt2.Rows.Count == 6) 86
{ 87
double kttc = 0; 88
for (int i = 0; i < 3; i++) 89
{ 90
kttc += double.Parse(dtkt.Rows[i]["webhww_xgje"].ToString()); 91
} 92
access.DoSql("update webhww_hy set webhww_hysr=webhww_hysr+" + kttc * 0.1 + " where webhww_hybh='" + dt.Rows[0]["webhww_tjrbh"].ToString() + "'"); 93
} 94
95
bind(); 96
} 97
void update1(string _webhww_hybh,int xse) 98
{ 99
string str = "select top 1 * from webhww_hy where webhww_hybh='" + _webhww_hybh + "' order by id desc"; 100
DataTable dt = new DataTable(); 101
dt = access.GreatDs(str).Tables[0]; 102
if (int.Parse(dt.Rows[0]["webhww_ceng"].ToString()) >0) 103
{ 104
update1(dt.Rows[0]["webhww_tjrbh"].ToString(), xse); 105
} 106
107
108
//Response.Write(dt.Rows[0]["id"].ToString() + "<br/>"); 109
//保险补贴 110
int _ceng = int.Parse(access.GreatDs("select * from webhww_hy where id=" + dt.Rows[0]["id"].ToString() + "").Tables[0].Rows[0]["webhww_ceng"].ToString()) + 2; 111
string sql = "select * from webhww_hy where webhww_ceng=" + _ceng + " and webhww_sh="+true+""; 112
DataTable dt1 = new DataTable(); 113
dt1 = access.GreatDs(sql).Tables[0]; 114
if (dt1.Rows.Count == 9) 115
{ 116
access.DoSql("update webhww_hy set webhww_hysr=webhww_hysr+" + xse*0.02 + " where id=" + dt.Rows[0]["id"].ToString() + ""); 117
} 118
119
string str1 = "update webhww_hy set webhww_xsze=webhww_xsze+" + xse + ",webhww_hygs=webhww_hygs+1,webhww_hygs_no=webhww_hygs_no-1 where id=" + dt.Rows[0]["id"].ToString() + ""; 120
access.DoSql(str1); 121
} 122
123
} 124





}
}