コード例 #1
0
        public double TimMucNuoc(int vitricode, double dungtich)
        {
            double result = -1;

            try
            {
                //switch (vitricode)
                //{
                //    case 1:
                //        dungtich = Math.Round(dungtich, 0);
                //        break;
                //    case 2:
                //        dungtich = Math.Round(dungtich, 1);
                //        break;
                //    case 3:
                //        dungtich = Math.Round(dungtich, 3);
                //        break;
                //}
                LakeVitri tmpLakeVitri = LakeCode.FirstOrDefault(x => x.ViTri == vitricode);
                string    url          = linkServer + "ApiService/TraCuuMucNuocByDungTichHo";
                string    param        = String.Format(@"lakecode={0}&dungtichho={1}", tmpLakeVitri.LakeCode, dungtich);
                string    method       = "Post";
                result = CallTLVN <double>(url, param, method);
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
コード例 #2
0
        public double TimDungTich(int vitricode, double mucnuoc)
        {
            double result = -1;

            try
            {
                LakeVitri tmpLakeVitri = LakeCode.FirstOrDefault(x => x.ViTri == vitricode);
                string    url          = linkServer + "ApiService/TraCuuDungTichHoByMucNuocHo";
                string    param        = String.Format(@"lakecode={0}&mucnuocho={1}", tmpLakeVitri.LakeCode, mucnuoc);
                string    method       = "Post";
                result = CallTLVN <double>(url, param, method);
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
コード例 #3
0
        public double GetDataLakeEVN(int vitricode, int datatype)
        {
            double result = -1;

            try
            {
                LakeVitri tmpLakeVitri = LakeCode.FirstOrDefault(x => x.ViTri == vitricode);
                string    url          = linkServer + "ApiService/GetThucHoHienTaiHoEVN";
                string    param        = String.Format(@"lakeCode={0}&dataType={1}", tmpLakeVitri.LakeCode, datatype);
                string    method       = "Post";
                result = CallTLVN <double>(url, param, method);
            }
            catch (Exception ex)
            {
            }
            return(result);
        }