static public bool Delete(EGH01DB.IDBContext dbcontext, CadastreType land_type) { bool rc = false; using (SqlCommand cmd = new SqlCommand("EGH.DeleteLandRegistryType", dbcontext.connection)) { cmd.CommandType = CommandType.StoredProcedure; { SqlParameter parm = new SqlParameter("@КодНазначенияЗемель", SqlDbType.Int); parm.Value = land_type.type_code; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@exitrc", SqlDbType.Int); parm.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(parm); } try { cmd.ExecuteNonQuery(); rc = (int)cmd.Parameters["@exitrc"].Value > 0; } catch (Exception e) { rc = false; }; } return(rc); }
static public bool Create(EGH01DB.IDBContext dbcontext, CadastreType land_type) { bool rc = false; using (SqlCommand cmd = new SqlCommand("EGH.CreateLandRegistryType", dbcontext.connection)) { cmd.CommandType = CommandType.StoredProcedure; { SqlParameter parm = new SqlParameter("@КодНазначенияЗемель", SqlDbType.Int); int new_land_type_code = 0; if (GetNextCode(dbcontext, out new_land_type_code)) { land_type.type_code = new_land_type_code; } parm.Value = land_type.type_code; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@НаименованиеНазначенияЗемель", SqlDbType.NVarChar); parm.Value = land_type.name; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@ПДК", SqlDbType.Real); parm.Value = land_type.pdk_coef; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@ПДКводы", SqlDbType.Real); parm.Value = land_type.water_pdk_coef; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@НормДокументЗемля", SqlDbType.NVarChar); parm.Value = land_type.ground_doc_name; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@НормДокументВода", SqlDbType.NVarChar); parm.Value = land_type.water_doc_name; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@exitrc", SqlDbType.Int); parm.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(parm); } try { cmd.ExecuteNonQuery(); rc = (int)cmd.Parameters["@exitrc"].Value == land_type.type_code; } catch (Exception e) { rc = false; }; } return(rc); }
public WaterPollutionCategories(int code, String name, float min, float max, CadastreType cadastre_type) { this.code = code; this.name = name; this.min = min; this.max = max; this.cadastretype = cadastre_type; }
static public bool GetByExcess_Cadastre(EGH01DB.IDBContext dbcontext, float excess, int cadatsre_type_code, out WaterPollutionCategories waterpollutioncategories) { bool rc = false; waterpollutioncategories = WaterPollutionCategories.defaulttype; using (SqlCommand cmd = new SqlCommand("EGH.GetWaterPollutionCategoriesByVolume_Cadastre", dbcontext.connection)) { cmd.CommandType = CommandType.StoredProcedure; { SqlParameter parm = new SqlParameter("@Объем", SqlDbType.Float); parm.Value = excess; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КодНазначенияЗемель", SqlDbType.Int); parm.Value = cadatsre_type_code; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@exitrc", SqlDbType.Int); parm.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(parm); } try { cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { int code = (int)reader["КодКатегорииЗагрязненияГВ"]; string name = (string)reader["НаименованиеКатегорииЗагрязненияГВ"]; float min = (float)reader["МинДиапазон"]; float max = (float)reader["МаксДиапазон"]; int cadastre_type_code = (int)reader["КодНазначенияЗемель"]; string cadastre_type_name = (string)reader["НаименованиеНазначенияЗемель"]; float pdk_coef = (float)reader["ПДК"]; float water_pdk_coef = (float)reader["ПДКводы"]; string ground_doc_name = (string)reader["НормДокументЗемля"]; string water_doc_name = (string)reader["НормДокументВода"]; CadastreType cadastre_type = new CadastreType(cadastre_type_code, cadastre_type_name, pdk_coef, water_pdk_coef, ground_doc_name, water_doc_name); if (rc = (int)cmd.Parameters["@exitrc"].Value > 0) { waterpollutioncategories = new WaterPollutionCategories(code, name, min, max, cadastre_type); } } reader.Close(); } catch (Exception e) { rc = false; }; } return(rc); }
public ActionResult CadastreTypeUpdate(CadastreTypeView cd) { CEQContext db = null; ViewBag.EGHLayout = "CEQ"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new CEQContext(this); view = View("CadastreType", db); if (menuitem.Equals("CadastreType.Update.Update")) { int id = cd.type_code; String name = cd.name; float pdk_coef = cd.pdk_coef; String strpdk_coef = this.HttpContext.Request.Params["pdk_coef"] ?? "Empty";; if (!Helper.FloatTryParse(strpdk_coef, out pdk_coef)) { pdk_coef = 0.0f; } float water_pdk_coef = cd.water_pdk_coef; String strwater_pdk_coef = this.HttpContext.Request.Params["water_pdk_coef"] ?? "Empty";; if (!Helper.FloatTryParse(strwater_pdk_coef, out water_pdk_coef)) { water_pdk_coef = 0.0f; } String water_doc_coef = cd.water_doc_name; String pdk_doc_coef = cd.ground_doc_name; EGH01DB.Types.CadastreType cadastre_type = new EGH01DB.Types.CadastreType(id, name, pdk_coef, water_pdk_coef, pdk_doc_coef, water_doc_coef); if (EGH01DB.Types.CadastreType.Update(db, cadastre_type)) { view = View("CadastreType", db); } } else if (menuitem.Equals("CadastreType.Update.Cancel")) { view = View("CadastreType", db); } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
static public bool GetByCode(EGH01DB.IDBContext dbcontext, int type_code, out CadastreType type) { bool rc = false; type = new CadastreType(); using (SqlCommand cmd = new SqlCommand("EGH.GetLandRegistryTypeByCode", dbcontext.connection)) { cmd.CommandType = CommandType.StoredProcedure; { SqlParameter parm = new SqlParameter("@КодНазначенияЗемель", SqlDbType.Int); parm.Value = type_code; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@exitrc", SqlDbType.Int); parm.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(parm); } try { cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { string name = (string)reader["НаименованиеНазначенияЗемель"]; float pdk_coef = (float)reader["ПДК"]; float water_pdk_coef = (float)reader["ПДКводы"]; string ground_doc_name = (string)reader["НормДокументЗемля"]; string water_doc_name = (string)reader["НормДокументВода"]; if (rc = (int)cmd.Parameters["@exitrc"].Value > 0) { type = new CadastreType(type_code, name, (float)pdk_coef, (float)water_pdk_coef, ground_doc_name, water_doc_name); } } reader.Close(); } catch (Exception e) { rc = false; }; } return(rc); }
public ActionResult CadastreTypeCreate(CadastreTypeView cd) { RGEContext db = null; ViewBag.EGHLayout = "RGE.CadastreType"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new RGEContext(); view = View("CadastreType", db); if (menuitem.Equals("CadastreType.Create.Create")) { int id = -1; if (EGH01DB.Types.CadastreType.GetNextCode(db, out id)) { String name = cd.name; EGH01DB.Types.CadastreType cadastre_type = new EGH01DB.Types.CadastreType(id, name, 0.0f, 0.0f, "ПДК", "ПДК"); // blinova if (EGH01DB.Types.CadastreType.Create(db, cadastre_type)) { view = View("CadastreType", db); } } } else if (menuitem.Equals("CadastreType.Create.Cancel")) { view = View("CadastreType", db); } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
public RehabilitationMethod(int type_code, RiskObjectType riskobjecttype, CadastreType cadastretype, PetrochemicalCategories petrochemicalcategory, EmergencyClass emergencyclass, PenetrationDepth penetrationdepth, SoilPollutionCategories soilpollutioncategories, bool waterachieved, WaterPollutionCategories waterpollutioncategories, WaterProtectionArea waterprotectionarea, SoilCleaningMethod soilcleaningmethod, WaterCleaningMethod watercleaningmethod) { this.type_code = type_code; this.riskobjecttype = riskobjecttype; this.cadastretype = cadastretype; this.petrochemicalcategory = petrochemicalcategory; this.emergencyclass = emergencyclass; this.penetrationdepth = penetrationdepth; this.soilpollutioncategories = soilpollutioncategories; this.waterachieved = waterachieved; this.waterpollutioncategories = waterpollutioncategories; this.waterprotectionarea = waterprotectionarea; this.soilcleaningmethod = soilcleaningmethod; this.watercleaningmethod = watercleaningmethod; }
public ActionResult RiskObjectCreate(EGH01.Models.EGHCAI.RiskObject rs) { CAIContext db = null; ViewBag.EGHLayout = "CAI"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new CAIContext(); view = View("RiskObject", db); if (menuitem.Equals("RiskObject.Create.Create")) { int id = -1; if (EGH01DB.Objects.RiskObject.GetNextId(db, out id)) { String ownership = "f"; int numberofrefuel = 1; int volume = 1; Boolean watertreatment = rs.watertreatment; Boolean watertreatmentcollect = rs.watertreatmentcollect; string base64 = rs.base64; Byte[] map; if (base64 == null) { map = new byte[0]; } else { map = ASCIIEncoding.ASCII.GetBytes(base64); } int groundtank = rs.groundtank; int undergroundtank = rs.undergroundtank; string strlat_s = this.HttpContext.Request.Params["lat_s"] ?? "Empty"; string strlng_s = this.HttpContext.Request.Params["lng_s"] ?? "Empty"; string strwaterdeep = this.HttpContext.Request.Params["waterdeep"] ?? "Empty"; string strheight = this.HttpContext.Request.Params["height"] ?? "Empty"; float lat_s = 0.0f; float lng_s = 0.0f; float waterdeep = 0.0f; float height = 0.0f; if (!Helper.FloatTryParse(strlat_s, out lat_s)) { lat_s = 0.0f; } if (!Helper.FloatTryParse(strlng_s, out lng_s)) { lng_s = 0.0f; } if (!Helper.FloatTryParse(strwaterdeep, out waterdeep)) { waterdeep = 0.0f; } if (!Helper.FloatTryParse(strheight, out height)) { height = 0.0f; } Coordinates coordinates = new Coordinates(rs.latitude, rs.lat_m, lat_s, rs.lngitude, rs.lng_m, lng_s); float latitude = EGH01DB.Primitives.Coordinates.dms_to_d(rs.latitude, rs.lat_m, rs.lat_s); EGH01DB.Types.GroundType ground_type = new EGH01DB.Types.GroundType(); if (EGH01DB.Types.GroundType.GetByCode(db, rs.list_groundType, out ground_type)) { Point point = new Point(coordinates, ground_type, waterdeep, height); EGH01DB.Types.RiskObjectType risk_object_type = new EGH01DB.Types.RiskObjectType(); if (EGH01DB.Types.RiskObjectType.GetByCode(db, rs.selectlist, out risk_object_type)) { EGH01DB.Types.CadastreType cadastre_type = new EGH01DB.Types.CadastreType(); if (EGH01DB.Types.CadastreType.GetByCode(db, rs.list_cadastre, out cadastre_type)) { EGH01DB.Types.District district = new EGH01DB.Types.District(); if (EGH01DB.Types.District.GetByCode(db, rs.list_district, out district)) { EGH01DB.Types.Region region = new EGH01DB.Types.Region(); if (EGH01DB.Types.Region.GetByCode(db, rs.list_region, out region)) { DateTime foundationdate = rs.foundationdate; if (foundationdate.Year == 0001) { foundationdate = new DateTime(1900, 01, 01); } DateTime reconstractiondate = rs.reconstractiondate; if (reconstractiondate.Year == 0001) { reconstractiondate = new DateTime(1900, 01, 01); } string name = rs.name; String phone = rs.phone; String fax = rs.fax; string address = rs.adress; String email = rs.email; String fueltype = rs.fax; String geodescription = rs.fax; EGH01DB.Objects.RiskObject risk_object = new EGH01DB.Objects.RiskObject(id, point, risk_object_type, cadastre_type, name, district, region, address, ownership, phone, fax, email, foundationdate, reconstractiondate, numberofrefuel, volume, watertreatment, watertreatmentcollect, map, groundtank, undergroundtank, fueltype, 0, 0.0f, 0.0f, geodescription); if (EGH01DB.Objects.RiskObject.Create(db, risk_object)) { view = View("RiskObject", db); } } } } } else if (menuitem.Equals("RiskObject.Create.Cancel")) { view = View("RiskObject", db); } } } } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
static public bool GetByParm(EGH01DB.IDBContext dbcontext, int riskobjecttypecode, int cadastretypecode, int petrochemicalcategorytypecode, int emergencyclasstypecode, int penetrationdepthtypecode, int soilpollutioncategoriestypecode, bool waterachieved, int waterpollutioncategoriestypecode, int waterprotectionareatypecode, out RehabilitationMethod rehabilitation_method) { bool rc = false; rehabilitation_method = new RehabilitationMethod(); using (SqlCommand cmd = new SqlCommand("EGH.GetListRehabilitationMethodOnParam", dbcontext.connection)) { cmd.CommandType = CommandType.StoredProcedure; { SqlParameter parm = new SqlParameter("@ТипТехногенногоОбъекта", SqlDbType.Int); parm.Value = riskobjecttypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@НазначениеЗемель", SqlDbType.Int); parm.Value = cadastretypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КатегорияНефтепродукта", SqlDbType.Int); parm.Value = petrochemicalcategorytypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КлассификацияАварий", SqlDbType.Int); parm.Value = emergencyclasstypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КатегорияПроникновенияНефтепродукта", SqlDbType.Int); parm.Value = penetrationdepthtypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КатегорияЗагрязненияГрунта", SqlDbType.Int); parm.Value = soilpollutioncategoriestypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@ДостижениеГоризонтаГрунтовыхВод", SqlDbType.Bit); parm.Value = waterachieved; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КатегорияЗагрязненияГрунтовыхВод", SqlDbType.Int); parm.Value = waterpollutioncategoriestypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@КатегорияВодоохраннойТерритории", SqlDbType.Int); parm.Value = waterprotectionareatypecode; cmd.Parameters.Add(parm); } { SqlParameter parm = new SqlParameter("@exitrc", SqlDbType.Int); parm.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(parm); } try { cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { int code = (int)reader["КодКлассификатора"]; int risk_object_type_code = (int)reader["ТипТехногенногоОбъекта"]; string risk_object_type_name = (string)reader["НаименованиеТипаТехногенногоОбъекта"]; RiskObjectType risk_object_type = new RiskObjectType(risk_object_type_code, risk_object_type_name); int cadastre_type_code = (int)reader["НазначениеЗемель"]; string cadastre_type_name = (string)reader["НаименованиеНазначенияЗемель"]; float cadastre_type_pdk_coef = (float)reader["ПДК"]; float cadastre_type_water_pdk_coef = (float)reader["ПДКводы"]; string cadastre_type_ground_doc_name = (string)reader["НормДокументЗемля"]; string cadastre_type_water_doc_name = (string)reader["НормДокументВода"]; CadastreType cadastre_type = new CadastreType(cadastre_type_code, cadastre_type_name, cadastre_type_pdk_coef, cadastre_type_water_pdk_coef, cadastre_type_ground_doc_name, cadastre_type_water_doc_name); int petrochemical_category_type_code = (int)reader["КатегорияНефтепродукта"]; string petrochemical_category_name = (string)reader["KN_НаименованиеКатегорииНефтепродукта"]; PetrochemicalCategories petrochemical_category = new PetrochemicalCategories(petrochemical_category_type_code, petrochemical_category_name); int emergency_class_type_code = (int)reader["КлассификацияАварий"]; string emergency_class_name = (string)reader["KA_НаименованиеТипаАварии"]; float emergency_class_min = (float)reader["KA_МинМасса"]; float emergency_class_max = (float)reader["KA_МаксМасса"]; EmergencyClass emergency_class = new EmergencyClass(emergency_class_type_code, emergency_class_name, emergency_class_min, emergency_class_max); int penetration_depth_type_code = (int)reader["КатегорияПроникновенияНефтепродукта"]; string penetration_depth_name = (string)reader["PN_НаименованиеТипаКатегории"]; float penetration_depth_min = (float)reader["PN_МинДиапазон"]; float penetration_depth_max = (float)reader["PN_МаксДиапазон"]; PenetrationDepth penetration_depth = new PenetrationDepth(penetration_depth_type_code, penetration_depth_name, penetration_depth_min, penetration_depth_max); int soil_pollution_categories_type_code = (int)reader["КатегорияЗагрязненияГрунта"]; string soil_pollution_categories_name = (string)reader["GP_НаименованиеКатегорииЗагрязненияГрунта"]; float soil_pollution_categories_min = (float)reader["GP_МинДиапазон"]; float soil_pollution_categories_max = (float)reader["GP_МаксДиапазон"]; int soil_pollution_categories_cadastre_type_code = (int)reader["GP_КодНазначенияЗемель"]; CadastreType soil_pollution_categories_cadastre_type = new CadastreType(soil_pollution_categories_cadastre_type_code); SoilPollutionCategories soilpollution_categories = new SoilPollutionCategories(soil_pollution_categories_type_code, soil_pollution_categories_name, soil_pollution_categories_min, soil_pollution_categories_max, soil_pollution_categories_cadastre_type); bool water_achieved = (bool)reader["ДостижениеГоризонтаГрунтовыхВод"]; int water_pollution_categories_type_code = (int)reader["КатегорияЗагрязненияГрунтовыхВод"]; string water_pollution_categories_name = (string)reader["WG_НаименованиеКатегорииЗагрязненияГВ"]; float water_pollution_categories_min = (float)reader["WG_МинДиапазон"]; float water_pollution_categories_max = (float)reader["WG_МаксДиапазон"]; int water_pollution_categories_cadastre_type_code = (int)reader["WG_КодНазначенияЗемель"]; CadastreType water_pollution_categories_cadastre_type = new CadastreType(water_pollution_categories_cadastre_type_code); WaterPollutionCategories water_pollution_categories = new WaterPollutionCategories(water_pollution_categories_type_code, water_pollution_categories_name, water_pollution_categories_min, water_pollution_categories_max, water_pollution_categories_cadastre_type); int water_protection_area_type_code = (int)reader["КатегорияВодоохраннойТерритории"]; string water_protection_area_name = (string)reader["WT_НаименованиеКатегории"]; WaterProtectionArea water_protection_area = new WaterProtectionArea(water_protection_area_type_code, water_protection_area_name); int soil_cleaning_method_type_code = (int)reader["КатегорияМЛЗагрязненияПГ"]; string soil_cleaning_method_name = (string)reader["PG_ОписаниеМетода"]; SoilCleaningMethod soil_cleaning_method = new SoilCleaningMethod(soil_cleaning_method_type_code, soil_cleaning_method_name); int water_cleaning_method_type_code = (int)reader["КатегорияМЛЗагрязненияГВ"]; string water_cleaning_method_name = (string)reader["PW_ОписаниеМетода"]; WaterCleaningMethod water_cleaning_method = new WaterCleaningMethod(water_cleaning_method_type_code, water_cleaning_method_name); if (rc = (int)cmd.Parameters["@exitrc"].Value > 0) { rehabilitation_method = new RehabilitationMethod(code, risk_object_type, cadastre_type, petrochemical_category, emergency_class, penetration_depth, soilpollution_categories, water_achieved, water_pollution_categories, water_protection_area, soil_cleaning_method, water_cleaning_method); } } reader.Close(); } catch (Exception e) { rc = false; }; } return(true); }
public ActionResult CadastreType() { CEQContext db = null; ViewBag.EGHLayout = "CEQ.CadastreType"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new CEQContext(this); ViewBag.msg = "Соединение с базой данных установлено"; view = View("CadastreType", db); if (menuitem.Equals("CadastreType.Create")) { view = View("CadastreTypeCreate"); } else if (menuitem.Equals("CadastreType.Delete")) { string type_code_item = this.HttpContext.Request.Params["type_code"]; if (type_code_item != null) { int c = 0; if (int.TryParse(type_code_item, out c)) { EGH01DB.Types.CadastreType cd = new EGH01DB.Types.CadastreType(); if (EGH01DB.Types.CadastreType.GetByCode(db, c, out cd)) { view = View("CadastreTypeDelete", cd); } } } } else if (menuitem.Equals("CadastreType.Update")) { string type_code_item = this.HttpContext.Request.Params["type_code"]; if (type_code_item != null) { int c = 0; if (int.TryParse(type_code_item, out c)) { EGH01DB.Types.CadastreType cd = new EGH01DB.Types.CadastreType(); if (EGH01DB.Types.CadastreType.GetByCode(db, c, out cd)) { view = View("CadastreTypeUpdate", cd); } } } } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
public ActionResult CadastreType() { RGEContext db = null; ViewBag.EGHLayout = "RGE.CadastreType"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new RGEContext(); ViewBag.msg = "Соединение с базой данных установлено"; view = View("CadastreType", db); if (menuitem.Equals("CadastreType.Create")) { view = View("CadastreTypeCreate"); } else if (menuitem.Equals("CadastreType.Delete")) { string type_code_item = this.HttpContext.Request.Params["type_code"]; if (type_code_item != null) { int c = 0; if (int.TryParse(type_code_item, out c)) { EGH01DB.Types.CadastreType cd = new EGH01DB.Types.CadastreType(); if (EGH01DB.Types.CadastreType.GetByCode(db, c, out cd)) { view = View("CadastreTypeDelete", cd); } } } } else if (menuitem.Equals("CadastreType.Update")) { string type_code_item = this.HttpContext.Request.Params["type_code"]; if (type_code_item != null) { int c = 0; if (int.TryParse(type_code_item, out c)) { EGH01DB.Types.CadastreType cd = new EGH01DB.Types.CadastreType(); if (EGH01DB.Types.CadastreType.GetByCode(db, c, out cd)) { view = View("CadastreTypeUpdate", cd); } } } } else if (menuitem.Equals("CadastreType.Excel")) { EGH01DB.Types.CadastreTypeList list = new EGH01DB.Types.CadastreTypeList(db); XmlNode node = list.toXmlNode(); XmlDocument doc = new XmlDocument(); XmlNode nnode = doc.ImportNode(node, true); doc.AppendChild(nnode); doc.Save(Server.MapPath("~/App_Data/CadastreType.xml")); view = View("Index"); view = File(Server.MapPath("~/App_Data/CadastreType.xml"), "text/plain", "Категории земли.xml"); } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }