Exemplo n.º 1
0
        // 初始化开发环境,获取session_id的网络请求
        protected void EnvironmentRequest()
        {
            CurrentLoginUser.currentState = EnvironmentState.NotReady;
            if (!EnableService)
            {
                CurrentLoginUser.currentState     = EnvironmentState.InEditing;
                CurrentLoginUser.currentSessionId = ("Task_" + CurrentLoginUser.currentTaskId + "_" + Guid.NewGuid());
                return;
            }

            CurrentLoginUser.InError = 0;
            try
            {
                EnvironmentRequestReq req = new EnvironmentRequestReq();
                req.exp_id   = Convert.ToInt32(CurrentLoginUser.currentExperimentId);
                req.user_id  = CurrentLoginUser.userId;
                req.exp_type = DB.GetExpType(req.exp_id);
                CurrentLoginUser.exp_type = req.exp_type;
                EnvironmentRequestRes res = API.BhController.GetService().EnvironmentRequest(req);
                if (res.fail == 0)
                {
                    CurrentLoginUser.currentState     = EnvironmentState.InEditing;
                    CurrentLoginUser.currentSessionId = res.session_id;
                }
            }
            catch (Exception ex)
            {
                CurrentLoginUser.InError      = 1;
                CurrentLoginUser.currentState = EnvironmentState.NotReady;
            }
        }
Exemplo n.º 2
0
        public EnvironmentRequestRes EnvironmentRequest(EnvironmentRequestReq req)
        {
            EnvironmentRequestRes e = new EnvironmentRequestRes();

            e.fail       = 0;
            e.session_id = Guid.NewGuid().ToString("D");
            return(e);
        }
Exemplo n.º 3
0
 public EnvironmentRequestRes EnvironmentRequest(EnvironmentRequestReq req)
 {
     return(service.EnvironmentRequest(req));
 }
Exemplo n.º 4
0
 public EnvironmentRequestRes EnvironmentRequest(EnvironmentRequestReq req)
 {
     return(PostJson <EnvironmentRequestReq, EnvironmentRequestRes>("EnvironmentRequest", req));
 }