Beispiel #1
0
 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!要它干嘛?
 /// <summary>
 /// 新增模型
 /// </summary>
 /// <param name="modelInfo"></param>
 public void AddModel(Model  model)
 {
     //ModelYunBLL.ModelInfo modelBLL = new ModelYunBLL.ModelInfo();
     ModelServiceClient ms=new ModelServiceClient();
     //modelBLL.AddModel(modelInfo);
     ms.Create(model.name, model.version, Convert.ToInt32(model.authorUserId), model.className, (Int32)model.topId, (Int32)model.typeId);
 }
 /// <summary>Snippet for GetModel</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetModel()
 {
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     string projectId = "";
     string datasetId = "";
     string modelId   = "";
     // Make the request
     Model response = modelServiceClient.GetModel(projectId, datasetId, modelId);
 }
Beispiel #3
0
 /// <summary>Snippet for ListModels</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListModels()
 {
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     string projectId  = "";
     string datasetId  = "";
     uint?  maxResults = 0U;
     // Make the request
     ListModelsResponse response = modelServiceClient.ListModels(projectId, datasetId, maxResults);
 }
        /// <summary>Snippet for DeleteModel</summary>
        public void DeleteModel()
        {
            // Snippet: DeleteModel(string, string, string, CallSettings)
            // Create client
            ModelServiceClient modelServiceClient = ModelServiceClient.Create();
            // Initialize request argument(s)
            string projectId = "";
            string datasetId = "";
            string modelId   = "";

            // Make the request
            modelServiceClient.DeleteModel(projectId, datasetId, modelId);
            // End snippet
        }
 /// <summary>Snippet for PatchModel</summary>
 public void PatchModel()
 {
     // Snippet: PatchModel(string, string, string, Model, CallSettings)
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     string projectId = "";
     string datasetId = "";
     string modelId   = "";
     Model  model     = new Model();
     // Make the request
     Model response = modelServiceClient.PatchModel(projectId, datasetId, modelId, model);
     // End snippet
 }
 /// <summary>Snippet for GetModel</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetModelRequestObject()
 {
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     GetModelRequest request = new GetModelRequest
     {
         ProjectId = "",
         DatasetId = "",
         ModelId   = "",
     };
     // Make the request
     Model response = modelServiceClient.GetModel(request);
 }
Beispiel #7
0
 /// <summary>Snippet for ListModels</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListModelsRequestObject()
 {
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     ListModelsRequest request = new ListModelsRequest
     {
         ProjectId  = "",
         DatasetId  = "",
         MaxResults = 0U,
         PageToken  = "",
     };
     // Make the request
     ListModelsResponse response = modelServiceClient.ListModels(request);
 }
Beispiel #8
0
        /// <summary>Snippet for DeleteModel</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteModelRequestObject()
        {
            // Create client
            ModelServiceClient modelServiceClient = ModelServiceClient.Create();
            // Initialize request argument(s)
            DeleteModelRequest request = new DeleteModelRequest
            {
                ProjectId = "",
                DatasetId = "",
                ModelId   = "",
            };

            // Make the request
            modelServiceClient.DeleteModel(request);
        }
 /// <summary>Snippet for PatchModel</summary>
 public void PatchModelRequestObject()
 {
     // Snippet: PatchModel(PatchModelRequest, CallSettings)
     // Create client
     ModelServiceClient modelServiceClient = ModelServiceClient.Create();
     // Initialize request argument(s)
     PatchModelRequest request = new PatchModelRequest
     {
         ProjectId = "",
         DatasetId = "",
         ModelId   = "",
         Model     = new Model(),
     };
     // Make the request
     Model response = modelServiceClient.PatchModel(request);
     // End snippet
 }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Method = Request["Method"];
            //保存文件时用到的模型ID,用于分类目录
            string ModelIDParam = "";
            try
            {
                ModelIDParam = Request["ModelID"];
            }
            catch { }

            if (Method == "saveOMI")
            {
                saveFile(this.Context, "UploadOMI");
            }
            else if (Method == "saveDLL")
            {
                saveFile(this.Context, "UploadDLL");
            }
            else if (Method == "ModelInfo")//!!!!!!!!!!!!!!!!!!!!!!!!!与下面的switch重复了!!!!!!!!!!!!!!!!!!
            {
                //ModelYunModel.ModelInfo _oneModel = new ModelYunModel.ModelInfo();
                Model _oneModel = new Model();
                _oneModel.name = Request["ModelName"];
                _oneModel.typeId = Convert.ToInt32(Request["SelectModelType"]);
               // _oneModel.ModelDllName = Request["ModelDllName"];
               // _oneModel.ResultStartRow = Convert.ToInt32(Request["ResultStartRow"]);
               // _oneModel.OMIFileName = Request["uploadifyNote"];
               // ModelYunBLL.ModelInfo _modelBLL = new ModelYunBLL.ModelInfo();
                ModelServiceClient ms = new ModelServiceClient();
                ms.Create(_oneModel.name,_oneModel.version,Convert.ToInt32(_oneModel.authorUserId),_oneModel.className,(Int32)_oneModel.topId,(Int32)_oneModel.typeId);
                Response.Write("OK");
            }
            switch (Method)
            {
                case "Login":
                    string username = Request["UserName"];
                    string password = Request["Password"];
                    int userID = 0;
                    //ModelYunBLL.Users UsersBll = new ModelYunBLL.Users();
                    UserServiceClient UsersBll = new UserServiceClient();
                    bool IsAccountOK = UsersBll.Auth(username, password);
                    userID = Convert.ToInt32(UsersBll.GetByUsername(username).id);
                    if (IsAccountOK == true)
                    {
                        Response.Write("OK");
                        Response.Cookies["DigitalBasinUserName"].Value = username;
                        Response.Cookies["DigitalBasinUserName"].Expires = DateTime.MaxValue;
                        Response.Cookies["DigitalBasinUserID"].Value = userID.ToString();
                        Response.Cookies["DigitalBasinUserID"].Expires = DateTime.MaxValue;

                    }
                    else
                    {
                        Response.Write("Not OK");
                    }
                    break;
                case "saveOMI":
                    saveFile(this.Context, "UploadOMI");
                    break;
                case "saveDLL":
                    saveFile(this.Context, "UploadDLL");
                    break;

                case "ModelInfo":
                   // ModelYunModel.ModelInfo _oneModel = new ModelYunModel.ModelInfo();
                    Model _oneModel = new Model();
                    _oneModel.name = Request["ModelName"];
                    _oneModel.typeId=Convert.ToInt32(Request["SelectModelType"]);
                    //_oneModel.ModelDllName = Request["ModelDllName"];
                    //_oneModel.ResultStartRow = Convert.ToInt32(Request["ResultStartRow"]);
                    //_oneModel.OMIFileName = Request["uploadifyNote"];
                    //ModelYunBLL.ModelInfo _modelBLL = new ModelYunBLL.ModelInfo();
                    ModelServiceClient _modelBLL = new ModelServiceClient();
                    _modelBLL.Create(_oneModel.name, _oneModel.version, Convert.ToInt32(_oneModel.authorUserId), _oneModel.className, (Int32)_oneModel.topId, (Int32)_oneModel.typeId);
                    Response.Write("OK");
                    break;

                //参数配置-------------------------------------Start-------------|
                case "canshupeizhi":
                    saveFile(this.Context, "DATA\\" + ModelIDParam + "\\canshupeizhi");
                    break;
                    //参数配置
                case "CanshupeizhiSubmit":
                    //水流时间步长(秒)
                    string buchang = Request["BuChang"];
                    Response.Write("OK");
                    break;
                //--------参数配置--------End

                //边界控制-------------------------------------Start-------------|
                case "bianjiekongzhi_DiXing":
                    saveFile(this.Context, "DATA\\" + ModelIDParam + "\\bianjiekongzhi\\bianjiekongzhi_DiXing");
                    break;
                //边界控制-------------------------------------Start-------------|
                case "bianjiekongzhi_RuKou":
                    saveFile(this.Context, "DATA\\" + ModelIDParam + "\\bianjiekongzhi\\bianjiekongzhi_RuKou");
                    break;
                case "BianjiekongzhiSubmit":
                    Response.Write("OK");
                    break;
                //--------边界控制--------End

                //初始条件-------------------------------------Start-------------|
                case "chushitiaojian":
                    saveFile(this.Context, "DATA\\" + ModelIDParam + "\\chushitiaojian");
                    break;
                case "ChushitiaojianSubmit":
                    Response.Write("OK");
                    break;
                //--------初始条件--------End

                //过程控制-------------------------------------Start-------------|
                case "guochengkongzhi":
                    saveFile(this.Context, "DATA\\" + ModelIDParam + "\\guochengkongzhi");
                    break;
                case "GuochengkongzhiSubmit":
                    Response.Write("OK");
                    break;
                //--------过程控制--------End
            }
        }