Beispiel #1
0
        public static bool InsertSanvtItem(string sanvtName, string account
                                           , UInt32 DataID1, UInt32 Number1
                                           , UInt32 DataID2, UInt32 Number2
                                           , UInt32 DataID3, UInt32 Number3
                                           , UInt32 DataID4, UInt32 Number4
                                           , UInt32 DataID5, UInt32 Number5)
        {
            if (sanvtName == string.Empty || account == string.Empty)
            {
                return(false);
            }
            if (DataID1 == 0 && Number1 == 0 &&
                DataID2 == 0 && Number2 == 0 &&
                DataID3 == 0 && Number3 == 0 &&
                DataID4 == 0 && Number4 == 0 &&
                DataID5 == 0 && Number5 == 0)
            {
                return(false);
            }

            string cmd = "INSERT INTO " + sanvtName + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                         + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                         + "values ('" + account + "',0,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "',getdate(),getdate(),0,0,0,"
                         + "" + DataID1 + "," + Number1 + "," + DataID2 + "," + Number2 + "," + DataID3 + "," + Number3 + "," + DataID4 + "," + Number4 + "," + DataID5 + "," + Number5 + ")";

            string ret = CSGHelper.SqlCommand(cmd);

            if (ret != "success")
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        public static bool AddAcountPoint(string account, int dbCount)
        {
            if (!m_SqlConnected)
                return false;

            string cmd = "DECLARE @account varchar(21) \n"
                                + "DECLARE @point int \n"
                                + "DECLARE @old_point int \n"
                                + "DECLARE @new_point int \n"
                                + "set @account = '" + account + "' \n"
                                + "set @point = " + dbCount + " \n"
                                + "Select @old_point=point from " + m_sqlAccount + ".dbo.game_acc where account = @account \n"
                                + "SET @new_point = @point + @old_point \n"
                                + "Update " + m_sqlAccount + ".dbo.game_acc set point = @new_point where account = @account";

            mutex.WaitOne();
            string ret = CSGHelper.SqlCommand(cmd);
            mutex.ReleaseMutex();
            if (ret != "success")
            {
                return false;
            }
            return true;
        }
Beispiel #3
0
        private void btn_rcgInit_Click(object sender, EventArgs e)
        {
            if (btn_sql.Text == "连接数据库")
            {
                MessageBox.Show("请先连接数据库!");
                return;
            }

            //加载设定的配置
            Recharge_Conf[] conf = new Recharge_Conf[7];
            for (int i = 0; i < 7; i++)
            {
                string rcgLevel = "档位:" + (i + 1);
                string rcgConf  = CIniCtrl.ReadIniData(rcgLevel, "rcgConf", "", serverIni);
                string leftNum  = CIniCtrl.ReadIniData(rcgLevel, "leftNum", "", serverIni);
                string rightNum = CIniCtrl.ReadIniData(rcgLevel, "rightNum", "", serverIni);

                string id   = "";
                string name = "";
                string num  = "";
                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id1", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name1", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num1", "", serverIni);
                //配置内容
                conf[i].id1   = id == "" ? "0" : id;
                conf[i].name1 = name == "" ? "空" : name;
                conf[i].num1  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id2", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name2", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num2", "", serverIni);
                //配置内容
                conf[i].id2   = id == "" ? "0" : id;
                conf[i].name2 = name == "" ? "空" : name;
                conf[i].num2  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id3", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name3", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num3", "", serverIni);
                //配置内容
                conf[i].id3   = id == "" ? "0" : id;
                conf[i].name3 = name == "" ? "空" : name;
                conf[i].num3  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id4", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name4", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num4", "", serverIni);
                //配置内容
                conf[i].id4   = id == "" ? "0" : id;
                conf[i].name4 = name == "" ? "空" : name;
                conf[i].num4  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id5", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name5", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num5", "", serverIni);
                //配置内容
                conf[i].id5   = id == "" ? "0" : id;
                conf[i].name5 = name == "" ? "空" : name;
                conf[i].num5  = num == "" ? "0" : num;

                leftNum  = leftNum == "" ? "0" : leftNum;
                rightNum = rightNum == "" ? "-1" : rightNum;
                if (Int32.Parse(leftNum) >= Int32.Parse(rightNum))
                {
                    conf[i].leftNum  = "0";
                    conf[i].rightNum = "-1";
                }
                else
                {
                    conf[i].leftNum  = leftNum;
                    conf[i].rightNum = rightNum;
                }
            }

            string cmd = "";
            string ret = "";

            //删除[recharge_history]表
            cmd = @"DROP TABLE recharge_history";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("删除[recharge_history]表失败!");
                //return;
            }
            //删除game_acc 的 Account_Insert触发器
            cmd = @"drop trigger Account_Insert ";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("删除game_acc 的 Account_Insert触发器失败!");
                //return;
            }
            //创建[recharge_history]表
            cmd =
                @"create table [recharge_history]
(
account varchar(21) PRIMARY KEY,
point int default 0,
time datetime
)";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("创建[recharge_history]表失败!");
                return;
            }
            //同步账户名
            cmd =
                @"insert INTO recharge_history(account,point)
SELECT account,point
FROM game_acc";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("同步game_acc账户名和point到recharge_history失败!");
                return;
            }
            //创建game_acc 的 Account_Insert触发器,game_acc有插入时同样插入信息到recharge_history
            cmd =
                @"CREATE TRIGGER Account_Insert ON dbo.game_acc 
FOR INSERT 
AS 
DECLARE @account varchar(21)
Select @account=account from inserted 
insert INTO recharge_history(account,point) values (@account,0)";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("创建game_acc 的 Account_Insert触发器失败!");
                return;
            }
            //创建recharge_history 的 Recharge_Update触发器,充值更新point,触发更新game_acc的point
            cmd =
                @"CREATE TRIGGER Recharge_Update ON dbo.recharge_history 
FOR UPDATE 
AS 
DECLARE @account varchar(21)
DECLARE @point int
DECLARE @old_point int
DECLARE @add_point int
DECLARE @old_point_acc int
DECLARE @new_point_acc int
Select @account=account from inserted 
Select @point=point from inserted 
SELECT @old_point=point FROM DELETED
SET @add_point = @point - @old_point

Select @old_point_acc=point from dbo.game_acc where account = @account
set @new_point_acc = @old_point_acc + @add_point
Update dbo.game_acc set point = @new_point_acc where account = @account

DECLARE @cardid varchar(100)
DECLARE @dtDate datetime
set @dtDate = getdate()
SET @cardid = CONVERT(varchar(100), GETDATE(), 21)
PRINT @cardid

DECLARE @DataID1 int
DECLARE @Number1 int
DECLARE @DataID2 int
DECLARE @Number2 int
DECLARE @DataID3 int
DECLARE @Number3 int
DECLARE @DataID4 int
DECLARE @Number4 int
DECLARE @DataID5 int
DECLARE @Number5 int

set @DataID1 = 0
set @Number1 = 0
set @DataID2 = 0
set @Number2 = 0
set @DataID3 = 0
set @Number3 = 0
set @DataID4 = 0
set @Number4 = 0
set @DataID5 = 0
set @Number5 = 0

if (@add_point >= " + conf[0].leftNum + " AND @add_point < " + conf[0].rightNum + @")
	begin
	set @DataID1 = "     + conf[0].id1 + @"
	set @Number1 = "     + conf[0].num1 + @"
	set @DataID2 = "     + conf[0].id2 + @"
	set @Number2 = "     + conf[0].num2 + @"
	set @DataID3 = "     + conf[0].id3 + @"
	set @Number3 = "     + conf[0].num3 + @"
	set @DataID4 = "     + conf[0].id4 + @"
	set @Number4 = "     + conf[0].num4 + @"
	set @DataID5 = "     + conf[0].id5 + @"
	set @Number5 = "     + conf[0].num5 + @"
	end
else if (@add_point >= " + conf[1].leftNum + " AND @add_point < " + conf[1].rightNum + @")
	begin
	set @DataID1 = "     + conf[1].id1 + @"
	set @Number1 = "     + conf[1].num1 + @"
	set @DataID2 = "     + conf[1].id2 + @"
	set @Number2 = "     + conf[1].num2 + @"
	set @DataID3 = "     + conf[1].id3 + @"
	set @Number3 = "     + conf[1].num3 + @"
	set @DataID4 = "     + conf[1].id4 + @"
	set @Number4 = "     + conf[1].num4 + @"
	set @DataID5 = "     + conf[1].id5 + @"
	set @Number5 = "     + conf[1].num5 + @"
	end
else if (@add_point >= " + conf[2].leftNum + " AND @add_point < " + conf[2].rightNum + @")
	begin
	set @DataID1 = "     + conf[2].id1 + @"
	set @Number1 = "     + conf[2].num1 + @"
	set @DataID2 = "     + conf[2].id2 + @"
	set @Number2 = "     + conf[2].num2 + @"
	set @DataID3 = "     + conf[2].id3 + @"
	set @Number3 = "     + conf[2].num3 + @"
	set @DataID4 = "     + conf[2].id4 + @"
	set @Number4 = "     + conf[2].num4 + @"
	set @DataID5 = "     + conf[2].id5 + @"
	set @Number5 = "     + conf[2].num5 + @"
	end
else if (@add_point >= " + conf[3].leftNum + " AND @add_point < " + conf[3].rightNum + @")
	begin
	set @DataID1 = "     + conf[3].id1 + @"
	set @Number1 = "     + conf[3].num1 + @"
	set @DataID2 = "     + conf[3].id2 + @"
	set @Number2 = "     + conf[3].num2 + @"
	set @DataID3 = "     + conf[3].id3 + @"
	set @Number3 = "     + conf[3].num3 + @"
	set @DataID4 = "     + conf[3].id4 + @"
	set @Number4 = "     + conf[3].num4 + @"
	set @DataID5 = "     + conf[3].id5 + @"
	set @Number5 = "     + conf[3].num5 + @"
	end
else if (@add_point >= " + conf[4].leftNum + " AND @add_point < " + conf[4].rightNum + @")
	begin
	set @DataID1 = "     + conf[4].id1 + @"
	set @Number1 = "     + conf[4].num1 + @"
	set @DataID2 = "     + conf[4].id2 + @"
	set @Number2 = "     + conf[4].num2 + @"
	set @DataID3 = "     + conf[4].id3 + @"
	set @Number3 = "     + conf[4].num3 + @"
	set @DataID4 = "     + conf[4].id4 + @"
	set @Number4 = "     + conf[4].num4 + @"
	set @DataID5 = "     + conf[4].id5 + @"
	set @Number5 = "     + conf[4].num5 + @"
	end
else if (@add_point >= " + conf[5].leftNum + " AND @add_point < " + conf[5].rightNum + @")
	begin
	set @DataID1 = "     + conf[5].id1 + @"
	set @Number1 = "     + conf[5].num1 + @"
	set @DataID2 = "     + conf[5].id2 + @"
	set @Number2 = "     + conf[5].num2 + @"
	set @DataID3 = "     + conf[5].id3 + @"
	set @Number3 = "     + conf[5].num3 + @"
	set @DataID4 = "     + conf[5].id4 + @"
	set @Number4 = "     + conf[5].num4 + @"
	set @DataID5 = "     + conf[5].id5 + @"
	set @Number5 = "     + conf[5].num5 + @"
	end
else if (@add_point >= " + conf[6].leftNum + " AND @add_point < " + conf[6].rightNum + @")
	begin
	set @DataID1 = "     + conf[6].id1 + @"
	set @Number1 = "     + conf[6].num1 + @"
	set @DataID2 = "     + conf[6].id2 + @"
	set @Number2 = "     + conf[6].num2 + @"
	set @DataID3 = "     + conf[6].id3 + @"
	set @Number3 = "     + conf[6].num3 + @"
	set @DataID4 = "     + conf[6].id4 + @"
	set @Number4 = "     + conf[6].num4 + @"
	set @DataID5 = "     + conf[6].id5 + @"
	set @Number5 = "     + conf[6].num5 + @"
	end

INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,
DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)
values (@account,0,@cardid,@dtDate,@dtDate,0,0,0,
@DataID1,@Number1,@DataID2,@Number2,@DataID3,@Number3,@DataID4,@Number4,@DataID5,@Number5)";
            ret = CSGHelper.SqlCommand(cmd);

            if (ret == "success")
            {
                string msg = @"当前设定如下:

本服不设定非固定充值,非以下固定充值将以第三方设置比例结算。

(1)范围:" + conf[0].leftNum + "-" + conf[0].rightNum + "额外获得:" + conf[0].name1 + "*" + conf[0].num1 + ";" + conf[0].name2 + "*" + conf[0].num2 + ";" + conf[0].name3 + "*" + conf[0].num3 + ";" + conf[0].name4 + "*" + conf[0].num4 + ";" + conf[0].name5 + "*" + conf[0].num5 + @";

(2)范围:" + conf[1].leftNum + "-" + conf[1].rightNum + "额外获得:" + conf[1].name1 + "*" + conf[1].num1 + ";" + conf[1].name2 + "*" + conf[1].num2 + ";" + conf[1].name3 + "*" + conf[1].num3 + ";" + conf[1].name4 + "*" + conf[1].num4 + ";" + conf[1].name5 + "*" + conf[1].num5 + @";

(3)范围:" + conf[2].leftNum + "-" + conf[2].rightNum + "额外获得:" + conf[2].name1 + "*" + conf[2].num1 + ";" + conf[2].name2 + "*" + conf[2].num2 + ";" + conf[2].name3 + "*" + conf[2].num3 + ";" + conf[2].name4 + "*" + conf[2].num4 + ";" + conf[2].name5 + "*" + conf[2].num5 + @";

(4)范围:" + conf[3].leftNum + "-" + conf[3].rightNum + "额外获得:" + conf[3].name1 + "*" + conf[3].num1 + ";" + conf[3].name2 + "*" + conf[3].num2 + ";" + conf[3].name3 + "*" + conf[3].num3 + ";" + conf[3].name4 + "*" + conf[3].num4 + ";" + conf[3].name5 + "*" + conf[3].num5 + @";

(5)范围:" + conf[4].leftNum + "-" + conf[4].rightNum + "额外获得:" + conf[4].name1 + "*" + conf[4].num1 + ";" + conf[4].name2 + "*" + conf[4].num2 + ";" + conf[4].name3 + "*" + conf[4].num3 + ";" + conf[4].name4 + "*" + conf[4].num4 + ";" + conf[4].name5 + "*" + conf[4].num5 + @";

(6)范围:" + conf[5].leftNum + "-" + conf[5].rightNum + "额外获得:" + conf[5].name1 + "*" + conf[5].num1 + ";" + conf[5].name2 + "*" + conf[5].num2 + ";" + conf[5].name3 + "*" + conf[5].num3 + ";" + conf[5].name4 + "*" + conf[5].num4 + ";" + conf[5].name5 + "*" + conf[5].num5 + @";

(6)范围:" + conf[6].leftNum + "-" + conf[6].rightNum + "额外获得:" + conf[6].name1 + "*" + conf[6].num1 + ";" + conf[6].name2 + "*" + conf[6].num2 + ";" + conf[6].name3 + "*" + conf[6].num3 + ";" + conf[6].name4 + "*" + conf[6].num4 + ";" + conf[6].name5 + "*" + conf[6].num5 + @";";
                MessageBox.Show(msg);
            }
            else
            {
                MessageBox.Show("创建recharge_history 的 Recharge_Update触发器失败!");
                return;
            }
        }
Beispiel #4
0
        private void btn_bxSend_Click(object sender, EventArgs e)
        {
            if (!m_Active)
            {
                MessageBox.Show("软件尚未激活! 请联系软件发布人给予激活!");
                return;
            }
            if (txt_xbAccount.Text != string.Empty)
            {
                int xbCount1  = 0;
                int xbCount2  = 0;
                int xbCount3  = 0;
                int xbCount4  = 0;
                int xbCount5  = 0;
                int xbCount6  = 0;
                int xbCount7  = 0;
                int xbCount8  = 0;
                int xbCount9  = 0;
                int xbCount10 = 0;
                int xbId1     = 1;
                int xbId2     = 1;
                int xbId3     = 1;
                int xbId4     = 1;
                int xbId5     = 1;
                int xbId6     = 1;
                int xbId7     = 1;
                int xbId8     = 1;
                int xbId9     = 1;
                int xbId10    = 1;
                if (!string.IsNullOrEmpty(txt_xbCount1.Text) || CFormat.isNumberic(txt_xbCount1.Text))
                {
                    xbCount1 = Convert.ToInt32(txt_xbCount1.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount2.Text) || CFormat.isNumberic(txt_xbCount2.Text))
                {
                    xbCount2 = Convert.ToInt32(txt_xbCount2.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount3.Text) || CFormat.isNumberic(txt_xbCount3.Text))
                {
                    xbCount3 = Convert.ToInt32(txt_xbCount3.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount4.Text) || CFormat.isNumberic(txt_xbCount4.Text))
                {
                    xbCount4 = Convert.ToInt32(txt_xbCount4.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount5.Text) || CFormat.isNumberic(txt_xbCount5.Text))
                {
                    xbCount5 = Convert.ToInt32(txt_xbCount5.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount6.Text) || CFormat.isNumberic(txt_xbCount6.Text))
                {
                    xbCount6 = Convert.ToInt32(txt_xbCount6.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount7.Text) || CFormat.isNumberic(txt_xbCount7.Text))
                {
                    xbCount7 = Convert.ToInt32(txt_xbCount7.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount8.Text) || CFormat.isNumberic(txt_xbCount8.Text))
                {
                    xbCount8 = Convert.ToInt32(txt_xbCount8.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount9.Text) || CFormat.isNumberic(txt_xbCount9.Text))
                {
                    xbCount9 = Convert.ToInt32(txt_xbCount9.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount10.Text) || CFormat.isNumberic(txt_xbCount10.Text))
                {
                    xbCount10 = Convert.ToInt32(txt_xbCount10.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbId1.Text) || CFormat.isNumberic(txt_xbId1.Text))
                {
                    xbId1 = Convert.ToInt32(txt_xbId1.Text);
                    if (xbId1 == 0)
                    {
                        xbId1    = 1;
                        xbCount1 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId2.Text) || CFormat.isNumberic(txt_xbId2.Text))
                {
                    xbId2 = Convert.ToInt32(txt_xbId2.Text);
                    if (xbId2 == 0)
                    {
                        xbId2    = 1;
                        xbCount2 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId3.Text) || CFormat.isNumberic(txt_xbId3.Text))
                {
                    xbId3 = Convert.ToInt32(txt_xbId3.Text);
                    if (xbId3 == 0)
                    {
                        xbId3    = 1;
                        xbCount3 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId4.Text) || CFormat.isNumberic(txt_xbId4.Text))
                {
                    xbId4 = Convert.ToInt32(txt_xbId4.Text);
                    if (xbId4 == 0)
                    {
                        xbId4    = 1;
                        xbCount4 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId5.Text) || CFormat.isNumberic(txt_xbId5.Text))
                {
                    xbId5 = Convert.ToInt32(txt_xbId5.Text);
                    if (xbId5 == 0)
                    {
                        xbId5    = 1;
                        xbCount5 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId6.Text) || CFormat.isNumberic(txt_xbId6.Text))
                {
                    xbId6 = Convert.ToInt32(txt_xbId6.Text);
                    if (xbId6 == 0)
                    {
                        xbId6    = 1;
                        xbCount6 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId7.Text) || CFormat.isNumberic(txt_xbId7.Text))
                {
                    xbId7 = Convert.ToInt32(txt_xbId7.Text);
                    if (xbId7 == 0)
                    {
                        xbId7    = 1;
                        xbCount7 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId8.Text) || CFormat.isNumberic(txt_xbId8.Text))
                {
                    xbId8 = Convert.ToInt32(txt_xbId8.Text);
                    if (xbId8 == 0)
                    {
                        xbId8    = 1;
                        xbCount8 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId9.Text) || CFormat.isNumberic(txt_xbId9.Text))
                {
                    xbId9 = Convert.ToInt32(txt_xbId9.Text);
                    if (xbId9 == 0)
                    {
                        xbId9    = 1;
                        xbCount9 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId10.Text) || CFormat.isNumberic(txt_xbId10.Text))
                {
                    xbId10 = Convert.ToInt32(txt_xbId10.Text);
                    if (xbId10 == 0)
                    {
                        xbId10    = 1;
                        xbCount10 = 0;
                    }
                }
                string msg = "\n"
                             + "账户:" + txt_xbAccount.Text + "\n"
                             + "角色:" + txt_xbName.Text + "\n"
                             + "代币:" + txt_dbSend.Text + "\n";
                if (txt_xbId1.Text != "" && xbCount1 != 0)
                {
                    msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                }
                if (txt_xbId2.Text != "" && xbCount2 != 0)
                {
                    msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                }
                if (txt_xbId3.Text != "" && xbCount3 != 0)
                {
                    msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                }
                if (txt_xbId4.Text != "" && xbCount4 != 0)
                {
                    msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                }
                if (txt_xbId5.Text != "" && xbCount5 != 0)
                {
                    msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                }
                if (txt_xbId6.Text != "" && xbCount6 != 0)
                {
                    msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                }
                if (txt_xbId7.Text != "" && xbCount7 != 0)
                {
                    msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                }
                if (txt_xbId8.Text != "" && xbCount8 != 0)
                {
                    msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                }
                if (txt_xbId9.Text != "" && xbCount9 != 0)
                {
                    msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                }
                if (txt_xbId10.Text != "" && xbCount10 != 0)
                {
                    msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                }

                msg += "\n确认信息无误?";
                DialogResult dr = MessageBox.Show(msg, "对话框标题", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (dr != DialogResult.OK)
                {
                    return;
                }

                //确保有效
                if ((txt_xbId1.Text == "" || xbCount1 == 0) && (txt_xbId2.Text == "" || xbCount2 == 0) &&
                    (txt_xbId3.Text == "" || xbCount3 == 0) && (txt_xbId4.Text == "" || xbCount4 == 0) &&
                    (txt_xbId5.Text == "" || xbCount5 == 0))
                {
                }
                else
                {
                    string cmd = "INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                                 + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                                 + "values ('" + txt_xbAccount.Text + "',0,CONVERT(varchar(100), GETDATE(), 21),getdate(),getdate(),0,0,0,"
                                 + xbId1 + "," + xbCount1 + "," + xbId2 + "," + xbCount2 + "," + xbId3 + "," + xbCount3 + "," + xbId4 + "," + xbCount4 + "," + xbId5 + "," + xbCount5 + ")";
                    string ret = CSGHelper.SqlCommand(cmd);
                    if (ret == "success")
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId1.Text + "\t" + txt_xbName1.Text + "\t" + txt_xbCount1.Text + "\t"
                                              + txt_xbId2.Text + "\t" + txt_xbName2.Text + "\t" + txt_xbCount2.Text + "\t"
                                              + txt_xbId4.Text + "\t" + txt_xbName3.Text + "\t" + txt_xbCount3.Text + "\t"
                                              + txt_xbId5.Text + "\t" + txt_xbName4.Text + "\t" + txt_xbCount4.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName5.Text + "\t" + txt_xbCount5.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId1.Text);
                        lvi.SubItems.Add(txt_xbName1.Text);
                        lvi.SubItems.Add(txt_xbCount1.Text);
                        lvi.SubItems.Add(txt_xbId2.Text);
                        lvi.SubItems.Add(txt_xbName2.Text);
                        lvi.SubItems.Add(txt_xbCount2.Text);
                        lvi.SubItems.Add(txt_xbId3.Text);
                        lvi.SubItems.Add(txt_xbName3.Text);
                        lvi.SubItems.Add(txt_xbCount3.Text);
                        lvi.SubItems.Add(txt_xbId4.Text);
                        lvi.SubItems.Add(txt_xbName4.Text);
                        lvi.SubItems.Add(txt_xbCount4.Text);
                        lvi.SubItems.Add(txt_xbId5.Text);
                        lvi.SubItems.Add(txt_xbName5.Text);
                        lvi.SubItems.Add(txt_xbCount5.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId1.Text != "" && xbCount1 != 0)
                        {
                            msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                        }
                        if (txt_xbId2.Text != "" && xbCount2 != 0)
                        {
                            msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                        }
                        if (txt_xbId3.Text != "" && xbCount3 != 0)
                        {
                            msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                        }
                        if (txt_xbId4.Text != "" && xbCount4 != 0)
                        {
                            msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                        }
                        if (txt_xbId5.Text != "" && xbCount5 != 0)
                        {
                            msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }

                Thread.Sleep(200);
                if ((txt_xbId6.Text == "" || xbCount6 == 0) && (txt_xbId7.Text == "" || xbCount7 == 0) &&
                    (txt_xbId8.Text == "" || xbCount8 == 0) && (txt_xbId9.Text == "" || xbCount9 == 0) &&
                    (txt_xbId10.Text == "" || xbCount10 == 0))
                {
                }
                else
                {
                    string cmd = "INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                                 + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                                 + "values ('" + txt_xbAccount.Text + "',0,CONVERT(varchar(100), GETDATE(), 21),getdate(),getdate(),0,0,0,"
                                 + xbId6 + "," + xbCount6 + "," + xbId7 + "," + xbCount7 + "," + xbId8 + "," + xbCount8 + "," + xbId9 + "," + xbCount9 + "," + xbId10 + "," + xbCount10 + ")";
                    string ret = CSGHelper.SqlCommand(cmd);
                    if (ret == "success")
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName6.Text + "\t" + txt_xbCount6.Text + "\t"
                                              + txt_xbId7.Text + "\t" + txt_xbName7.Text + "\t" + txt_xbCount7.Text + "\t"
                                              + txt_xbId8.Text + "\t" + txt_xbName8.Text + "\t" + txt_xbCount8.Text + "\t"
                                              + txt_xbId9.Text + "\t" + txt_xbName9.Text + "\t" + txt_xbCount9.Text + "\t"
                                              + txt_xbId10.Text + "\t" + txt_xbName10.Text + "\t" + txt_xbCount10.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId6.Text);
                        lvi.SubItems.Add(txt_xbName6.Text);
                        lvi.SubItems.Add(txt_xbCount6.Text);
                        lvi.SubItems.Add(txt_xbId7.Text);
                        lvi.SubItems.Add(txt_xbName7.Text);
                        lvi.SubItems.Add(txt_xbCount7.Text);
                        lvi.SubItems.Add(txt_xbId8.Text);
                        lvi.SubItems.Add(txt_xbName8.Text);
                        lvi.SubItems.Add(txt_xbCount8.Text);
                        lvi.SubItems.Add(txt_xbId9.Text);
                        lvi.SubItems.Add(txt_xbName9.Text);
                        lvi.SubItems.Add(txt_xbCount9.Text);
                        lvi.SubItems.Add(txt_xbId10.Text);
                        lvi.SubItems.Add(txt_xbName10.Text);
                        lvi.SubItems.Add(txt_xbCount10.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId6.Text != "" && xbCount6 != 0)
                        {
                            msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                        }
                        if (txt_xbId7.Text != "" && xbCount7 != 0)
                        {
                            msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                        }
                        if (txt_xbId8.Text != "" && xbCount8 != 0)
                        {
                            msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                        }
                        if (txt_xbId9.Text != "" && xbCount9 != 0)
                        {
                            msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                        }
                        if (txt_xbId10.Text != "" && xbCount10 != 0)
                        {
                            msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }
                Thread.Sleep(200);
                //代币
                if (!string.IsNullOrEmpty(txt_dbSend.Text) && CFormat.isNumberic(txt_dbSend.Text))
                {
                    int dbCount = Convert.ToInt32(txt_dbSend.Text);
                    if (dbCount > 0)
                    {
                        //虚宝增加
                        string cmd = "DECLARE @account varchar(21) \n"
                                     + "DECLARE @point int \n"
                                     + "DECLARE @old_point int \n"
                                     + "DECLARE @new_point int \n"
                                     + "set @account = '" + txt_xbAccount.Text + "' \n"
                                     + "set @point = " + dbCount + " \n"
                                     + "Select @old_point=point from dbo.game_acc where account = @account \n"
                                     + "SET @new_point = @point + @old_point \n"
                                     + "Update dbo.game_acc set point = @new_point where account = @account";
                        string ret = CSGHelper.SqlCommand(cmd);
                        if (ret == "success")
                        {
                            txt_dbCurr.Text = "" + CSGHelper.SelectAcountPoint(txt_xbAccount.Text);
                        }
                        else
                        {
                            MessageBox.Show("发送代币失败,代币:" + dbCount);
                        }
                    }
                }

                if (cbx_xbconf.Text == "新人起步")
                {
                    m_SGExHandle.SendWorldWords("新人玩家 " + txt_xbName.Text + " 的新手起步已经发放,请到大鸿胪处领取虚宝,欢迎加入大家庭,祝游戏愉快。");
                }
            }
            else
            {
                MessageBox.Show("请核对发放帐号!");
            }
        }