Esempio n. 1
0
 public static string getQueryUpdateCell(Cell cell)
 {
     return string.Format("UPDATE {0} SET {1}='{2}', {3}='{4}',{5}='{6}',{7}='{8}',{9}='{10}',{11}='{12}',{13}='{14}',{15}='{16}',{17}='{18}',{19}='{20}' WHERE {21}='{22}'",
          ID_TABLE_CELL,
          ID_MACROCELL_CELL,cell.Macrocell.Id,
          ID_LATITUDE_CELL, cell.Latitude,
          ID_LONGITUDE_CELL,cell.Longitude,
          ID_SURFACE_CELL,cell.Surface,
          ID_VOLUMEN_CELL,cell.Volumen,
          ID_BUILDING_SHADE_COEFICIENT_CELL,cell.BuildingShadeCoefficient,
          ID_WALL_INSULATION_THICKNESS_CELL,cell.WallInsulationThickness,
          ID_DESCRIPTION_CELL,cell.Description,
          ID_UPDATETIME_DEVICE,cell.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_CELL),
          ID_UPDATEUSER_DEVICE,cell.UpdateUser,
          ID_CELLID_CELL,cell.Id
         );
 }
Esempio n. 2
0
 public static string getQuerySaveCell(Cell cell)
 {
     return string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}')", ID_TABLE_CELL,
         cell.Id,
         cell.Macrocell.Id,
         cell.Latitude,
         cell.Longitude,
         cell.Surface,
         cell.Volumen,
         cell.BuildingShadeCoefficient,
         cell.WallInsulationThickness,
         cell.Description,
         cell.LocalInsertTime.ToString(DATETIMEFORMATINSERT_CELL),
         cell.InsertUser,
         cell.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_CELL),
         cell.UpdateUser);
 }
Esempio n. 3
0
 internal void UpdateCell(Cell cell)
 {
     string query = CellQuery.getQueryUpdateCell(cell);
     CellQuery.ParseDataSetToCell(_provider.queryExecute(query,UPDATE_TYPE));
 }
Esempio n. 4
0
 internal void SaveCell(Cell cell)
 {
     string query = CellQuery.getQuerySaveCell(cell);
     CellQuery.ParseDataSetToCell(_provider.queryExecute(query,INSERT_TYPE));
 }
Esempio n. 5
0
 public void Update(Cell cell)
 {
     _repositoryHelper.UpdateCell(cell);
 }
Esempio n. 6
0
 public void Save(Cell cell)
 {
     _repositoryHelper.SaveCell(cell);
 }
Esempio n. 7
0
 public bool Exists(Cell cell)
 {
     return Get(cell.Id) != null;
 }
Esempio n. 8
0
        public static IList<Cell> ParseDataSetToCell(DataTable dataTable)
        {
            IList<Cell> cellList = new List<Cell>();
            foreach (DataRow row in dataTable.Rows)
            {
                Cell cell = new Cell()
                {
                    Id = row[POSITION_CELLID_CELL].ToString(),
                    Macrocell=new MacroCell(row[POSITION_MACROCELL_CELL].ToString()),
                    Latitude = Double.Parse(row[POSITION_LATITUDE_CELL].ToString()),
                    Longitude = Double.Parse(row[POSITION_LONGITUDE_CELL].ToString()),
                    Surface=Double.Parse(row[POSITION_SURFACE_CELL].ToString()),
                    Volumen = Double.Parse(row[POSITION_VOLUMEN_CELL].ToString()),
                    BuildingShadeCoefficient = int.Parse(row[POSITION_BUILDING_SHADE_COEFICIENT_CELL].ToString()),
                    WallInsulationThickness = int.Parse(row[POSITION_WALL_INSULATION_THICKNESS_CELL].ToString()),
                    Description = row[POSITION_DESCRIPTION_CELL].ToString(),
                    LocalInsertTime = getDateTime(row[POSITION_INSERTTIME_MACROCELL].ToString(), DATETIMEFORMATINSERT_CELL),
                    InsertUser = row[POSITION_INSERTUSER_MACROCELL].ToString(),
                    UpdateLocalDateTime = getDateTime(row[POSITION_UPDATETIME_MACROCELL].ToString(), DATETIMEFORMATINSERT_CELL),
                    UpdateUser = row[POSITION_UPDATEUSER_MACROCELL].ToString()
                };
                cellList.Add(cell);
            }

            return cellList;
        }