146 lines
7.7 KiB
C#
146 lines
7.7 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
using System.Data;
|
|||
|
|
namespace Mtxfw.VipSite
|
|||
|
|
{
|
|||
|
|
public partial class Admin_Member_zbjy0_add : Mtxfw.Utility.MemberBase
|
|||
|
|
{
|
|||
|
|
public Mtxfw.DAL.user_Goods daoGoods = new Mtxfw.DAL.user_Goods();
|
|||
|
|
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|||
|
|
DAL.user_Results daoResults = new DAL.user_Results();
|
|||
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|||
|
|
public String strTitle = "",strBody = "";
|
|||
|
|
public int gtype = 0;
|
|||
|
|
protected override void OnLoad(EventArgs e)
|
|||
|
|
{
|
|||
|
|
base.OnLoad(e);
|
|||
|
|
string hostname = Request.Url.Host;
|
|||
|
|
|
|||
|
|
if (!IsPostBack)
|
|||
|
|
{
|
|||
|
|
if (Session["IFPassword"] == null)
|
|||
|
|
{
|
|||
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_zbjy0_add.aspx");
|
|||
|
|
}
|
|||
|
|
if (IFStores != 1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
if (MemberJS.IndexOf("发货管理") == -1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
Data_Bind();
|
|||
|
|
}
|
|||
|
|
Btn_Insert.Click += delegate(object s, EventArgs ex)
|
|||
|
|
{
|
|||
|
|
Text_UserName.Text = Text_UserName.Text.Trim();
|
|||
|
|
Text_Num.Text = Text_Num.Text.Trim();
|
|||
|
|
if (Text_UserName.Text != "" && Text_JE.Text != "" && Text_Num.Text != "")
|
|||
|
|
{
|
|||
|
|
int Num = Convert.ToInt32(Text_Num.Text);
|
|||
|
|
Double price = Convert.ToDouble(Text_JE.Text);
|
|||
|
|
Double money = Convert.ToDouble(price.ToString("f2"));
|
|||
|
|
if (Num > 0)
|
|||
|
|
{
|
|||
|
|
DataSet ds = daoUser.GetList1("id,SJRememberID,Phone2,AliAccount,weixinimage,umoney30", "UserName='" + Text_UserName.Text + "'");
|
|||
|
|
if (ds.Tables[0].Rows.Count >0)
|
|||
|
|
{
|
|||
|
|
int MemberId = Convert.ToInt32(ds.Tables[0].Rows[0]["id"]);
|
|||
|
|
int SJRememberID = Convert.ToInt32(ds.Tables[0].Rows[0]["SJRememberID"]);
|
|||
|
|
string Phone2 = ds.Tables[0].Rows[0]["Phone2"].ToString();
|
|||
|
|
string AliAccount = ds.Tables[0].Rows[0]["AliAccount"].ToString();
|
|||
|
|
string weixinimage = ds.Tables[0].Rows[0]["weixinimage"].ToString();
|
|||
|
|
Double umoney30 = Convert.ToDouble(Convert.ToDouble(ds.Tables[0].Rows[0]["umoney30"]).ToString("f2"));
|
|||
|
|
if (Phone2 != "" || AliAccount != "" || weixinimage != "")
|
|||
|
|
{
|
|||
|
|
Double kcmoney = Convert.ToDouble((Convert.ToDouble(config.webMoney32) / 100 * (price * Num)).ToString("f2"));
|
|||
|
|
if (umoney30 >= kcmoney)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
DateTime dt = DateTime.Now;
|
|||
|
|
for (int i = 0; i < Num; i++)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Double symoney = Convert.ToDouble((Convert.ToDouble(config.webMoney41) / 100 * money).ToString("f2"));
|
|||
|
|
Mtxfw.Model.user_Results ModelResults = new Mtxfw.Model.user_Results();
|
|||
|
|
ModelResults.b0 = money;
|
|||
|
|
ModelResults.b1 = 0;
|
|||
|
|
ModelResults.b2 = 0;//预约类型
|
|||
|
|
ModelResults.b3 = 0;
|
|||
|
|
ModelResults.b4 = 0;
|
|||
|
|
ModelResults.b5 = 0;
|
|||
|
|
ModelResults.b6 = 0;
|
|||
|
|
ModelResults.b7 = 0;
|
|||
|
|
ModelResults.b8 = 1;//0买进1卖出
|
|||
|
|
ModelResults.b9 = 0;//b8=卖出时0正常卖出1转售中
|
|||
|
|
ModelResults.b10 = 0;
|
|||
|
|
ModelResults.b11 = 0;
|
|||
|
|
ModelResults.b12 = 0;
|
|||
|
|
ModelResults.b13 = 0;
|
|||
|
|
ModelResults.b14 = 0;
|
|||
|
|
ModelResults.b15 = 0;
|
|||
|
|
ModelResults.b16 = 0;
|
|||
|
|
ModelResults.b17 = 0;
|
|||
|
|
ModelResults.b18 = 0;
|
|||
|
|
ModelResults.conent = "卖出";
|
|||
|
|
ModelResults.Totalmoney = money + symoney;
|
|||
|
|
ModelResults.MemberId = MemberId;
|
|||
|
|
ModelResults.UserId = 0;
|
|||
|
|
ModelResults.Sended = (SJRememberID == 0 ? MemberId : SJRememberID);
|
|||
|
|
ModelResults.ListNumber = "";
|
|||
|
|
ModelResults.Managers = "";
|
|||
|
|
ModelResults.Seef = 0;
|
|||
|
|
ModelResults.utype = "12";
|
|||
|
|
ModelResults.addtime = dt;
|
|||
|
|
Int64 ResultId = daoResults.Add(ModelResults);
|
|||
|
|
}
|
|||
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|||
|
|
logmodel.MemberId = Card;
|
|||
|
|
logmodel.AddTime = DateTime.Now;
|
|||
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|||
|
|
logmodel.Body = "添加卖出订单,会员账号:" + Text_UserName.Text;
|
|||
|
|
logmodel.UType = 0;
|
|||
|
|
logmodel.gtype = gtype;
|
|||
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|||
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('添加成功!');</script>");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('" + Text_UserName.Text + "的转卖积分不足"+ kcmoney.ToString() + "!');</script>");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('未绑定支付会员不能添加!');</script>");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('会员账号不存在!');</script>");
|
|||
|
|
}
|
|||
|
|
ds.Clear();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('数量必须大于0!');</script>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void Data_Bind()
|
|||
|
|
{
|
|||
|
|
strTitle = "添加卖出订单";
|
|||
|
|
Page.Title = strTitle + " - " + GetWebName;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|