Пример #1
0
 public bool insertAQuiz(Model.QuizForDB quiz)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.QuizInfoIDAL en      = factory.getQuizInstance();
     if (quiz.Quiz_Type.Equals("php"))
     {
         quiz.Quiz_TypeID = 29;
     }
     else if (quiz.Quiz_Type.Equals("cpp"))
     {
         quiz.Quiz_TypeID = 1;
     }
     else if (quiz.Quiz_Type.Equals("python"))
     {
         quiz.Quiz_TypeID = 4;
     }
     else if (quiz.Quiz_Type.Equals("c"))
     {
         quiz.Quiz_TypeID = 34;
     }
     else if (quiz.Quiz_Type.Equals("java"))
     {
         quiz.Quiz_TypeID = 10;
     }
     return(en.insertAQuiz(quiz));
 }
Пример #2
0
        public int DeleteATest(string id)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL dalad = factory.getTestInstance();

            return dalad.DeleteATest(id);
        }
Пример #3
0
        public int UpdateATest(string uid,string id, int order, int time, string result)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL test = factory.getTestInstance();
            OxcoderIDAL.UserIDAL user = factory.getUserInstance();
            string tid = test.GetTestID(id);
            Model.Quiz p1 = searchQuizInfo(id, order);
            if (result.Equals(p1.output) || p1.output == "")
            {
                test.UpdateATest(tid, order, time);
                SqlDataReader rd = user.UserInfo(uid);
                if (rd.Read())
                {
                    int price1 = Convert.ToInt32(rd["User_Level"].ToString());
                    int price = Convert.ToInt32(rd["User_Price"].ToString()) + time / 10;
                    if ((price - 4000) / 1000 > 0)
                        user.UpdateUserLevel((price1 + 1).ToString(), price.ToString(), uid);
                    user.UpdateUserLevel(rd["User_Level"].ToString(), price.ToString(), uid);
                }

            }
            if(order==2)
            {
                DataRow dr = test.GetTestDetail(tid).Tables[0].Rows[0];
                if (dr["Test_Quiz0_State"].ToString().Equals("-1") && dr["Test_Quiz1_State"].ToString().Equals("-1") && dr["Test_Quiz2_State"].ToString().Equals("-1"))
                    test.SetTestState(tid);
            }
            return 1;
        }
Пример #4
0
        public string GetTestID(string id)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL dalad = factory.getTestInstance();

            return dalad.GetTestID(id);
        }
Пример #5
0
 public Enterprice GetEnterpriceID(string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     Enterprice enterprice  = en.GetEnterpriceID(email);
     return enterprice;
 }
Пример #6
0
 public bool insertAQuiz(Model.QuizForDB quiz)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.QuizInfoIDAL en = factory.getQuizInstance();
     if (quiz.Quiz_Type.Equals("php"))
     {
         quiz.Quiz_TypeID = 29;
     }
     else if (quiz.Quiz_Type.Equals("cpp"))
     {
         quiz.Quiz_TypeID = 1;
     }
     else if (quiz.Quiz_Type.Equals("python"))
     {
         quiz.Quiz_TypeID = 4;
     }
     else if (quiz.Quiz_Type.Equals("c"))
     {
         quiz.Quiz_TypeID = 34;
     }
     else if (quiz.Quiz_Type.Equals("java"))
     {
         quiz.Quiz_TypeID = 10;
     }
     return en.insertAQuiz(quiz);
 }
Пример #7
0
        public int UpdateATest(string uid, string id, int order, int time, string result)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL test    = factory.getTestInstance();
            OxcoderIDAL.UserIDAL     user    = factory.getUserInstance();
            string tid = test.GetTestID(id);

            Model.Quiz p1 = searchQuizInfo(id, order);
            if (result.Equals(p1.output) || p1.output == "")
            {
                test.UpdateATest(tid, order, time);
                SqlDataReader rd = user.UserInfo(uid);
                if (rd.Read())
                {
                    int price1 = Convert.ToInt32(rd["User_Level"].ToString());
                    int price  = Convert.ToInt32(rd["User_Price"].ToString()) + time / 10;
                    if ((price - 4000) / 1000 > 0)
                    {
                        user.UpdateUserLevel((price1 + 1).ToString(), price.ToString(), uid);
                    }
                    user.UpdateUserLevel(rd["User_Level"].ToString(), price.ToString(), uid);
                }
            }
            if (order == 2)
            {
                DataRow dr = test.GetTestDetail(tid).Tables[0].Rows[0];
                if (dr["Test_Quiz0_State"].ToString().Equals("-1") && dr["Test_Quiz1_State"].ToString().Equals("-1") && dr["Test_Quiz2_State"].ToString().Equals("-1"))
                {
                    test.SetTestState(tid);
                }
            }
            return(1);
        }
Пример #8
0
 public DataSet Search(int pageindex, int pagesize, String salary = null, string provice = null, int retype = -1, int flag = -1, string searchCondition = null)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad = factory.getSearchInstance();
     DataSet ds = dalad.SearchUseCondition(salary, provice, retype, flag, searchCondition, pageindex, pagesize);
     ds = AddPositionAndQuiz(ds);
     return ds;
 }
Пример #9
0
 public DataSet SearchByChallengeID(string id)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad = factory.getSearchInstance();
     DataSet ds = dalad.SearchByChallengeID(id);
     ds = AddPositionAndQuiz(ds);
     return ds;
 }
Пример #10
0
 public DataSet SearchByOwner(string id, int pageindex, int pagesize)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad = factory.getSearchInstance();
     DataSet ds = dalad.SearchByOwner(id, pageindex, pagesize);
     ds = AddPositionAndQuiz(ds);
     return ds;
 }
Пример #11
0
        public Enterprice GetEnterpriceID(string email)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
            Enterprice enterprice = en.GetEnterpriceID(email);

            return(enterprice);
        }
Пример #12
0
        public int SendResetEmail(string email)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL           dalad   = factory.getUserInstance();
            OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
            // dalad.SendEmail(id, md5);
            //TODO:发邮件
            MailMessage mailMsg = new MailMessage();

            mailMsg.From = new MailAddress("*****@*****.**");
            mailMsg.To.Add(email);
            mailMsg.Subject = "请重置密码";
            string        activeCode     = Guid.NewGuid().ToString().Substring(0, 8);
            StringBuilder contentBuilder = new StringBuilder();

            contentBuilder.Append("请点击下面的链接完成密码重置");
            contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
            int state = 0;

            //判断用户类型
            if (dalad.CheckUserEmail(email) == 1)
            {
                if (dalad.SendUserEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;
                }
            }
            else if (en.CheckEnterpriceEmail(email) == 1)
            {
                if (en.SendEnterpriceEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;
                }
            }
            return(state);
        }
Пример #13
0
        public DataSet SearchByChallengeID(string id)
        {
            OxcoderIFactory.IFactory        factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.SearchChallengeIDAL dalad   = factory.getSearchInstance();
            DataSet ds = dalad.SearchByChallengeID(id);

            ds = AddPositionAndQuiz(ds);
            return(ds);
        }
Пример #14
0
        public DataSet Search(int pageindex, int pagesize, String salary = null, string provice = null, int retype = -1, int flag = -1, string searchCondition = null)
        {
            OxcoderIFactory.IFactory        factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.SearchChallengeIDAL dalad   = factory.getSearchInstance();
            DataSet ds = dalad.SearchUseCondition(salary, provice, retype, flag, searchCondition, pageindex, pagesize);

            ds = AddPositionAndQuiz(ds);
            return(ds);
        }
Пример #15
0
        public DataSet SearchByOwner(string id, int pageindex, int pagesize)
        {
            OxcoderIFactory.IFactory        factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.SearchChallengeIDAL dalad   = factory.getSearchInstance();
            DataSet ds = dalad.SearchByOwner(id, pageindex, pagesize);

            ds = AddPositionAndQuiz(ds);
            return(ds);
        }
Пример #16
0
        public DataSet GetTestDetail(string id)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL dalad = factory.getTestInstance();

            DataSet ds = dalad.GetTestDetail(id);
            string cid = ds.Tables[0].Rows[0]["Test_ChallengeID"].ToString();
            OxcoderIDAL.SearchChallengeIDAL scidal = factory.getSearchInstance();
            DataSet ds2 = scidal.SearchByChallengeID(cid);

            return AddOtherInfo(ds,ds2);
        }
Пример #17
0
        public int InsertATest(string challengeid, string userid)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL dalad = factory.getTestInstance();
            Model.Test test = new Model.Test();
            test.Test_ID = Guid.NewGuid().ToString();
            test.Test_ChallengeID = challengeid;
            test.Test_UserID = userid;

            OxcoderIDAL.ChallengeInfoIDAL ci = factory.getChallengeInstance();
            ci.UpdateNum(challengeid,1);
            return dalad.InsertATest(test);
        }
Пример #18
0
        public User GetUserID(string email)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL dalad = factory.getUserInstance();
            SqlDataReader dr = dalad.GetUserID(email);
            Model.User user = new Model.User();
            if (dr.Read()) {
            user.User_ID = dr["User_ID"].ToString();
            user.User_Name = dr["User_Name"].ToString();

            }
            return user;
        }
Пример #19
0
        public User GetUserID(string email)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
            SqlDataReader            dr      = dalad.GetUserID(email);

            Model.User user = new Model.User();
            if (dr.Read())
            {
                user.User_ID   = dr["User_ID"].ToString();
                user.User_Name = dr["User_Name"].ToString();
            }
            return(user);
        }
Пример #20
0
 public Boolean ActiveUserAccount(string email, string activeCode)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL dalad = factory.getUserInstance();
     string activeCode2 = dalad.ActiveUserAccount(email);
     if (activeCode.Equals(activeCode2) && dalad.ChangeUserState(email) == 1)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #21
0
        public Boolean ActiveUserAccount(string email, string activeCode)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
            string activeCode2 = dalad.ActiveUserAccount(email);

            if (activeCode.Equals(activeCode2) && dalad.ChangeUserState(email) == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #22
0
 public Boolean EnterpriceLogin(String email, String password)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     Model.Enterprice enterprice = new Model.Enterprice();
     enterprice = dalad.EnterpriceLogin(email);
     if (enterprice.Enterprice_Password.Equals(password)&&enterprice.Enterprice_State.Equals("1"))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #23
0
 public Boolean EnterpriceLogin(String email, String password)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     Model.Enterprice enterprice            = new Model.Enterprice();
     enterprice = dalad.EnterpriceLogin(email);
     if (enterprice.Enterprice_Password.Equals(password) && enterprice.Enterprice_State.Equals("1"))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #24
0
 public DataSet SearchByUser(string userid, int state, int flag, int pageindex, int pagesize)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad = factory.getSearchInstance();
     DataSet ds = null;
     if (flag == 1 )
     {
         ds = dalad.SearchByUser(userid,state,pageindex, pagesize);
         ds = AddPositionAndQuiz(ds);
     }
     else if (flag == 0)
     {
         ds = dalad.SearchByUserHistory(userid, state, pageindex, pagesize);
         ds = AddPositionAndQuiz(ds);
     }
     return ds;
 }
Пример #25
0
 public int RegisterUser(string email, string password)
 {
     OxcoderIFactory.IFactory       factory    = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL           dalad      = factory.getUserInstance();
     OxcoderIDAL.EnterpriseInfoIDAL enterprice = factory.getEnterpriseInstance();
     Model.User user = new Model.User();
     user.User_ID       = Guid.NewGuid().ToString();
     user.User_Email    = email;
     user.User_Password = password;
     if (dalad.CheckUserEmail(email) == 0 && enterprice.CheckEnterpriceEmail(email) == 0)
     {
         return(dalad.RegisterUser(user));
     }
     else
     {
         return(0);
     }
 }
Пример #26
0
        public DataSet SearchByUser(string userid, int state, int flag, int pageindex, int pagesize)
        {
            OxcoderIFactory.IFactory        factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.SearchChallengeIDAL dalad   = factory.getSearchInstance();
            DataSet ds = null;

            if (flag == 1)
            {
                ds = dalad.SearchByUser(userid, state, pageindex, pagesize);
                ds = AddPositionAndQuiz(ds);
            }
            else if (flag == 0)
            {
                ds = dalad.SearchByUserHistory(userid, state, pageindex, pagesize);
                ds = AddPositionAndQuiz(ds);
            }
            return(ds);
        }
Пример #27
0
        public Boolean ActiveEnterpriceAccount(string email, string activeCode)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
            SqlDataReader rd = dalad.ActiveEnterpriceAccount(email);
              string activeCode2=null;
            if (rd.Read()) {
             activeCode2 = rd["Enterprice_Md5"].ToString();
            }

            if (activeCode.Equals(activeCode2) && dalad.ChangeEnterpriceState(email) == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Пример #28
0
        public Boolean ActiveEnterpriceAccount(string email, string activeCode)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
            SqlDataReader rd          = dalad.ActiveEnterpriceAccount(email);
            string        activeCode2 = null;

            if (rd.Read())
            {
                activeCode2 = rd["Enterprice_Md5"].ToString();
            }

            if (activeCode.Equals(activeCode2) && dalad.ChangeEnterpriceState(email) == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #29
0
 public double[] GetUserAbility(string userID)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.TestInfoIDAL dalTest = factory.getTestInstance();
     string[] abilityTemp = dalTest.GetUserAbility(userID);
     double AvaTime = 500.00;
     double AvaTime1 = 100.00;
     double AvaTime2 = 100.00;
     double AvaTime3 = 100.00;
     double avarage = 5.00;
     double home = 5.00;
     double[] ability = new double[8];
     //专注度
     ability[0] = Convert.ToDouble(abilityTemp[0]) / AvaTime1 + Convert.ToDouble(abilityTemp[1]) / AvaTime2 + Convert.ToDouble(abilityTemp[1]) / AvaTime3;
     //熟练度
     ability[1] = (Convert.ToDouble(abilityTemp[0]) + Convert.ToDouble(abilityTemp[1]) + Convert.ToDouble(abilityTemp[2])) / AvaTime;
     //偏差值
     ability[2] = ability[1] - avarage;
     ability[3] = home;
     return ability;
 }
Пример #30
0
        public User UserInfo(string userID)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
            User          userInfo           = new User();
            SqlDataReader rd = dalad.UserInfo(userID);

            if (rd.Read())
            {
                userInfo.User_ID       = rd["User_ID"].ToString();
                userInfo.User_Email    = rd["User_Email"].ToString();
                userInfo.User_Name     = rd["User_Name"].ToString();
                userInfo.User_Password = rd["User_Password"].ToString();
                userInfo.User_Age      = rd["User_Age"].ToString();
                userInfo.User_Level    = rd["User_Level"].ToString();
                userInfo.User_Price    = rd["User_Price"].ToString();
                userInfo.User_Phone    = rd["User_Phone"].ToString();
                userInfo.User_Sex      = rd["User_Sex"].ToString();
            }
            return(userInfo);
        }
Пример #31
0
        public int SendUserEmail(string emailTo)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
            // dalad.SendEmail(id, md5);
            //TODO:发邮件
            MailMessage mailMsg = new MailMessage();

            mailMsg.From = new MailAddress("*****@*****.**");
            mailMsg.To.Add(emailTo);
            mailMsg.Subject = "请激活注册账号";
            string        activeCode     = Guid.NewGuid().ToString().Substring(0, 8);
            StringBuilder contentBuilder = new StringBuilder();

            contentBuilder.Append("请点击下面的链接完成激活注册");
            string type = "User";

            contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
            if (dalad.SendUserEmail(emailTo, activeCode) != 0)
            {
                client.Send(mailMsg);
                return(1);
            }
            else
            {
                return(0);
            }
        }
Пример #32
0
 public Boolean UserLogin(String email, String password)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     Model.User user = new Model.User();
     user = dalad.UserLogin(email);
     if (user.User_Password != null)
     {
         if (user.User_Password.Equals(password) && user.User_State.Equals("1"))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Пример #33
0
        public double[] GetUserAbility(string userID)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.TestInfoIDAL dalTest = factory.getTestInstance();
            string[] abilityTemp             = dalTest.GetUserAbility(userID);
            double   AvaTime  = 500.00;
            double   AvaTime1 = 100.00;
            double   AvaTime2 = 100.00;
            double   AvaTime3 = 100.00;
            double   avarage  = 5.00;
            double   home     = 5.00;

            double[] ability = new double[8];
            //专注度
            ability[0] = Convert.ToDouble(abilityTemp[0]) / AvaTime1 + Convert.ToDouble(abilityTemp[1]) / AvaTime2 + Convert.ToDouble(abilityTemp[1]) / AvaTime3;
            //熟练度
            ability[1] = (Convert.ToDouble(abilityTemp[0]) + Convert.ToDouble(abilityTemp[1]) + Convert.ToDouble(abilityTemp[2])) / AvaTime;
            //偏差值
            ability[2] = ability[1] - avarage;
            ability[3] = home;
            return(ability);
        }
Пример #34
0
 public DataSet AllUserInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     return(dalad.AllUserInfo());
 }
Пример #35
0
 public int UpdateEnterpriceInfo(string fullName, string enterpricePhone, string email)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo(fullName, enterpricePhone, email));
 }
Пример #36
0
 public int SetPassword(string email, string newPwd)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.SetPassword(email, newPwd);
 }
Пример #37
0
 public int Count()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL dalad = factory.getUserInstance();
     return dalad.Count();
 }
Пример #38
0
        private DataSet AddPositionAndQuiz(DataSet ds)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.QuizInfoIDAL quiz    = factory.getQuizInstance();

            DataColumn dc = new DataColumn();

            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position0";
            ds.Tables[0].Columns.Add(dc);

            dc            = new DataColumn();
            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position1";
            ds.Tables[0].Columns.Add(dc);

            dc            = new DataColumn();
            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position2";
            ds.Tables[0].Columns.Add(dc);

            dc            = new DataColumn();
            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz0";
            ds.Tables[0].Columns.Add(dc);

            dc            = new DataColumn();
            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz1";
            ds.Tables[0].Columns.Add(dc);

            dc            = new DataColumn();
            dc.DataType   = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz2";
            ds.Tables[0].Columns.Add(dc);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (dr["Challenge_Salary"].ToString() == "1")
                {
                    dr["Challenge_Salary"] = "2k~5k";
                }
                else if (dr["Challenge_Salary"].ToString() == "2")
                {
                    dr["Challenge_Salary"] = "5k~8k";
                }
                else if (dr["Challenge_Salary"].ToString() == "3")
                {
                    dr["Challenge_Salary"] = "8k~10k";
                }
                else if (dr["Challenge_Salary"].ToString() == "4")
                {
                    dr["Challenge_Salary"] = "10k~12k";
                }
                else if (dr["Challenge_Salary"].ToString() == "5")
                {
                    dr["Challenge_Salary"] = "12k~15k";
                }
                else if (dr["Challenge_Salary"].ToString() == "6")
                {
                    dr["Challenge_Salary"] = "15k以上";
                }
                string strTemp = dr["Challenge_Position"].ToString();
                if (strTemp.IndexOf(",") == -1)
                {
                    //没逗号直接赋值
                    dr["Challenge_Position0"] = strTemp;
                }
                else
                {
                    //有逗号就分割
                    string[] arrTemp = strTemp.Split(',');
                    dr["Challenge_Position0"] = arrTemp[0].ToString();
                    dr["Challenge_Position1"] = arrTemp[1].ToString();
                    dr["Challenge_Position2"] = arrTemp[1].ToString();
                }
                strTemp = dr["Challenge_Quiz_First"].ToString();
                dr["Challenge_Quiz0"] = quiz.QuizName(strTemp);
                strTemp = dr["Challenge_Quiz_Sec"].ToString();
                dr["Challenge_Quiz1"] = quiz.QuizName(strTemp);
                strTemp = dr["Challenge_Quiz_Third"].ToString();
                dr["Challenge_Quiz2"] = quiz.QuizName(strTemp);
            }
            return(ds);
        }
Пример #39
0
 public int UpdateEnterpriceInfo0(Enterprice enterprice)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo0(enterprice);
 }
Пример #40
0
 //提交重置密码
 public int SetPassword(string email, string newPwd)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     return(dalad.SetPassword(email, newPwd));
 }
Пример #41
0
 public DataSet AllEnterpriseInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     return en.AllEnterpriseInfo();
 }
Пример #42
0
 public DataSet QuizInfo(string id)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.QuizInfoIDAL en = factory.getQuizInstance();
     return en.QuizInfo(id);
 }
Пример #43
0
 public DataSet AllChallengeInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad = factory.getSearchInstance();
     return dalad.AllChallengeInfo();
 }
Пример #44
0
 public int UpdateUserInfo(User user)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     return(dalad.UpdateUserInfo(user));
 }
Пример #45
0
 public int UpdateUserLevel(string level, string price, string userID)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     return(dalad.UpdateUserLevel(level, price, userID));
 }
Пример #46
0
 public DataSet AllUserInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL dalad = factory.getUserInstance();
     return dalad.AllUserInfo();
 }
Пример #47
0
        public int RegisterEnterprice(string email, string password)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL user = factory.getUserInstance();
            OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
            Model.Enterprice enterprice = new Model.Enterprice();
            enterprice.Enterprice_ID = Guid.NewGuid().ToString();
            enterprice.Enterprice_Email = email;
            enterprice.Enterprice_Password = password;
            if (dalad.CheckEnterpriceEmail(email) == 0 && user.CheckUserEmail(email)==0)
            {
                return dalad.RegisterEnterprice(enterprice);
            }
            else
            {

                return 0;
            }
        }
Пример #48
0
 public DataSet EnterpriceInfo(string id)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
     return(en.EnterpriceInfo(id));
 }
Пример #49
0
 public DataSet EnterpriceInfo(string id)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     return en.EnterpriceInfo(id);
 }
Пример #50
0
 public DataSet AllEnterpriseInfo()
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
     return(en.AllEnterpriseInfo());
 }
Пример #51
0
 public DataSet AllChallengeInfo()
 {
     OxcoderIFactory.IFactory        factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.SearchChallengeIDAL dalad   = factory.getSearchInstance();
     return(dalad.AllChallengeInfo());
 }
Пример #52
0
 public int UpdateEnterpriceInfo1(string position, string email)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo1(position, email));
 }
Пример #53
0
 public int UpdateEnterpriceInfo1(string position,string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo1(position, email);
 }
Пример #54
0
        private DataSet AddPositionAndQuiz(DataSet ds)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.QuizInfoIDAL quiz = factory.getQuizInstance();

            DataColumn dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position0";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position1";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Position2";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz0";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz1";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Challenge_Quiz2";
            ds.Tables[0].Columns.Add(dc);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (dr["Challenge_Salary"].ToString() == "1")
                {
                    dr["Challenge_Salary"] = "2k~5k";
                }
                else if (dr["Challenge_Salary"].ToString() == "2")
                {
                    dr["Challenge_Salary"] = "5k~8k";
                }
                else if (dr["Challenge_Salary"].ToString() == "3")
                {
                    dr["Challenge_Salary"] = "8k~10k";
                }
                else if (dr["Challenge_Salary"].ToString() == "4")
                {
                    dr["Challenge_Salary"] = "10k~12k";
                }
                else if (dr["Challenge_Salary"].ToString() == "5")
                {
                    dr["Challenge_Salary"] = "12k~15k";
                }
                else if (dr["Challenge_Salary"].ToString() == "6")
                {
                    dr["Challenge_Salary"] = "15k以上";
                }
                string strTemp = dr["Challenge_Position"].ToString();
                if (strTemp.IndexOf(",") == -1)
                {
                    //没逗号直接赋值
                    dr["Challenge_Position0"] = strTemp;
                }
                else
                {
                    //有逗号就分割
                    string[] arrTemp = strTemp.Split(',');
                    dr["Challenge_Position0"] = arrTemp[0].ToString();
                    dr["Challenge_Position1"] = arrTemp[1].ToString();
                    dr["Challenge_Position2"] = arrTemp[1].ToString();
                }
                strTemp = dr["Challenge_Quiz_First"].ToString();
                dr["Challenge_Quiz0"] = quiz.QuizName(strTemp);
                strTemp = dr["Challenge_Quiz_Sec"].ToString();
                dr["Challenge_Quiz1"] = quiz.QuizName(strTemp);
                strTemp = dr["Challenge_Quiz_Third"].ToString();
                dr["Challenge_Quiz2"] = quiz.QuizName(strTemp);
            }
            return ds;
        }
Пример #55
0
 public int UpdateEnterpriceInfo(string fullName,string enterpricePhone,string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo(fullName,enterpricePhone,email);
 }
Пример #56
0
 public DataSet AllQuizInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.QuizInfoIDAL en      = factory.getQuizInstance();
     return(en.AllQuizInfo());
 }
Пример #57
0
 public int SendEnterpriceEmail(string emailTo)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     // dalad.SendEmail(id, md5);
     //TODO:发邮件
     MailMessage mailMsg = new MailMessage();
     mailMsg.From = new MailAddress("*****@*****.**");
     mailMsg.To.Add(emailTo);
     mailMsg.Subject = "请激活注册账号";
     string activeCode = Guid.NewGuid().ToString().Substring(0, 8);
     StringBuilder contentBuilder = new StringBuilder();
     contentBuilder.Append("请点击下面的链接完成激活注册");
     string type = "Enterprice";
     contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
     if (dalad.SendEnterpriceEmail(emailTo, activeCode) != 0)
     {
         client.Send(mailMsg);
         return 1;
     }
     else
     {
         return 0;
     }
 }
Пример #58
0
 public int UpdateEnterpriceInfo0(Enterprice enterprice)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo0(enterprice));
 }
Пример #59
0
        private DataSet AddOtherInfo(DataSet ds,DataSet ds2)
        {
            DataColumn dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Enterprice_FullName";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Enterprice_Logo";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Test_Quiz0";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Test_Quiz1";
            ds.Tables[0].Columns.Add(dc);

            dc = new DataColumn();
            dc.DataType = System.Type.GetType("System.String");
            dc.ColumnName = "Test_Quiz2";
            ds.Tables[0].Columns.Add(dc);

            DataRow dr = ds.Tables[0].Rows[0];
            DataRow dr2 = ds2.Tables[0].Rows[0];
            dr["Enterprice_FullName"] = dr2["Enterprice_FullName"].ToString();
            dr["Enterprice_Logo"] = dr2["Enterprice_Logo"].ToString();

            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.QuizInfoIDAL quiz = factory.getQuizInstance();
            String strTemp = dr2["Challenge_Quiz_First"].ToString();
            if (dr["Test_Quiz0_State"].ToString() != "-1")
                dr["Test_Quiz0"] = quiz.QuizName(strTemp) + "通过";
            else
                dr["Test_Quiz0"] = quiz.QuizName(strTemp) + "未通过";

            strTemp = dr2["Challenge_Quiz_Sec"].ToString();
            if (dr["Test_Quiz1_State"].ToString() != "-1")
                dr["Test_Quiz1"] = quiz.QuizName(strTemp) + "通过";
            else
                dr["Test_Quiz1"] = quiz.QuizName(strTemp) + "未通过";

            strTemp = dr2["Challenge_Quiz_Third"].ToString();
            if (dr["Test_Quiz2_State"].ToString() != "-1")
                dr["Test_Quiz2"] = quiz.QuizName(strTemp) + "通过";
            else
                dr["Test_Quiz2"] = quiz.QuizName(strTemp) + "未通过";
            return ds;
        }
Пример #60
0
 public int Count()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL     dalad   = factory.getUserInstance();
     return(dalad.Count());
 }