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