public void AddCountries(DataRow row) { try { DataTable table = row.Table; this.IntercoCountries = new List <IIntercoCountry>(); for (int i = TimingAndInterco.FirstCountryColumn; i < table.Columns.Count; i++) { if (table.Columns[i].ColumnName == "IsChanged") { continue; } int countryId = int.Parse(table.Columns[i].ColumnName); IIntercoCountry country = new IntercoCountry(this.CurrentConnectionManager); country.IdProject = this.IdProject; country.IdPhase = this.IdPhase; country.IdWP = this.IdWP; country.IdCountry = countryId; country.Percent = (row[i] == DBNull.Value) ? ApplicationConstants.DECIMAL_NULL_VALUE : (decimal)row[i]; country.WPCode = this.WPCode; if ((bool)row["IsChanged"]) { ((IntercoCountry)country).SetModified(); } this.IntercoCountries.Add(country); } } catch (Exception ex) { throw new IndException(ex); } }
internal static void DeleteCountryLayout(int projectId, object connectionManager) { IntercoCountry country = new IntercoCountry(connectionManager); country.IdProject = projectId; country.GetEntity().ExecuteCustomProcedure("DeleteCountryLayout", country); }
/// <summary> /// Creates the country layout /// </summary> /// <param name="idProject">The project for which the layout is created</param> /// <param name="countriesLayout">The list of objects that represent the layout</param> public static void CreateCountryLayout(int idProject, List <IntercoCountry> countriesLayout, object connectionManager) { try { //First delete the country layout for this layer IntercoCountry.DeleteCountryLayout(idProject, connectionManager); //Recreate the layout IntercoCountry.CreateCountryLayout(countriesLayout); } catch (Exception ex) { throw new IndException(ex); } }