Ejemplo n.º 1
0
        public Client_Out GetSiteByIP(string input)
        {
            Client_Out json  = new Client_Out();
            Client_In  model = null;

            try
            {
                model = Newtonsoft.Json.JsonConvert.DeserializeObject <Client_In>(input);
                string         strSql        = string.Format("select * from TAB_Base_Site where strSiteIP=@strSiteIP");
                SqlParameter[] sqlParameters = new SqlParameter[]
                {
                    new SqlParameter("strSiteIP", model.localIP),
                };
                DataTable table =
                    SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParameters).Tables[0];
                if (table != null && table.Rows.Count > 0)
                {
                    DataRow     row         = table.Rows[0];
                    string      strSiteGUID = row["strSiteGUID"].ToString();
                    TRsSiteInfo Site        = new TRsSiteInfo();
                    ADOQueryToData(row, Site);
                    strSql        = string.Format("select * from TAB_Base_TrainJiaoluInSite where strSiteGUID=@strSiteGUID");
                    sqlParameters = new SqlParameter[] { new SqlParameter("strSiteGUID", strSiteGUID), };
                    table         = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParameters).Tables[0];
                    FillSiteTrainJiaolus(table, Site);

                    strSql = string.Format("select * from TAB_Base_Site_Limit where strSiteGUID=@strSiteGUID");
                    table  = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParameters).Tables[0];
                    FillSiteJobLimits(table, Site);
                    json.data      = Site;
                    json.result    = "0";
                    json.resultStr = "获取用户信息成功";
                }
                else
                {
                    json.result    = "1";
                    json.resultStr = "该客户端没有在服务器上注册";
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                throw ex;
            }
            return(json);
        }
Ejemplo n.º 2
0
        public Client_Out GetPlaceOfClient(string data)
        {
            Client_Out json = new Client_Out();

            try
            {
                Client_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Client_In>(data);
                TF.RunSafty.BLL.Place.VIEW_Base_Site_DutyPlace    bllPlace  = new TF.RunSafty.BLL.Place.VIEW_Base_Site_DutyPlace();
                List <TF.RunSafty.Model.VIEW_Base_Site_DutyPlace> placeList = bllPlace.GetPlaceOfClient(input.trainjiaoluID, input.siteID);
                json.result    = "0";
                json.resultStr = "提交成功";
                json.data      = GetPlaceListOfClient(placeList);
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                json.result    = "1";
                json.resultStr = "提交失败" + ex.Message;
            }
            return(json);
        }