Exemple #1
0
        public void TestUpdataBuild_OK2()
        {
            BuildSetService service = new BuildSetService();

            BuildSetViewModel ViewModel  = service.GetAllBuilds();
            BuildViewModel    lasstbuild = ViewModel.Builds.Last();


            string  buildID         = "000001G008";
            string  buildName       = "test8";
            string  buildAddr       = "test addr 8";
            decimal buildLong       = 123;
            decimal buildLat        = 45;
            decimal totalArea       = 789;
            int     numberOfPeople  = 1234;
            int     transCount      = 45;
            int     installCapacity = 78;
            int     operateCapacity = 90;
            int     designMeters    = 100;



            ViewModel = service.UpdatePartBuildInfo(buildID, buildName, buildAddr,
                                                    buildLong, buildLat, totalArea, numberOfPeople,
                                                    transCount, installCapacity, operateCapacity, designMeters
                                                    );

            Console.WriteLine(UtilTest.GetJson(ViewModel));
        }
Exemple #2
0
        public object Update([FromBody] JObject obj)
        {
            try
            {
                string  buildID   = obj["buildID"].ToString();
                string  buildName = obj["buildName"].ToString();
                string  buildAddr = obj["buildAddr"].ToString();
                decimal buildLong = Convert.ToDecimal(obj["buildLong"].ToString());
                decimal buildLat  = Convert.ToDecimal(obj["buildLat"].ToString());

                decimal totalArea      = Convert.ToDecimal(obj["totalArea"].ToString());
                int     numberOfPeople = Convert.ToInt32(obj["numberOfPeople"].ToString());
                int     transCount     = Convert.ToInt32(obj["transCount"].ToString());
                //安装变压器容量,运行容量,监控仪表数量,联系电话
                int installCapacity = Convert.ToInt32(obj["installCapacity"].ToString());
                int operateCapacity = Convert.ToInt32(obj["operateCapacity"].ToString());
                int designMeters    = Convert.ToInt32(obj["designMeters"].ToString());

                return(service.UpdatePartBuildInfo(buildID, buildName, buildAddr,
                                                   buildLong, buildLat, totalArea, numberOfPeople,
                                                   transCount, installCapacity, operateCapacity, designMeters));
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }