Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        public string Savemytype(string Ptid, string TypeScore)
        {
            string msgss = "-1";

            if (HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname] != null)
            {
                int    Psid        = Int32.Parse(HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString());
                string Psnum       = HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString();
                string Pip         = HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["LoginIp"].ToString();
                int    Sgrade      = Int32.Parse(HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString());
                int    Sclass      = Int32.Parse(HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString());
                int    Pterm       = Int32.Parse(HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString());
                bool   workiplimit = LearnSite.Common.XmlHelp.GetWorkIpLimit();
                if (workiplimit)
                {
                    LearnSite.BLL.Ptyper pbll = new LearnSite.BLL.Ptyper();
                    if (!pbll.ExistPtyper(Psid, Sgrade, Sclass, Pip))
                    {
                        msgss = SaveTypeRecord(Int32.Parse(Ptid), Psid, Psnum, Pip, Sgrade, Pterm, TypeScore);
                    }
                    else
                    {
                        msgss = "-2";
                    }
                }
                else
                {
                    msgss = SaveTypeRecord(Int32.Parse(Ptid), Psid, Psnum, Pip, Sgrade, Pterm, TypeScore);
                }
            }
            return(msgss);
        }
Ejemplo n.º 2
0
        private string SaveTypeRecord(int Ptid, int Psid, string Psnum, string Pip, int Pgrade, int Pterm, string TypeScore)
        {
            int Pscore = Int32.Parse(TypeScore.Trim());

            DateTime Pdate = DateTime.Now;

            LearnSite.Model.Ptyper pmodel = new LearnSite.Model.Ptyper();
            pmodel.Pdate   = Pdate;
            pmodel.Pip     = Pip;
            pmodel.Pscore  = Pscore;
            pmodel.Psnum   = Psnum;
            pmodel.Ptid    = Ptid;
            pmodel.Ptype   = 1;
            pmodel.Pdegree = GetPdegree(Pscore);
            pmodel.Pgrade  = Pgrade;
            pmodel.Pterm   = Pterm;
            pmodel.Psid    = Psid;
            LearnSite.BLL.Ptyper pt = new LearnSite.BLL.Ptyper();
            int res = -1;

            if (pt.ExistsPsnum(Psid))
            {
                res = pt.Update(pmodel);
            }
            else
            {
                res = pt.Add(pmodel);
            }
            if (res > 0)
            {
                pt.UpdateStscore(Psid, Pscore);
                res = 1;
            }
            return(res.ToString());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        public string Savemytype(string Ptid, string TypeScore)
        {
            string msgss = "-1";

            if (HttpContext.Current.Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname] != null)
            {
                LearnSite.Model.Cook cook = new LearnSite.Model.Cook();

                int    Psid        = cook.Sid;
                string Psnum       = cook.Snum;
                string Pip         = cook.LoginIp;
                int    Sgrade      = cook.Sgrade;
                int    Sclass      = cook.Sclass;
                int    Pterm       = cook.ThisTerm;
                bool   workiplimit = LearnSite.Common.XmlHelp.GetWorkIpLimit();
                if (workiplimit)
                {
                    LearnSite.BLL.Ptyper pbll = new LearnSite.BLL.Ptyper();
                    if (!pbll.ExistPtyper(Psid, Sgrade, Sclass, Pip))
                    {
                        msgss = SaveTypeRecord(Int32.Parse(Ptid), Psid, Psnum, Pip, Sgrade, Pterm, TypeScore);
                    }
                    else
                    {
                        msgss = "-2";
                    }
                }
                else
                {
                    msgss = SaveTypeRecord(Int32.Parse(Ptid), Psid, Psnum, Pip, Sgrade, Pterm, TypeScore);
                }
            }
            return(msgss);
        }