Пример #1
0
        public string UploadDiffStudentdata()
        {
            string      json = hc.GetSerStuJsonByPostid("1");
            Posts       p    = DataSwitch.JsonToObject <Posts>(json);
            DsPostVerid dpv  = DataSwitch.JsonToObject <DsPostVerid>(p.Jsons);

            DataTable dt = (DataTable)gdb.GetStudentData(dpv.dbid, "byid");

            if (dt.Rows.Count == 0)
            {
                return("未有更新项");
            }
            string postjson = DataSwitch.DataToJson(dt);
            string dbmaxid  = gdb.GetStudentData("", "ver").ToString();
            Posts  p1       = new Posts {
                ID = dpv.serid + 1, Jsons = postjson
            };

            dpv.serid = dpv.serid + 1;
            dpv.dbid  = dbmaxid;
            Posts p2 = CreatPost(1, dpv);

            hc.PostStudentData(p1);
            return(hc.PostStudentData(p2));
        }
Пример #2
0
        public string UploadHisData()
        {
            string      hisverjson = hc.GetSerHisMaxIDJson("1");
            Posts       p          = DataSwitch.JsonToObject <Posts>(hisverjson);
            DsPostVerid dpv        = DataSwitch.JsonToObject <DsPostVerid>(p.Jsons);

            return(GetanduploadHisData(dpv));
        }
Пример #3
0
        public int GetJsonMaxID(string mid)
        {
            HttpHelper       hp          = new HttpHelper();
            var              url         = hp.host + @"/posts?id=" + mid + hp.salt;
            string           postjson    = hp.HttpGet(url);
            Posts            ps          = DataSwitch.JsonToObject <Posts>(postjson);
            List <DSstudent> studentlist = DataSwitch.JsonToList <DSstudent>(ps.Jsons);
            int              maxid       = studentlist.Max(did => did.id);

            return(maxid);
        }
Пример #4
0
        public string GetVerData(string sid)
        {
            string      str        = "";
            string      serjsonstr = hc.GetSerStuJsonByPostid(sid);
            Posts       p          = DataSwitch.JsonToObject <Posts>(serjsonstr);
            DsPostVerid dps        = DataSwitch.JsonToObject <DsPostVerid>(p.Jsons);
            int         count      = 1;

            //foreach (DataRow item in dps.DSAllstudentDT.Rows)
            //{
            //    str+=count+"--"+ item["dsname"].ToString()+"\r\n";
            //    count++;
            //}
            return(serjsonstr);
        }
Пример #5
0
        public string UploadAllstudentdata()
        {
            DataTable dt   = (DataTable)gdb.GetStudentData("", "alldata");
            string    json = DataSwitch.DataToJson(dt);
            Posts     p1   = new Posts {
                ID = 2, Jsons = json
            };
            string      Smaxid  = hc.GetSerStuMaxID();
            string      dbmaxid = gdb.GetStudentData("", "ver").ToString();
            DsPostVerid dpv     = new DsPostVerid {
                serid = StrToInt(Smaxid), dbid = dbmaxid
            };
            Posts p2 = CreatPost(1, dpv);

            hc.PostStudentData(p1);
            return(hc.PostStudentData(p2));
        }
Пример #6
0
        public string UploadHisVer()
        {
            Posts       sp  = DataSwitch.JsonToObject <Posts>(hc.GetSerHisMaxIDJson("1"));
            DsPostVerid dpv = DataSwitch.JsonToObject <DsPostVerid>(sp.Jsons);

            dpv.serid = dpv.serid + 1;
            DataTable maxdbiddt = (DataTable)gdb.GetStudentData("", "hisid");
            string    maxdbid   = "";

            if (maxdbiddt.Rows.Count > 0)
            {
                maxdbid  = maxdbiddt.Rows[0]["ID"].ToString();
                dpv.dbid = maxdbid;
                Posts p = CreatPost(1, dpv);
                return(hc.PostHisData(p));
            }
            return("");
        }