public double tinhKhoangCachHaiDiem(PointItem point1, PointItem point2) { PointItem point1Rad = new PointItem(DegToRad(point1.Lat), DegToRad(point1.Lng)); PointItem point2Rad = new PointItem(DegToRad(point2.Lat), DegToRad(point2.Lng)); PointItem pointDenta = new PointItem(point2Rad.Lat - point1Rad.Lat, point2Rad.Lng - point1Rad.Lng); double sum = Math.Sin(pointDenta.Lat / 2) * Math.Sin(pointDenta.Lat / 2) + (Math.Cos(DegToRad(point1.Lat)) * Math.Cos(DegToRad(point2.Lat)) * Math.Sin(pointDenta.Lng / 2) * Math.Sin(pointDenta.Lng / 2)); return(6371 * 2 * Math.Atan2(Math.Sqrt(sum), Math.Sqrt(1 - sum))); }
public List <TreeItem> List_vn2000_To_blwgs84(List <TreeItem> list) { PointItem point = null; foreach (var item in list) { point = pointFunc.vn2000_2_blwgs84(item.LATITUDE_HOTRONGCAY, item.LONGITUDE_HOTRONGCAY); //float x = float.Parse(point.Lat.ToString()); //float y = float.Parse(point.Lng.ToString()); item.LATITUDE_HOTRONGCAY = (float)point.Lat; item.LONGITUDE_HOTRONGCAY = (float)point.Lng; } return(list); }
public List <TreeLite> getHinhVuong(LoginData loginData, string databaseName, string tableName, PointItem point, double banKinh) { double latMIN = point.Lat - (banKinh / 110.574); double latMAX = point.Lat + (banKinh / 110.574); double lngMIN = point.Lng - (banKinh / 111.320 * Math.Cos((banKinh / 110.574))); double lngMAX = point.Lng + (banKinh / 111.320 * Math.Cos((banKinh / 110.574))); connectSQL.Connect(loginData, databaseName); List <TreeLite> listItem = new List <TreeLite>(); string sqlQuery = "SELECT * FROM " + databaseName + ".dbo." + tableName + " WHERE LATITUDE_HOTRONGCAY >= @latMIN AND LATITUDE_HOTRONGCAY <= @latMAX" + " AND LONGITUDE_HOTRONGCAY >= @lngMIN AND LONGITUDE_HOTRONGCAY <= @lngMAX"; SqlCommand cmd = new SqlCommand(sqlQuery, connectSQL.connect); cmd.Parameters.Add(new SqlParameter("latMIN", latMIN)); cmd.Parameters.Add(new SqlParameter("latMAX", latMAX)); cmd.Parameters.Add(new SqlParameter("lngMIN", lngMIN)); cmd.Parameters.Add(new SqlParameter("lngMAX", lngMAX)); SqlDataReader r = cmd.ExecuteReader(); while (r.Read()) { string cayXanh = r["CAYXANH"].ToString(); double lng = double.Parse(r["LONGITUDE_HOTRONGCAY"].ToString()); double lat = double.Parse(r["LATITUDE_HOTRONGCAY"].ToString()); listItem.Add(new TreeLite(cayXanh, lat, lng)); #region GET Data //long iD_DONVIHANHCHINH = long.Parse(r["ID_DONVIHANHCHINH"].ToString()); //string tHONGTINCHITIET = r["THONGTINCHITIET"].ToString(); //string tEN_LOAICAYXANH = r["TEN_LOAICAYXANH"].ToString(); //float bANKINHTANLA = float.Parse(r["BANKINHTANLA"].ToString()); //bool iS_BOVIEN = bool.Parse(r["IS_BOVIEN"].ToString());// Xu ly du lieu bool //bool iS_PLANT = bool.Parse(r["IS_PLANT"].ToString());// Xu ly du lieu bool //bool iS_ONGNUOC = bool.Parse(r["IS_ONGNUOC"].ToString());// Xu ly du lieu bool //string cAYXANH = r["CAYXANH"].ToString(); //bool iS_CAOHONVIAHE = bool.Parse(r["IS_CAOHONVIAHE"].ToString());// Xu ly du lieu bool //bool iS_ONGCONG = bool.Parse(r["IS_ONGCONG"].ToString());// Xu ly du lieu bool //long iD_HINHDANGHO = long.Parse(r["ID_HINHDANGHO"].ToString()); //long cOUNT = long.Parse(r["COUNT"].ToString()); //string tENCONGTRINHGANNHAT = r["TENCONGTRINHGANNHAT"].ToString(); //long iD_TINHTRANGSINHTRUONG = long.Parse(r["ID_TINHTRANGSINHTRUONG"].ToString()); //double lONGITUDE_HOTRONGCAY = double.Parse(r["LONGITUDE_HOTRONGCAY"].ToString()); //string nAMBANGIAOCONGTRINH = r["NAMBANGIAOCONGTRINH"].ToString(); //string tEN_PHANLOAIQUYHOACH = r["TEN_PHANLOAIQUYHOACH"].ToString(); //string iMAGE = r["IMAGE"].ToString(); //float dUONGKINHGOC = float.Parse(r["DUONGKINHGOC"].ToString()); //long iD_LOAICAYXANH = long.Parse(r["ID_LOAICAYXANH"].ToString()); //string tEN_CHUNGLOAICAYXANH = r["TEN_CHUNGLOAICAYXANH"].ToString(); //float dIENTICHTANLA = float.Parse(r["DIENTICHTANLA"].ToString()); //long iD_CAYXANH = long.Parse(r["ID_CAYXANH"].ToString()); //long cHIEUCAOVUTNGON = long.Parse(r["CHIEUCAOVUTNGON"].ToString()); //string gHICHU = r["GHICHU"].ToString(); //long iD_HOTRONGCAY = long.Parse(r["ID_HOTRONGCAY"].ToString()); //string dUONGPHO = r["DUONGPHO"].ToString(); //long iD_KHUVUCCAYXANH = long.Parse(r["ID_KHUVUCCAYXANH"].ToString()); //string kHUVUCCAYXANH = r["KHUVUCCAYXANH"].ToString(); //string nAMTRONGCAY = r["NAMTRONGCAY"].ToString(); //string dONVIHANHCHINH = r["DONVIHANHCHINH"].ToString(); //long sOLANCAPNHAT = long.Parse(r["SOLANCAPNHAT"].ToString()); //long iD_NHOMNGUYCO = long.Parse(r["ID_NHOMNGUYCO"].ToString()); //bool iS_DAYDIEN = bool.Parse(r["IS_DAYDIEN"].ToString());// Xu ly du lieu bool //string nGAYTAO = r["NGAYTAO"].ToString(); //long iD_LOAIBOVIEN = long.Parse(r["ID_LOAIBOVIEN"].ToString()); //string sONHA = r["SONHA"].ToString(); //long kICHTHUOCHO = long.Parse(r["KICHTHUOCHO"].ToString()); //long dIENTICHHO = long.Parse(r["DIENTICHHO"].ToString()); //bool iS_BORAO = bool.Parse(r["IS_BORAO"].ToString());// Xu ly du lieu bool //string tRANGTHAIBOVIEN = r["TRANGTHAIBOVIEN"].ToString(); //double lATITUDE_HOTRONGCAY = float.Parse(r["LATITUDE_HOTRONGCAY"].ToString()); //long eNDX = long.Parse(r["ENDX"].ToString()); //long sTARTX = long.Parse(r["STARTX"].ToString()); //long eNDY = long.Parse(r["ENDY"].ToString()); //long sTARTY = long.Parse(r["STARTY"].ToString()); //string lOAIBOVIEN = r["LOAIBOVIEN"].ToString(); //float kHOANGCACHHOVIA = float.Parse(r["KHOANGCACHHOVIA"].ToString()); //string mA_CAYXANH = r["MA_CAYXANH"].ToString(); //long iD_TRANGTHAIBOVIEN = long.Parse(r["ID_TRANGTHAIBOVIEN"].ToString()); //string tEN_NHOMNGUYCO = r["TEN_NHOMNGUYCO"].ToString(); //string hINHDANGHO = r["HINHDANGHO"].ToString(); //bool iS_CAPNGAM = bool.Parse(r["IS_CAPNGAM"].ToString());// Xu ly du lieu bool //long iD_NHOMCHUNGLOAI = long.Parse(r["ID_NHOMCHUNGLOAI"].ToString()); //string mA_HOTRONGCAY = r["MA_HOTRONGCAY"].ToString(); //long iD_PHANLOAIQUYHOACH = long.Parse(r["ID_PHANLOAIQUYHOACH"].ToString()); //string tEN_TINHTRANGSINHTRUONG = r["TEN_TINHTRANGSINHTRUONG"].ToString(); #endregion //listItem.Add(new TreeItem(iD_DONVIHANHCHINH, tHONGTINCHITIET, tEN_LOAICAYXANH, bANKINHTANLA, iS_BOVIEN, iS_PLANT, iS_ONGNUOC, cAYXANH, iS_CAOHONVIAHE, iS_ONGCONG, iD_HINHDANGHO, cOUNT, tENCONGTRINHGANNHAT, iD_TINHTRANGSINHTRUONG, lONGITUDE_HOTRONGCAY, nAMBANGIAOCONGTRINH, tEN_PHANLOAIQUYHOACH, iMAGE, dUONGKINHGOC, iD_LOAICAYXANH, tEN_CHUNGLOAICAYXANH, dIENTICHTANLA, iD_CAYXANH, cHIEUCAOVUTNGON, gHICHU, iD_HOTRONGCAY, dUONGPHO, iD_KHUVUCCAYXANH, kHUVUCCAYXANH, nAMTRONGCAY, dONVIHANHCHINH, sOLANCAPNHAT, iD_NHOMNGUYCO, iS_DAYDIEN, nGAYTAO, iD_LOAIBOVIEN, sONHA, kICHTHUOCHO, dIENTICHHO, iS_BORAO, tRANGTHAIBOVIEN, lATITUDE_HOTRONGCAY, eNDX, sTARTX, eNDY, sTARTY, lOAIBOVIEN, kHOANGCACHHOVIA, mA_CAYXANH, iD_TRANGTHAIBOVIEN, tEN_NHOMNGUYCO, hINHDANGHO, iS_CAPNGAM, iD_NHOMCHUNGLOAI, mA_HOTRONGCAY, iD_PHANLOAIQUYHOACH, tEN_TINHTRANGSINHTRUONG)); } r.Close(); connectSQL.connect.Close(); return(listItem); }
/// <summary> /// GET tất cả Item xung quanh hình tròn bán kính và tâm nhập vào (tọa độ blwgs84) /// </summary> /// <param name="info"></param> /// <param name="databaseName"></param> /// <param name="tableName"></param> /// <param name="point1"></param> /// <param name="banKinh"></param> /// <returns></returns> public List <TreeLite> getHinhTron(LoginData loginData, string databaseName, string tableName, PointItem point1, double banKinh) { connectSQL.Connect(loginData, databaseName); //if (databaseBO.checkRepeatFunc(info) == 0) //{ // databaseBO.createFunc(info); //} List <TreeLite> listItem = new List <TreeLite>(); string sqlQuery = "SELECT * FROM " + databaseName + ".dbo." + tableName; SqlCommand cmd = new SqlCommand(sqlQuery, connectSQL.connect); SqlDataReader r = cmd.ExecuteReader(); while (r.Read()) { #region GET Data //long iD_DONVIHANHCHINH = long.Parse(r["ID_DONVIHANHCHINH"].ToString()); //string tHONGTINCHITIET = r["THONGTINCHITIET"].ToString(); //string tEN_LOAICAYXANH = r["TEN_LOAICAYXANH"].ToString(); //float bANKINHTANLA = float.Parse(r["BANKINHTANLA"].ToString()); //bool iS_BOVIEN = bool.Parse(r["IS_BOVIEN"].ToString());// Xu ly du lieu bool //bool iS_PLANT = bool.Parse(r["IS_PLANT"].ToString());// Xu ly du lieu bool //bool iS_ONGNUOC = bool.Parse(r["IS_ONGNUOC"].ToString());// Xu ly du lieu bool //string cAYXANH = r["CAYXANH"].ToString(); //bool iS_CAOHONVIAHE = bool.Parse(r["IS_CAOHONVIAHE"].ToString());// Xu ly du lieu bool //bool iS_ONGCONG = bool.Parse(r["IS_ONGCONG"].ToString());// Xu ly du lieu bool //long iD_HINHDANGHO = long.Parse(r["ID_HINHDANGHO"].ToString()); //long cOUNT = long.Parse(r["COUNT"].ToString()); //string tENCONGTRINHGANNHAT = r["TENCONGTRINHGANNHAT"].ToString(); //long iD_TINHTRANGSINHTRUONG = long.Parse(r["ID_TINHTRANGSINHTRUONG"].ToString()); //float lONGITUDE_HOTRONGCAY = float.Parse(r["LONGITUDE_HOTRONGCAY"].ToString()); //string nAMBANGIAOCONGTRINH = r["NAMBANGIAOCONGTRINH"].ToString(); //string tEN_PHANLOAIQUYHOACH = r["TEN_PHANLOAIQUYHOACH"].ToString(); //string iMAGE = r["IMAGE"].ToString(); //float dUONGKINHGOC = float.Parse(r["DUONGKINHGOC"].ToString()); //long iD_LOAICAYXANH = long.Parse(r["ID_LOAICAYXANH"].ToString()); //string tEN_CHUNGLOAICAYXANH = r["TEN_CHUNGLOAICAYXANH"].ToString(); //float dIENTICHTANLA = float.Parse(r["DIENTICHTANLA"].ToString()); //long iD_CAYXANH = long.Parse(r["ID_CAYXANH"].ToString()); //long cHIEUCAOVUTNGON = long.Parse(r["CHIEUCAOVUTNGON"].ToString()); //string gHICHU = r["GHICHU"].ToString(); //long iD_HOTRONGCAY = long.Parse(r["ID_HOTRONGCAY"].ToString()); //string dUONGPHO = r["DUONGPHO"].ToString(); //long iD_KHUVUCCAYXANH = long.Parse(r["ID_KHUVUCCAYXANH"].ToString()); //string kHUVUCCAYXANH = r["KHUVUCCAYXANH"].ToString(); //string nAMTRONGCAY = r["NAMTRONGCAY"].ToString(); //string dONVIHANHCHINH = r["DONVIHANHCHINH"].ToString(); //long sOLANCAPNHAT = long.Parse(r["SOLANCAPNHAT"].ToString()); //long iD_NHOMNGUYCO = long.Parse(r["ID_NHOMNGUYCO"].ToString()); //bool iS_DAYDIEN = bool.Parse(r["IS_DAYDIEN"].ToString());// Xu ly du lieu bool //string nGAYTAO = r["NGAYTAO"].ToString(); //long iD_LOAIBOVIEN = long.Parse(r["ID_LOAIBOVIEN"].ToString()); //string sONHA = r["SONHA"].ToString(); //long kICHTHUOCHO = long.Parse(r["KICHTHUOCHO"].ToString()); //long dIENTICHHO = long.Parse(r["DIENTICHHO"].ToString()); //bool iS_BORAO = bool.Parse(r["IS_BORAO"].ToString());// Xu ly du lieu bool //string tRANGTHAIBOVIEN = r["TRANGTHAIBOVIEN"].ToString(); //float lATITUDE_HOTRONGCAY = float.Parse(r["LATITUDE_HOTRONGCAY"].ToString()); //long eNDX = long.Parse(r["ENDX"].ToString()); //long sTARTX = long.Parse(r["STARTX"].ToString()); //long eNDY = long.Parse(r["ENDY"].ToString()); //long sTARTY = long.Parse(r["STARTY"].ToString()); //string lOAIBOVIEN = r["LOAIBOVIEN"].ToString(); //float kHOANGCACHHOVIA = float.Parse(r["KHOANGCACHHOVIA"].ToString()); //string mA_CAYXANH = r["MA_CAYXANH"].ToString(); //long iD_TRANGTHAIBOVIEN = long.Parse(r["ID_TRANGTHAIBOVIEN"].ToString()); //string tEN_NHOMNGUYCO = r["TEN_NHOMNGUYCO"].ToString(); //string hINHDANGHO = r["HINHDANGHO"].ToString(); //bool iS_CAPNGAM = bool.Parse(r["IS_CAPNGAM"].ToString());// Xu ly du lieu bool //long iD_NHOMCHUNGLOAI = long.Parse(r["ID_NHOMCHUNGLOAI"].ToString()); //string mA_HOTRONGCAY = r["MA_HOTRONGCAY"].ToString(); //long iD_PHANLOAIQUYHOACH = long.Parse(r["ID_PHANLOAIQUYHOACH"].ToString()); //string tEN_TINHTRANGSINHTRUONG = r["TEN_TINHTRANGSINHTRUONG"].ToString(); #endregion string cayXanh = r["CAYXANH"].ToString(); double lng = double.Parse(r["LONGITUDE_HOTRONGCAY"].ToString()); double lat = double.Parse(r["LATITUDE_HOTRONGCAY"].ToString()); PointItem point2 = new PointItem(lat, lng); if (pointFunc.tinhKhoangCachHaiDiem(point1, point2) <= banKinh) { listItem.Add(new TreeLite(cayXanh, lat, lng)); } } r.Close(); connectSQL.connect.Close(); return(listItem); }
public int insertDataToTable(LoginData loginData, string databaseName, string tableName, List <TreeItem> listTree) { connectSQL.Connect(loginData, databaseName); int sumRow = 0; int i; string sqlQuery = ""; SqlCommand cmd = null; foreach (var item in listTree) { sqlQuery = "INSERT INTO " + tableName + "( ID_DONVIHANHCHINH,THONGTINCHITIET,TEN_LOAICAYXANH,BANKINHTANLA,IS_BOVIEN,IS_PLANT,IS_ONGNUOC,CAYXANH,IS_CAOHONVIAHE,IS_ONGCONG,ID_HINHDANGHO,COUNT,TENCONGTRINHGANNHAT,ID_TINHTRANGSINHTRUONG,LONGITUDE_HOTRONGCAY,NAMBANGIAOCONGTRINH,TEN_PHANLOAIQUYHOACH,IMAGE,DUONGKINHGOC,ID_LOAICAYXANH,TEN_CHUNGLOAICAYXANH,DIENTICHTANLA,ID_CAYXANH,CHIEUCAOVUTNGON,GHICHU,ID_HOTRONGCAY,DUONGPHO,ID_KHUVUCCAYXANH,KHUVUCCAYXANH,NAMTRONGCAY,DONVIHANHCHINH,SOLANCAPNHAT,ID_NHOMNGUYCO,IS_DAYDIEN,NGAYTAO,ID_LOAIBOVIEN,SONHA,KICHTHUOCHO,DIENTICHHO,IS_BORAO,TRANGTHAIBOVIEN,LATITUDE_HOTRONGCAY,ENDX,STARTX,ENDY,STARTY,LOAIBOVIEN,KHOANGCACHHOVIA,MA_CAYXANH,ID_TRANGTHAIBOVIEN,TEN_NHOMNGUYCO,HINHDANGHO,IS_CAPNGAM,ID_NHOMCHUNGLOAI,MA_HOTRONGCAY,ID_PHANLOAIQUYHOACH,TEN_TINHTRANGSINHTRUONG )" + " VALUES " + "( @iD_DONVIHANHCHINH,@tHONGTINCHITIET,@tEN_LOAICAYXANH,@bANKINHTANLA,@iS_BOVIEN,@iS_PLANT,@iS_ONGNUOC,@cAYXANH,@iS_CAOHONVIAHE,@iS_ONGCONG,@iD_HINHDANGHO,@cOUNT,@tENCONGTRINHGANNHAT,@iD_TINHTRANGSINHTRUONG,@lONGITUDE_HOTRONGCAY,@nAMBANGIAOCONGTRINH,@tEN_PHANLOAIQUYHOACH,@iMAGE,@dUONGKINHGOC,@iD_LOAICAYXANH,@tEN_CHUNGLOAICAYXANH,@dIENTICHTANLA,@iD_CAYXANH,@cHIEUCAOVUTNGON,@gHICHU,@iD_HOTRONGCAY,@dUONGPHO,@iD_KHUVUCCAYXANH,@kHUVUCCAYXANH,@nAMTRONGCAY,@dONVIHANHCHINH,@sOLANCAPNHAT,@iD_NHOMNGUYCO,@iS_DAYDIEN,@nGAYTAO,@iD_LOAIBOVIEN,@sONHA,@kICHTHUOCHO,@dIENTICHHO,@iS_BORAO,@tRANGTHAIBOVIEN,@lATITUDE_HOTRONGCAY,@eNDX,@sTARTX,@eNDY,@sTARTY,@lOAIBOVIEN,@kHOANGCACHHOVIA,@mA_CAYXANH,@iD_TRANGTHAIBOVIEN,@tEN_NHOMNGUYCO,@hINHDANGHO,@iS_CAPNGAM,@iD_NHOMCHUNGLOAI,@mA_HOTRONGCAY,@iD_PHANLOAIQUYHOACH,@tEN_TINHTRANGSINHTRUONG)"; cmd = new SqlCommand(sqlQuery, connectSQL.connect); PointItem point = pointFunc.vn2000_2_blwgs84(item.LATITUDE_HOTRONGCAY, item.LONGITUDE_HOTRONGCAY); #region Add Parameters cmd.Parameters.Add(new SqlParameter("iD_DONVIHANHCHINH", item.ID_DONVIHANHCHINH)); cmd.Parameters.Add(new SqlParameter("tHONGTINCHITIET", item.THONGTINCHITIET)); cmd.Parameters.Add(new SqlParameter("tEN_LOAICAYXANH", item.TEN_LOAICAYXANH)); cmd.Parameters.Add(new SqlParameter("bANKINHTANLA", item.BANKINHTANLA)); cmd.Parameters.Add(new SqlParameter("iS_BOVIEN", item.IS_BOVIEN)); cmd.Parameters.Add(new SqlParameter("iS_PLANT", item.IS_PLANT)); cmd.Parameters.Add(new SqlParameter("iS_ONGNUOC", item.IS_ONGNUOC)); cmd.Parameters.Add(new SqlParameter("cAYXANH", item.CAYXANH)); cmd.Parameters.Add(new SqlParameter("iS_CAOHONVIAHE", item.IS_CAOHONVIAHE)); cmd.Parameters.Add(new SqlParameter("iS_ONGCONG", item.IS_ONGCONG)); cmd.Parameters.Add(new SqlParameter("iD_HINHDANGHO", item.ID_HINHDANGHO)); cmd.Parameters.Add(new SqlParameter("cOUNT", item.COUNT)); cmd.Parameters.Add(new SqlParameter("tENCONGTRINHGANNHAT", item.TENCONGTRINHGANNHAT)); cmd.Parameters.Add(new SqlParameter("iD_TINHTRANGSINHTRUONG", item.ID_TINHTRANGSINHTRUONG)); cmd.Parameters.Add(new SqlParameter("lONGITUDE_HOTRONGCAY", point.Lng)); cmd.Parameters.Add(new SqlParameter("nAMBANGIAOCONGTRINH", item.NAMBANGIAOCONGTRINH)); cmd.Parameters.Add(new SqlParameter("tEN_PHANLOAIQUYHOACH", item.TEN_PHANLOAIQUYHOACH)); cmd.Parameters.Add(new SqlParameter("iMAGE", item.IMAGE)); cmd.Parameters.Add(new SqlParameter("dUONGKINHGOC", item.DUONGKINHGOC)); cmd.Parameters.Add(new SqlParameter("iD_LOAICAYXANH", item.ID_LOAICAYXANH)); cmd.Parameters.Add(new SqlParameter("tEN_CHUNGLOAICAYXANH", item.TEN_CHUNGLOAICAYXANH)); cmd.Parameters.Add(new SqlParameter("dIENTICHTANLA", item.DIENTICHTANLA)); cmd.Parameters.Add(new SqlParameter("iD_CAYXANH", item.ID_CAYXANH)); cmd.Parameters.Add(new SqlParameter("cHIEUCAOVUTNGON", item.CHIEUCAOVUTNGON)); cmd.Parameters.Add(new SqlParameter("gHICHU", item.GHICHU)); cmd.Parameters.Add(new SqlParameter("iD_HOTRONGCAY", item.ID_HOTRONGCAY)); cmd.Parameters.Add(new SqlParameter("dUONGPHO", item.DUONGPHO)); cmd.Parameters.Add(new SqlParameter("iD_KHUVUCCAYXANH", item.ID_KHUVUCCAYXANH)); cmd.Parameters.Add(new SqlParameter("kHUVUCCAYXANH", item.KHUVUCCAYXANH)); cmd.Parameters.Add(new SqlParameter("nAMTRONGCAY", item.NAMTRONGCAY)); cmd.Parameters.Add(new SqlParameter("dONVIHANHCHINH", item.DONVIHANHCHINH)); cmd.Parameters.Add(new SqlParameter("sOLANCAPNHAT", item.SOLANCAPNHAT)); cmd.Parameters.Add(new SqlParameter("iD_NHOMNGUYCO", item.ID_NHOMNGUYCO)); cmd.Parameters.Add(new SqlParameter("iS_DAYDIEN", item.IS_DAYDIEN)); cmd.Parameters.Add(new SqlParameter("nGAYTAO", item.NGAYTAO)); cmd.Parameters.Add(new SqlParameter("iD_LOAIBOVIEN", item.ID_LOAIBOVIEN)); cmd.Parameters.Add(new SqlParameter("sONHA", item.SONHA)); cmd.Parameters.Add(new SqlParameter("kICHTHUOCHO", item.KICHTHUOCHO)); cmd.Parameters.Add(new SqlParameter("dIENTICHHO", item.DIENTICHHO)); cmd.Parameters.Add(new SqlParameter("iS_BORAO", item.IS_BORAO)); cmd.Parameters.Add(new SqlParameter("tRANGTHAIBOVIEN", item.TRANGTHAIBOVIEN)); cmd.Parameters.Add(new SqlParameter("lATITUDE_HOTRONGCAY", point.Lat)); cmd.Parameters.Add(new SqlParameter("eNDX", item.ENDX)); cmd.Parameters.Add(new SqlParameter("sTARTX", item.STARTX)); cmd.Parameters.Add(new SqlParameter("eNDY", item.ENDY)); cmd.Parameters.Add(new SqlParameter("sTARTY", item.STARTY)); cmd.Parameters.Add(new SqlParameter("lOAIBOVIEN", item.LOAIBOVIEN)); cmd.Parameters.Add(new SqlParameter("kHOANGCACHHOVIA", item.KHOANGCACHHOVIA)); cmd.Parameters.Add(new SqlParameter("mA_CAYXANH", item.MA_CAYXANH)); cmd.Parameters.Add(new SqlParameter("iD_TRANGTHAIBOVIEN", item.ID_TRANGTHAIBOVIEN)); cmd.Parameters.Add(new SqlParameter("tEN_NHOMNGUYCO", item.TEN_NHOMNGUYCO)); cmd.Parameters.Add(new SqlParameter("hINHDANGHO", item.HINHDANGHO)); cmd.Parameters.Add(new SqlParameter("iS_CAPNGAM", item.IS_CAPNGAM)); cmd.Parameters.Add(new SqlParameter("iD_NHOMCHUNGLOAI", item.ID_NHOMCHUNGLOAI)); cmd.Parameters.Add(new SqlParameter("mA_HOTRONGCAY", item.MA_HOTRONGCAY)); cmd.Parameters.Add(new SqlParameter("iD_PHANLOAIQUYHOACH", item.ID_PHANLOAIQUYHOACH)); cmd.Parameters.Add(new SqlParameter("tEN_TINHTRANGSINHTRUONG", item.TEN_TINHTRANGSINHTRUONG)); #endregion i = cmd.ExecuteNonQuery(); sumRow += i; } return(sumRow); }