Esempio n. 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));
        }
Esempio n. 2
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));
        }