Example #1
0
        public int AddExp(int exp, int sysno)
        {
            int ret = 0;

            using (SQLData data = new SQLData())
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("update USR_Customer set Exp = Exp+(").Append(exp).Append(") where SysNo=").Append(sysno)
                .Append(";select Exp from USR_Customer where SysNo=").Append(sysno)
                .Append(";select * from USR_Grade where SysNo in (select GradeSysNo from USR_Customer where SysNo=").Append(sysno).Append(")");
                try
                {
                    DataSet m_ds = data.CmdtoDataSet(builder.ToString());
                    ret = int.Parse(m_ds.Tables[0].Rows[0]["Exp"].ToString());
                    DataTable m_grade = USR_GradeBll.GetInstance().GetList();
                    for (int i = 0; i < m_grade.Rows.Count; i++)
                    {
                        if (int.Parse(m_grade.Rows[i]["LevelNum"].ToString()) == int.Parse(m_ds.Tables[1].Rows[0]["LevelNum"].ToString()) + 1)
                        {
                            if (ret >= int.Parse(m_grade.Rows[i]["Exp"].ToString()))
                            {
                                data.CmdtoNone("update USR_Customer set GradeSysNo=" + m_grade.Rows[i]["SysNo"].ToString() + " where sysno=" + sysno);
                            }
                        }
                    }
                }
                catch (Exception exception)
                {
                    //throw exception;
                }
            }
            return(ret);
        }
Example #2
0
 public static USR_GradeBll GetInstance()
 {
     if (_instance == null)
     {
         _instance = new USR_GradeBll();
     }
     return _instance;
 }
Example #3
0
 public static USR_GradeBll GetInstance()
 {
     if (_instance == null)
     {
         _instance = new USR_GradeBll();
     }
     return(_instance);
 }