Esempio n. 1
0
        private string GetBcp_CTLNM(string strType, string sTable)
        {
            StringBuilder strNM = new StringBuilder();

            try
            {
                //根据钩选的大区和采集对象表名,生成bcp/ctl文件名字
                for (int i = 0; i < this.dgArea.Rows.Count; i++)
                {
                    if (Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "1" || Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "True")
                    {
                        if (strNM.ToString() != string.Empty)
                        {
                            strNM.Append(",");
                        }
                        strNM.Append(this.dgArea.Rows[i].Cells[2].Value + sTable + "." + strType);
                    }
                }
                return(strNM.ToString());
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetBcp_Name->" + ex.Message);
                return(string.Empty);
            }
        }
Esempio n. 2
0
        private int GetGameid(string strName)
        {
            int iId = 0;

            try
            {
                if (this.dsGame != null && this.dsGame.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < this.dsGame.Tables[0].Rows.Count; i++)
                    {
                        if (this.dsGame.Tables[0].Rows[i].ItemArray[1].ToString() == strName)
                        {
                            iId = Convert.ToInt32(this.dsGame.Tables[0].Rows[i].ItemArray[0]);
                            break;
                        }
                    }
                }
                return(iId);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetGameid->" + ex.Message);
                return(0);
            }
        }
Esempio n. 3
0
        private string GetAreaID()
        {
            StringBuilder strid = new StringBuilder();

            try
            {
                //根据钩选的大区和采集对象表名,生成bcp文件名字
                for (int i = 0; i < this.dgArea.Rows.Count; i++)
                {
                    if (Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "1" || Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "True")
                    {
                        if (strid.ToString() != string.Empty)
                        {
                            strid.Append(",");
                        }
                        strid.Append(this.dgArea.Rows[i].Cells[1].Value);
                    }
                }
                return(strid.ToString());
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetAreaID->" + ex.Message);
                return(string.Empty);
            }
        }
Esempio n. 4
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("是否要删除?", "", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                if (this.dataGV.SelectedRows.Count > 0)
                {
                    if (this.DelCollectJob(this.dataGV.SelectedRows[0].Cells[0].Value.ToString()) == true)
                    {
                        MessageBox.Show("删除成功");
                        this.GetData();
                    }
                }
                else
                {
                    MessageBox.Show("请选择要删除的行");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("btnDel_Click->" + ex.ToString());
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 取得游戏列表
        /// </summary>
        private void GetData()
        {
            try
            {
                //string strSQL = "SELECT distinct Ta.game_id as 游戏ID,Ta.game_name as 游戏名, decode(Ta.flag,1,'采集','停止采集')as 状态 From Game_Info Ta order by Ta.game_id";
                //dsGameAll = CommonCLS.RunOracle(strSQL);

                OracleParameter[] parameters =
                {
                    new OracleParameter("cur_Result", OracleDbType.RefCursor)
                };
                parameters[0].Direction = ParameterDirection.Output;
                dsGameAll = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_GameInfo_QueryALL", parameters);

                if (this.dsGameAll.Tables[0].Rows.Count > 0)
                {
                    this.dataGV.DataSource = dsGameAll.Tables[0];
                }
                else
                {
                    MessageBox.Show("暂无数据");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetData->" + ex.ToString());
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 添加新游戏采集任务按下

        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                //Betweenness sysRv = new Betweenness();
                //frmGameEdit frmEdit = new frmGameEdit(0, "", "");
                //frmEdit.CreateModule(null, null, null);
                //if (sysRv.RESULT == BetweennessValue.SUCESS)
                //{
                //}

                if (this.dataGV.SelectedRows.Count > 0)
                {
                    this.SetStatus(this.dataGV.SelectedRows[0].Cells[2].Value.ToString(), this.dataGV.SelectedRows[0].Cells[0].Value.ToString());
                    this.GetData();
                }
                else
                {
                    MessageBox.Show("请选择要操作的行");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("btnNew_Click->" + ex.ToString());
            }
        }
Esempio n. 7
0
        public static void WriteOperatelog(string strLogResult)
        {
            string strsql = string.Empty;

            try
            {
                //插入操作记录
                strsql = @"INSERT INTO Operate_Log VALUES(OPERATELOG_ID_SEQ.NEXTVAL,"; //ID
                strsql = strsql + "sysdate, ";                                         //操作时间
                strsql = strsql + "'" + strLogResult + "',";                           //操作内容
                strsql = strsql + "'" + CommonCLS.LoginUser + "')";                    //操作者

                CommonCLS.RunOracleNonQuery(strsql);

                OracleParameter[] parameters =
                {
                    new OracleParameter("v_LogResult", OracleDbType.Varchar2),
                    new OracleParameter("v_LoginUser", OracleDbType.Varchar2),
                    new OracleParameter("v_result",    OracleDbType.Decimal)
                };
                parameters[0].Direction = ParameterDirection.Input;
                parameters[1].Direction = ParameterDirection.Input;
                parameters[2].Direction = ParameterDirection.Output;

                parameters[0].Value = strLogResult;
                parameters[1].Value = CommonCLS.LoginUser;
                CommonCLS.RunOracleNonQuerySp("PD_Game_Admin.PD_OperateLog_Insert", parameters);
            }
            catch (System.Exception ex)
            {
            }
        }
Esempio n. 8
0
        public static int GetGameDBID(string sIP, string sServerNM, string sServerDB, string sSrcTbl, string sDesTbl, string sUser, string sPwd, int iGameID)
        {
            string strSQL;

            try
            {
                strSQL = "SELECT id From gamedb_info WHERE server_ip  ='" + sIP + "'";
                strSQL = strSQL + " AND server_name='" + sServerNM + "'";
                strSQL = strSQL + " AND server_db='" + sServerDB + "'";
                strSQL = strSQL + " AND srctable='" + sSrcTbl + "'";
                strSQL = strSQL + " AND destable='" + sDesTbl + "'";
                strSQL = strSQL + " AND user_id='" + sUser + "'";
                strSQL = strSQL + " AND user_pwd='" + sPwd + "'";
                strSQL = strSQL + " AND game_id=" + iGameID + "";
                DataSet dGameNm = CommonCLS.RunOracle(strSQL);
                if (dGameNm != null && dGameNm.Tables[0].Rows.Count > 0)
                {
                    return(Convert.ToInt32(dGameNm.Tables[0].Rows[0].ItemArray[0]));
                }
                else
                {
                    return(0);
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("SaveData->" + ex.Message);
                return(0);
            }
        }
Esempio n. 9
0
        private DataTable GetCheckedIpLst()
        {
            DataTable dtIP = new DataTable();

            dtIP.Columns.Add("AreaNm");
            dtIP.Columns.Add("AreaIP");
            try
            {
                for (int i = 0; i < this.dgArea.Rows.Count; i++)
                {
                    if (Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "1" || Convert.ToString(this.dgArea.Rows[i].Cells[0].Value) == "True")
                    {
                        DataRow dtRow = dtIP.NewRow();
                        dtRow[0] = dgArea.Rows[i].Cells[2].Value.ToString();
                        dtRow[1] = dgArea.Rows[i].Cells[3].Value.ToString();
                        dtIP.Rows.Add(dtRow);
                    }
                }
                return(dtIP);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetCheckedIpLst->" + ex.Message);
                return(null);
            }
        }
Esempio n. 10
0
        /// <summary>
        ///  建立菜单
        /// </summary>
        /// <returns></returns>
        private void BuildMenu()
        {
            try
            {
                //建立监控惨淡
                TrvMenu.Nodes.Add("游戏数据采集监控");
                DataSet dsGName = this.LoadGameMenu();
                if (dsGName != null)
                {
                    for (int i = 0; i < dsGName.Tables[0].Rows.Count; i++)
                    {
                        TrvMenu.Nodes[0].Nodes.Add(dsGName.Tables[0].Rows[i].ItemArray[1].ToString());
                    }
                }

                //系统设置菜单
                TrvMenu.Nodes.Add("系统设置");
                TrvMenu.Nodes[1].Nodes.Add("游戏浏览");
                TrvMenu.Nodes[1].Nodes.Add("采集任务浏览");
                if (CommonCLS.LoginUser.ToUpper().Trim() == "ADMIN")
                {
                    TrvMenu.Nodes[1].Nodes.Add("用户浏览");
                }
                else
                {
                    TrvMenu.Nodes[1].Nodes.Add("密码修改");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog(ex.ToString());
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 画面LOAD
        /// </summary>
        /// <returns></returns>
        private void frmLogin_Load(object sender, EventArgs e)
        {
            //画面初始化

            this.txtUser.Text = string.Empty;
            this.txtPwd.Text  = string.Empty;
            this.txtUser.Focus();
            CommonCLS.BcpPath = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "PATH", "BcpPath");
            CommonCLS.CtlPath = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "PATH", "CtlPath");

            CommonCLS.TNS      = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "SERVER", "TNS");
            CommonCLS.UserName = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "SERVER", "DBUser");
            CommonCLS.PASSWORD = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "SERVER", "DBPwd");

            CommonCLS.MangerUserName = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "SERVER", "DBMangerUser");
            CommonCLS.MangerPASSWORD = CommonCLS.ReadINIValue(Application.StartupPath + "\\ini\\Conf.INI", "SERVER", "DBMangerPwd");

            //string strsql;
            //strsql = " select 'ip' as txtip,  Server_IP from gamedb_info where Game_id=1 ";
            //DataSet dste = CommonCLS.RunOracle(strsql);
            //CommonCLS.CreateTBL("ServerIP 50 1,ServerDB 50 0,famid 20 0,fampoint 20 0,mastersn 20 0,masternick 20 0,houseid 20 0,shortintro 100 0,longintro 200 0,secret 10 0,rank 20 0,membercount 10 0,createdate DATE 1,wincount 10 0,losecount 10 0",
            //                    "faminfo",
            //                    1,
            //                    dste.Tables[0], "COLLECTDATA");
        }
Esempio n. 12
0
        /// <summary>
        /// 检查画面输入内容

        /// </summary>
        private bool ChkInput()
        {
            try
            {
                if (this.txtUserNM.Text == string.Empty)
                {
                    MessageBox.Show("请输入用户名");
                    this.txtUserNM.Focus();
                    return(false);
                }

                if (this.txtPwd.Text == string.Empty)
                {
                    MessageBox.Show("请输入用户密码");
                    this.txtPwd.Focus();
                    return(false);
                }

                if (this.txtPwd.Text != this.txtConfirmPwd.Text)
                {
                    MessageBox.Show("两次输入的密码不一致,请重新输入");
                    this.txtPwd.Focus();
                    return(false);
                }
                return(true);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("ChkInput->" + ex.ToString());
                return(false);
            }
        }
Esempio n. 13
0
 /// <summary>
 /// 确认按钮按下
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOk_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.ChkInput() == false)
         {
             return;
         }
         else
         {
             if (this.SaveData() == true)
             {
                 MessageBox.Show("操作成功");
                 this.DialogResult = DialogResult.OK;
                 this.Close();
             }
             else
             {
                 MessageBox.Show("操作失败");
                 this.DialogResult = DialogResult.Cancel;
             }
         }
     }
     catch (System.Exception ex)
     {
         CommonCLS.SaveLog("GetData->" + ex.ToString());
     }
 }
Esempio n. 14
0
        private void GetGameLIST()
        {
            try
            {
                //string strsql = " SELECT * FROM Game_Info ";
                //DataSet  dsGame = CommonCLS.RunOracle(strsql);
                OracleParameter[] parameters =
                {
                    new OracleParameter("cur_Result", OracleDbType.RefCursor, ParameterDirection.Output)
                };
                dsGame = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_GameList_Query", parameters);

                if (dsGame != null && dsGame.Tables[0].Rows.Count > 0)
                {
                    this.cbxGameName.Items.Clear();
                    for (int i = 0; i < dsGame.Tables[0].Rows.Count; i++)
                    {
                        //添加到COMBOX
                        cbxGameName.Items.Add(dsGame.Tables[0].Rows[i].ItemArray[1].ToString());
                    }
                    cbxGameName.SelectedIndex = 0;
                    cbxGameName.DropDownStyle = ComboBoxStyle.DropDownList;
                }
                else
                {
                    MessageBox.Show("暂无游戏");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("frmGameEdit_Load->" + ex.Message);
            }
        }
Esempio n. 15
0
 private void chkAll_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         int iValue = 0;
         if (this.chkAll.Checked == true)
         {
             iValue = 1;
         }
         else
         {
             iValue = 0;
         }
         if (this.dgArea.Rows.Count > 0)
         {
             for (int i = 0; i < this.dgArea.Rows.Count; i++)
             {
                 this.dgArea.Rows[i].Cells[0].Value = iValue;
             }
         }
     }
     catch (System.Exception ex)
     {
         CommonCLS.SaveLog("chkAll_CheckedChanged->" + ex.Message);
     }
 }
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定删除?", "", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            if (this.dataGV.SelectedRows.Count >= 0)
            {
                Betweenness sysRv   = new Betweenness();
                frmGameEdit frmEdit = new frmGameEdit(1, this.dataGV.SelectedRows[0].Cells[1].Value.ToString(), this.dataGV.SelectedRows[0].Cells[0].Value.ToString());

                if (CommonCLS.DelData(this.dataGV.SelectedRows[0].Cells[0].Value.ToString()) > 0)
                {
                    MessageBox.Show("删除成功");
                    this.GetData();
                }
                else
                {
                    MessageBox.Show("删除失败");
                }
            }
            else
            {
                MessageBox.Show("请选择要操作的数据行");
            }
        }
Esempio n. 17
0
        /// <summary>
        /// 取得用户列表
        /// </summary>
        private void GetData()
        {
            try
            {
                //string strSQL = "SELECT id,userid,decode(status,1,'使用','未使用') as status From user_info order by id";
                //dsUserAll = CommonCLS.RunOracle(strSQL);

                OracleParameter[] parameters =
                {
                    new OracleParameter("cur_Result", OracleDbType.RefCursor)
                };
                parameters[0].Direction = ParameterDirection.Output;
                dsUserAll = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_UserList_QueryAll", parameters);

                if (this.dsUserAll.Tables[0].Rows.Count > 0)
                {
                    this.dataGV.DataSource = dsUserAll.Tables[0];
                }
                else
                {
                    MessageBox.Show("暂无数据");
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetData->" + ex.ToString());
            }
        }
Esempio n. 18
0
 private void GetAreaList(int iGameID)
 {
     try
     {
         OracleParameter[] parameters =
         {
             new OracleParameter("v_GameID", OracleDbType.Int32,     ParameterDirection.Input),
             new OracleParameter("v_result", OracleDbType.RefCursor, ParameterDirection.Output)
         };
         parameters[0].Value = iGameID;
         DataSet dsArea = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_AreaList_Query", parameters);
         this.dtArea.Rows.Clear();
         if (dsArea != null && dsArea.Tables[0].Rows.Count > 0)
         {
             for (int j = 0; j < dsArea.Tables[0].Rows.Count; j++)
             {
                 DataRow dtRow = dtArea.NewRow();
                 dtRow[0] = false;
                 dtRow[1] = dsArea.Tables[0].Rows[j].ItemArray[0].ToString();
                 dtRow[2] = dsArea.Tables[0].Rows[j].ItemArray[2].ToString();
                 dtRow[3] = dsArea.Tables[0].Rows[j].ItemArray[1].ToString();
                 dtArea.Rows.Add(dtRow);
             }
         }
         this.dgArea.DataSource = this.dtArea;
     }
     catch (System.Exception ex)
     {
         CommonCLS.SaveLog("GetAreaList->" + ex.Message);
     }
 }
        /// <summary>
        ///取得任务列表
        /// </summary>
        private void GetData()
        {
            try
            {
                //string strSQL = "select ta.id, tb.game_name as 游戏 ,ta.server_name as 大区名 ,ta.server_db 数据库名 ,ta.srctable 源数据表名 ,ta.destable 目的数据表名 from gamedb_info ta, game_info tb where ta.game_id=tb.game_id";
                //dsFrm = CommonCLS.RunOracle(strSQL);

                OracleParameter[] parameters =
                {
                    new OracleParameter("cur_Result", OracleDbType.RefCursor)
                };
                parameters[0].Direction = ParameterDirection.Output;

                dsFrm = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_ImportList_QueryAll", parameters);

                if (this.dsFrm.Tables[0].Rows.Count > 0)
                {
                    this.dataGV.DataSource         = dsFrm.Tables[0];
                    this.dataGV.Columns[0].Visible = false;
                }
                else
                {
                    MessageBox.Show("暂无数据");
                    this.dataGV.DataSource = null;
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetData->" + ex.ToString());
            }
        }
Esempio n. 20
0
        /// <summary>
        /// 取得用户数据
        /// </summary>
        private void GetData()
        {
            string strsql = string.Empty;

            try
            {
                //修改模式
                if (this._mode == "1")
                {
                    this.txtUserNM.Enabled = false;
                    if (CommonCLS.LoginUserID != "0")
                    {
                        this.chkStatus.Enabled = false;
                    }
                    //strsql = "SELECT * FROM user_info where id=" + this._iUid;
                    //this._dsUser = CommonCLS.RunOracle(strsql);
                    OracleParameter[] parameters =
                    {
                        new OracleParameter("v_id",       OracleDbType.Int32),
                        new OracleParameter("cur_Result", OracleDbType.RefCursor)
                    };
                    parameters[0].Direction = ParameterDirection.Input;
                    parameters[1].Direction = ParameterDirection.Output;

                    parameters[0].Value = this._iUid;

                    this._dsUser = CommonCLS.RunOracleSP("PD_GameInfo_Pack.PD_UserInfo_QueryAll", parameters);

                    if (_dsUser != null && _dsUser.Tables[0].Rows.Count > 0)
                    {
                        //用户名

                        this.txtUserNM.Text = _dsUser.Tables[0].Rows[0].ItemArray[1].ToString();
                        //密码
                        this.txtPwd.Text        = _dsUser.Tables[0].Rows[0].ItemArray[2].ToString();
                        this.txtConfirmPwd.Text = _dsUser.Tables[0].Rows[0].ItemArray[2].ToString();
                        //状态

                        if (_dsUser.Tables[0].Rows[0].ItemArray[3].ToString() == "0")
                        {
                            this.chkStatus.Checked = false;
                        }
                        else
                        {
                            this.chkStatus.Checked = true;
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("GetData->" + ex.ToString());
            }
        }
Esempio n. 21
0
        private string BuildCTL(string strBcpName, string strMODE, string strDbRow, string strDestable)
        {
            try
            {
                string   strCTL   = string.Empty;
                string   strField = string.Empty;
                string   filelist = null;
                string   rowlist  = null;
                string[] strAll   = strDbRow.Split(',');    //字段结构
                for (int iField = 0; iField < strAll.Length; iField++)
                {
                    string[] strRow = strAll[iField].Split(' ');
                    if (iField == 0)
                    {
                        if (strRow[1] == "DATE")
                        {
                            strField = strField + strRow[0].ToString() + " DATE \"YYYY-MM-DD HH24:MI:SS\"";
                        }
                        else
                        {
                            strField = strField + strRow[0] + " " + strRow[1];
                        }
                    }
                    else
                    {
                        if (strRow[1] == "DATE")
                        {
                            strField = strField + "," + strRow[0] + " DATE \"YYYY-MM-DD HH24:MI:SS\"";
                        }
                        else
                        {
                            strField = strField + "," + strRow[0] + " " + strRow[1];
                        }
                    }
                }

                filelist = "INFILE '" + Application.StartupPath + @"\" + this.Text + @"\" + strBcpName.Replace(",", "'\r\nINFILE '") + "'\r\n";
                //filelist = " Replace_Part ";
                rowlist = strField.Replace(",", ",\r\n");

                strCTL = "Load DATA\r\n";
                strCTL = strCTL + filelist;
                strCTL = strCTL + " INTO TABLE " + strDestable + "\r\n";
                strCTL = strCTL + " APPEND\r\n";
                strCTL = strCTL + "FIELDS TERMINATED by X'09'\r\n TRAILING NULLCOLS \r\n";
                strCTL = strCTL + "(\r\n" + rowlist + "\r\n)";
                return(strCTL);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("BuildCTL->" + ex.Message);
                return(string.Empty);
            }
        }
Esempio n. 22
0
 /// <summary>
 /// 画面读取
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmUserBrowse_Load(object sender, EventArgs e)
 {
     try
     {
         this.GetData();
     }
     catch (System.Exception ex)
     {
         CommonCLS.SaveLog("frmUserBrowse_Load->" + ex.ToString());
     }
 }
Esempio n. 23
0
        public static void DelFailedData(string strDate, string strTblName)
        {
            try
            {
                string strSql = "Delete From " + strTblName + " Where TO_CHAR(SCN_TO_TIMESTAMP(ora_rowscn),'YYYY/MM/DD')='" + strDate + "'";

                CommonCLS.RunOracleNonQuery(strSql);
            }
            catch (System.Exception ex)
            {
            }
        }
Esempio n. 24
0
        private void frmImport_Load(object sender, EventArgs e)
        {
            GetGameLIST();
            dtArea.Columns.Add("chk");
            dtArea.Columns.Add("id");
            dtArea.Columns.Add("ServerNM");
            dtArea.Columns.Add("Server_Ip");
            //取得大区列表
            int igame_id = CommonCLS.GetGameID(this.cbxGameName.Text.Trim());

            GetAreaList(igame_id);
        }
Esempio n. 25
0
        private string BuildCTL(string strBcpName, string strMODE, DataTable dtTable, string strDestable)
        {
            try
            {
                string strCTL   = string.Empty;
                string strField = string.Empty;
                string filelist = null;
                string rowlist  = null;

                for (int iField = 0; iField < dtTable.Rows.Count; iField++)
                {
                    if (iField == 0)
                    {
                        if (dtTable.Rows[iField].ItemArray[1].ToString() == "DATE")
                        {
                            strField = strField + dtTable.Rows[iField].ItemArray[0].ToString() + " DATE \"YYYY-MM-DD HH24:MI:SS\"";
                        }
                        else
                        {
                            strField = strField + dtTable.Rows[iField].ItemArray[0].ToString();
                        }
                    }
                    else
                    {
                        if (dtTable.Rows[iField].ItemArray[1].ToString() == "DATE")
                        {
                            strField = strField + "," + dtTable.Rows[iField].ItemArray[0].ToString() + " DATE \"YYYY-MM-DD HH24:MI:SS\"";
                        }
                        else
                        {
                            strField = strField + "," + dtTable.Rows[iField].ItemArray[0].ToString();
                        }
                    }
                }

                // filelist = "INFILE '" + strBcpName.Replace(",", "'\r\nINFILE '") + "'\r\n";
                filelist = " Replace_Part ";
                rowlist  = strField.Replace(",", ",\r\n");

                strCTL = "Load DATA\r\n";
                strCTL = strCTL + filelist;
                strCTL = strCTL + " INTO TABLE " + strDestable + "\r\n";
                strCTL = strCTL + " APPEND\r\n";
                strCTL = strCTL + "FIELDS TERMINATED by X'09'\r\n TRAILING NULLCOLS \r\n";
                strCTL = strCTL + "(\r\n" + rowlist + "\r\n)";
                return(strCTL);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("BuildCTL->" + ex.Message);
                return(string.Empty);
            }
        }
Esempio n. 26
0
        /// <summary>
        /// 删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDel_Click(object sender, EventArgs e)
        {
            string strsql = string.Empty;

            try
            {
                if (this.dataGV.SelectedRows.Count <= 0)
                {
                    MessageBox.Show("请选择要操作的行");
                    return;
                }

                if (MessageBox.Show("确认删除用户?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    if (this.dataGV.SelectedRows[0].Cells[0].Value.ToString() != "0")
                    {
                        strsql = " DELETE FROM user_info Where id=" + this.dataGV.SelectedRows[0].Cells[0].Value.ToString();

                        //OracleParameter[] parameters =
                        //{
                        //    new OracleParameter("v_id", OracleDbType.Int32),
                        //    new OracleParameter("v_Result", OracleDbType.Decimal)
                        //};
                        //parameters[0].Direction = ParameterDirection.Input;
                        //parameters[1].Direction = ParameterDirection.Output;

                        //parameters[0].Value = this.dataGV.SelectedRows[0].Cells[0].Value.ToString();
                        //int result = CommonCLS.RunOracleNonQuerySp("PD_Game_Admin.PD_UserInfo_Del", parameters);

                        int result = CommonCLS.RunOracleNonQuery(strsql);
                        if (result == 1)
                        {
                            MessageBox.Show("删除成功");
                            this.GetData();
                        }
                        else
                        {
                            MessageBox.Show("删除失败");
                        }
                    }
                    else
                    {
                        MessageBox.Show("admin管理帐号无法删除!");
                    }
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("btnDel_Click->" + ex.ToString());
            }
        }
Esempio n. 27
0
        bool leftOpen             = true; //左边listview是否打开
        #endregion

        #region 方法

        #region 获取游戏菜单
        /// <summary>
        ///  获取游戏菜单
        /// </summary>
        /// <returns></returns>
        private DataSet LoadGameMenu()
        {
            try
            {
                string  strSql = "select t.* from game_info t";
                DataSet dsGame = CommonCLS.RunOracle(strSql);                    //查询数据库

                return(dsGame);
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog(ex.ToString());
                return(null);
            }
        }
Esempio n. 28
0
 /// <summary>
 /// 添加按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         frmUserEdit frmEdit = new frmUserEdit(this.dataGV.SelectedRows[0].Cells[0].Value.ToString(), "0");
         frmEdit.CreateModule(null, null, null);
         if (frmEdit.DialogResult == DialogResult.OK)
         {
             this.GetData();
         }
     }
     catch (System.Exception ex)
     {
         CommonCLS.SaveLog("btnAdd_Click->" + ex.ToString());
     }
 }
Esempio n. 29
0
 /// <summary>
 /// 登录按钮
 /// </summary>
 /// <returns></returns>
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if (blnChkInput() == false)
         {
             return;
         }
         int iLoginResult = this.CheckLogin(this.txtUser.Text, this.txtPwd.Text);
         if (iLoginResult == 0)
         {
             //登录成功,显示数据采集画面
             CommonCLS.LoginUser = this.txtUser.Text.Trim();
             this.DialogResult   = DialogResult.OK;
             this.Close();
             //Main frmMenu = new Main();
             //this.Hide();
             //Thread.Sleep(1000);
             //frmMenu.Show();
         }
         else if (iLoginResult == 1)
         {
             //登录失败
             MessageBox.Show("登录失败,请检查用户名或密码!");
             this.DialogResult = DialogResult.None;
             this.txtPwd.Text  = string.Empty;
             this.txtUser.Focus();
             this.txtUser.SelectAll();
         }
         else if (iLoginResult == 2)
         {
             //登录失败
             MessageBox.Show("该帐号已停止使用!");
             this.DialogResult = DialogResult.None;
             this.txtPwd.Text  = string.Empty;
             this.txtUser.Focus();
             this.txtUser.SelectAll();
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("服务器连接失败!");
         CommonCLS.SaveLog(ex.ToString());
     }
 }
Esempio n. 30
0
        private void cbxGameName_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strsql = string.Empty;

            try
            {
                if (this.cbxGameName.Text.Trim() != string.Empty)
                {
                    //取得大区列表
                    int igame_id = CommonCLS.GetGameID(this.cbxGameName.Text.Trim());
                    GetAreaList(igame_id);
                }
            }
            catch (System.Exception ex)
            {
                CommonCLS.SaveLog("cbxGameName_SelectedIndexChanged->" + ex.Message);
            }
        }