Example #1
0
        // GET: AbExamples
        //获取正常数据曲线接口
        public string getNormalData(string User_type)//User_TYpe 为1-10
        {
            if (User_type != "01JCC" && User_type != "02CLC" &&
                User_type != "03ZZC" && User_type != "04HGC" &&
                User_type != "05ZGC" && User_type != "06Hospital" &&
                User_type != "07ZJDX" && User_type != "08FZC" &&
                User_type != "09CKC" && User_type != "10SC")
            {
                return("FalseUserType");  //获取用户类别错误
            }
            string    res      = "error"; //默认报错
            string    TB_Name  = "class" + User_type;
            DataTable dtI      = DAL.AbExamples.MyAbExample.getNormalData(TB_Name, "I");
            DataTable dtU      = DAL.AbExamples.MyAbExample.getNormalData(TB_Name, "U");
            DataTable dtW      = DAL.AbExamples.MyAbExample.getNormalData(TB_Name, "W");
            string    NordataI = new Helper.jstodt().ToJson(dtI); //数据打成json返回
            string    NordataU = new Helper.jstodt().ToJson(dtU); //数据打成json返回
            string    NordataW = new Helper.jstodt().ToJson(dtW); //数据打成json返回

            #region 处理data数据
            DataTable dt = new DataTable();
            dt.Columns.Add("ID", Type.GetType("System.String"));
            dt.Columns.Add("DataI", Type.GetType("System.String"));
            dt.Columns.Add("DataU", Type.GetType("System.String"));
            dt.Columns.Add("DataW", Type.GetType("System.String"));
            dt.Rows.Add();
            dt.Rows[0]["ID"]    = User_type;
            dt.Rows[0]["DataI"] = NordataI;
            dt.Rows[0]["DataU"] = NordataU;
            dt.Rows[0]["DataW"] = NordataW;
            #endregion
            res = new Helper.jstodt().ToJson(dt);
            return(res);//固定死正常数据
        }
Example #2
0
        public string getUsers(string teacherID)
        {
            DataTable dt  = DAL.User.MyUser.getUsers(teacherID);
            string    res = new Helper.jstodt().ToJson(dt);

            return(res);
        }
Example #3
0
        /// <summary>
        /// 获取工单列表
        /// </summary>
        /// <returns></returns>
        public string GetSolveList()
        {
            string    res = "false";
            DataTable dt  = DAL.SolveList.MySolveList.GetSolveList();

            res = new Helper.jstodt().ToJson(dt);
            return(res);
        }
Example #4
0
        /// <summary>
        /// 获取视频详情
        /// </summary>
        /// <param name="videoid"></param>
        /// <returns></returns>
        public string getvideo(string videoid)
        {
            string    res = "false";
            DataTable dt  = DAL.Videos.MyVideos.getvideo(videoid);

            res = new Helper.jstodt().ToJson(dt);
            return(res);
        }
Example #5
0
        /// <summary>
        /// 将结果数组转为Json并返回
        /// </summary>
        /// <param name="resLength"></param>
        /// <returns></returns>
        public string getJudgeResult(int resLength)
        {
            JudgeResult judgeResult = new JudgeResult();

            string[] resultStr = judgeResult.readRes(resLength);
            string   result    = new Helper.jstodt().rAtoJs(resultStr);

            return(result);
        }
Example #6
0
        /// <summary>
        /// 获取指定异常ID的工单
        /// </summary>
        /// <param name="abId"></param>
        /// <returns></returns>
        public string GetSolve(string abID)
        {
            string    res  = "false";
            int       abId = Convert.ToInt32(abID);
            DataTable dt   = DAL.SolveList.MySolveList.GetSolve(abId);

            res = new Helper.jstodt().ToJson(dt);
            return(res);
        }
Example #7
0
        public string getteacherlogin(string id, string pwd)
        {
            string    res = "False";
            DataTable dt  = new DAL.SLogin().getteacherlogin(id, pwd);

            res = new Helper.jstodt().ToJson(dt);
            if (!DAL.Videos.t.IsAlive)
            {
                DAL.Videos.t.Start();
            }
            return(res);
        }
Example #8
0
 public string CreateNorData(string UpperID, string UserType)
 {
     #region 生成曲线数据
     DataTable dt = ServerDAL.CreateDataDal.MyCreate.getNormalData(UserType);
     #region 创建数据格式
     DataTable DtI = new DataTable();
     DtI.Columns.Add("时间", Type.GetType("System.String"));
     DtI.Columns.Add("A相电流", Type.GetType("System.String"));
     DtI.Columns.Add("B相电流", Type.GetType("System.String"));
     DtI.Columns.Add("C相电流", Type.GetType("System.String"));
     DataTable DtU = new DataTable();
     DtU.Columns.Add("时间", Type.GetType("System.String"));
     DtU.Columns.Add("A相电压", Type.GetType("System.String"));
     DtU.Columns.Add("B相电压", Type.GetType("System.String"));
     DtU.Columns.Add("C相电压", Type.GetType("System.String"));
     DataTable DtW = new DataTable();
     DtW.Columns.Add("时间", Type.GetType("System.String"));
     DtW.Columns.Add("用电量", Type.GetType("System.String"));
     DtW.Columns.Add("变压器容量", Type.GetType("System.String"));
     DtW.Columns.Add("倍率", Type.GetType("System.String"));
     #endregion
     int rowscpount = dt.Rows.Count;
     int RW         = 0;
     for (int i = 0; i < rowscpount; i++)
     {
         DtI.Rows.Add();
         DtI.Rows[i]["时间"]   = dt.Rows[i]["时间"].ToString();
         DtI.Rows[i]["A相电流"] = dt.Rows[i]["A相电流"].ToString();
         DtI.Rows[i]["B相电流"] = dt.Rows[i]["B相电流"].ToString();
         DtI.Rows[i]["C相电流"] = dt.Rows[i]["C相电流"].ToString();
         DtU.Rows.Add();
         DtU.Rows[i]["时间"]   = dt.Rows[i]["时间"].ToString();
         DtU.Rows[i]["A相电压"] = dt.Rows[i]["A相电压"].ToString();
         DtU.Rows[i]["B相电压"] = dt.Rows[i]["B相电压"].ToString();
         DtU.Rows[i]["C相电压"] = dt.Rows[i]["C相电压"].ToString();
         if (dt.Rows[i]["用电量"] != null && dt.Rows[i]["用电量"].ToString() != "")
         {
             DtW.Rows.Add();
             DtW.Rows[RW]["时间"]    = dt.Rows[i]["时间"].ToString();
             DtW.Rows[RW]["用电量"]   = dt.Rows[i]["用电量"].ToString();
             DtW.Rows[RW]["变压器容量"] = dt.Rows[i]["变压器容量"].ToString();
             DtW.Rows[RW]["倍率"]    = dt.Rows[i]["倍率"].ToString();
             RW++;
         }
     }
     #endregion
     string DataI = new Helper.jstodt().ToJson(DtI);
     string DataU = new Helper.jstodt().ToJson(DtU);
     string DataW = new Helper.jstodt().ToJson(DtW);
     string flag  = ServerDAL.CreateDataDal.MyCreate.InsertIUW(UpperID, DataI, DataU, DataW);//插入生成的IUW
     return(flag);
 }