Esempio n. 1
0
 public static string getQuerySaveMacroCell(MacroCell macrocell)
 {
     return string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", ID_TABLE_MACROCELL,
         macrocell.Id,
         macrocell.Description,
         macrocell.Region,
         macrocell.Currency.Id,
         macrocell.LocalInsertTime.ToString(DATETIMEFORMATINSERT_MACROCELL),
         macrocell.InsertUser,
         macrocell.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_MACROCELL),
         macrocell.UpdateUser);
 }
Esempio n. 2
0
 public static string getQueryUpdateMacroCell(MacroCell macrocell)
 {
     return string.Format("UPDATE {0} SET {1}='{2}', {3}='{4}',{5}='{6}',{7}='{8}',{9}='{10}' WHERE {11}='{12}'",
          ID_TABLE_MACROCELL,
          ID_DESCRIPTION_MACROCELL, macrocell.Description,
          ID_REGION_MACROCELL,macrocell.Region,
          ID_CURRENCY_MACROCELL,macrocell.Currency.Id,
          ID_UPDATETIME_DEVICE, macrocell.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_MACROCELL),
          ID_UPDATEUSER_DEVICE,macrocell.UpdateUser,
          ID_MACROCELID_MACROCELL,macrocell.Id
         );
 }
Esempio n. 3
0
        public static IList<MacroCell> ParseDataSetToMacroCell(DataTable dataTable)
        {
            IList<MacroCell> macroCellList = new List<MacroCell>();
            foreach (DataRow row in dataTable.Rows)
            {
                MacroCell macroCell = new MacroCell()
                {
                    Id = row[POSITION_MACROCELLID_MACROCELL].ToString(),
                    Description = row[POSITION_DESCRIPTION_MACROCELL].ToString(),
                    Region = row[POSITION_REGION_MACROCELL].ToString(),
                    Currency=new Currency(row[POSITION_CURRENCY_MACROCELL].ToString()),
                    LocalInsertTime = getDateTime(row[POSITION_INSERTTIME_MACROCELL].ToString(), DATETIMEFORMATINSERT_MACROCELL),
                    InsertUser = row[POSITION_INSERTUSER_MACROCELL].ToString(),
                    UpdateLocalDateTime = getDateTime(row[POSITION_UPDATETIME_MACROCELL].ToString(), DATETIMEFORMATINSERT_MACROCELL),
                    UpdateUser = row[POSITION_UPDATEUSER_MACROCELL].ToString()
                };
                macroCellList.Add(macroCell);
            }

            return macroCellList;
        }
Esempio n. 4
0
 public void Update(MacroCell macrocell)
 {
     _repositoryHelper.UpdateMacroCell(macrocell);
 }
Esempio n. 5
0
 public void Save(MacroCell macrocell)
 {
     _repositoryHelper.SaveMacroCell(macrocell);
 }
Esempio n. 6
0
 public bool Exists(MacroCell macrocell)
 {
     return Get(macrocell.Id) != null;
 }
Esempio n. 7
0
 internal void UpdateMacroCell(MacroCell macrocell)
 {
     string query = MacroCellQuery.getQueryUpdateMacroCell(macrocell);
     MacroCellQuery.ParseDataSetToMacroCell(_provider.queryExecute(query,UPDATE_TYPE));
 }
Esempio n. 8
0
 internal void SaveMacroCell(MacroCell macrocell)
 {
     string query = MacroCellQuery.getQuerySaveMacroCell(macrocell);
     MacroCellQuery.ParseDataSetToMacroCell(_provider.queryExecute(query,INSERT_TYPE));
 }