Ejemplo n.º 1
0
    List <BuildingArea> GetLayers()
    {
        List <BuildingArea> layers = new List <BuildingArea> ();

        for (int i = 0; i < transform.childCount; i++)
        {
            BuildingArea ba = transform.GetChild(i).gameObject.GetComponent <BuildingArea> ();
            if (ba != null)
            {
                layers.Add(ba);
            }
        }

        //sort from down to up
        layers.Sort(delegate(BuildingArea x, BuildingArea y) {
            if (x.lines.Count == 0)
            {
                return((1).CompareTo(0));
            }
            else if (y.lines.Count == 0)
            {
                return((0).CompareTo(1));
            }

            return(x.lines[0].a.y.CompareTo(y.lines[0].a.y));
        });

        return(layers);
    }
Ejemplo n.º 2
0
        public IDictionary <string, object> GetBuildingAreaDynamic(
            BuildingArea row, AreaQueryProjection projection,
            AreaQueryOptions options)
        {
            var obj = new Dictionary <string, object>();

            foreach (var f in projection.GetFieldsArr())
            {
                switch (f)
                {
                case AreaQueryProjection.INFO:
                {
                    var entity = row;
                    obj["archived"]    = entity.Archived;
                    obj["code"]        = entity.Code;
                    obj["description"] = entity.Description;
                    obj["name"]        = entity.Name;
                }
                break;

                case AreaQueryProjection.SELECT:
                {
                    var entity = row;
                    obj["code"] = entity.Code;
                    obj["name"] = entity.Name;
                }
                break;
                }
            }
            return(obj);
        }
Ejemplo n.º 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            BuildingArea buildingArea = db.BuildingAreas.Find(id);

            db.BuildingAreas.Remove(buildingArea);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        public ActionResult OtherSBO()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            return(View(liba));
        }
Ejemplo n.º 5
0
        public ActionResult ManageAccessories()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            return(View(liba));
        }
Ejemplo n.º 6
0
        public ActionResult PowerVentilators()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            return(View(liba));
        }
Ejemplo n.º 7
0
        public ActionResult InteriorCatwalks()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            return(View());
        }
Ejemplo n.º 8
0
        public ActionResult RoofPlatforms()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            return(View());
        }
Ejemplo n.º 9
0
 public ActionResult Edit([Bind(Include = "ID,PISX_VER,GeneralData,DesignCode,SurfaceTreatment,Bracings,PanelsAndInsulations,RoofWallCladding,WallPanelAccessories,Openings,Subsystems,CraneSystems,Mezzanines,OldArea,Width,length,height")] BuildingArea buildingArea)
 {
     if (ModelState.IsValid)
     {
         db.Entry(buildingArea).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(buildingArea));
 }
Ejemplo n.º 10
0
        public ValidationData ValidateUpdateBuildingArea(ClaimsPrincipal principal,
                                                         BuildingArea entity, UpdateBuildingAreaModel model)
        {
            var validationData = new ValidationData();

            if (string.IsNullOrWhiteSpace(model.Name))
            {
                validationData = validationData.Fail(mess: "Name required", code: AppResultCode.FailValidation);
            }
            return(validationData);
        }
Ejemplo n.º 11
0
        public ActionResult Index()
        {
            BuildingArea        BA   = (BuildingArea)this.Session["_BA"];
            List <BuildingArea> liba = new List <BuildingArea>();

            liba.Add(BA);

            this.Session["_BA"] = BA;
            //this.Session["_Job"] = "New Job";
            return(View(liba));
        }
Ejemplo n.º 12
0
        // Convert OuR Object (Building Area) To Json String
        //public ActionResult Getjson()
        public string Getjson()
        {
            BuildingArea BA = (BuildingArea)this.Session["_BA"];

            this.Session["_BA"] = BA;
            string isoJson = JsonConvert.SerializeObject(BA, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            //string isoJson = "{ \"name\":\"John Johnson\",\"street\":\"Oslo West 16\",\"phone\":-1.0}";
            //return Json(BA , JsonRequestBehavior.AllowGet);
            return(isoJson);
        }
Ejemplo n.º 13
0
        // GET: BuildingAreas/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuildingArea buildingArea = db.BuildingAreas.Find(id);

            if (buildingArea == null)
            {
                return(HttpNotFound());
            }
            return(View(buildingArea));
        }
Ejemplo n.º 14
0
 protected override void Awake()
 {
     base.Awake();
     gameObject.tag = "StrategicPoint";
     flag           = GetComponentInChildren <Flag> ();
     if (flag)
     {
         flag.transform.eulerAngles = new Vector3(HUD.xCameraRotation, 0f, 0f);
         flag.gameObject.SetActive(false);
     }
     buildingArea = GetComponentInChildren <BuildingArea> ();
     if (buildingArea)
     {
         buildingArea.Initiate();
     }
 }
Ejemplo n.º 15
0
        // Convert Json String To OuR Object (Building Area)
        public ActionResult Setjson(string jsonStr)
        {
            JavaScriptSerializer json_serializer = new JavaScriptSerializer();

            //BuildingArea BA = JsonConvert.DeserializeObject<BuildingArea>(jsonStr);
            BuildingArea BA   = new BuildingArea();
            XNode        node = JsonConvert.DeserializeXNode(jsonStr, "BuildingArea");

            XmlSerializer serializer = new XmlSerializer(typeof(BuildingArea));

            StringReader rdr = new StringReader(node.ToString());

            BA = (BuildingArea)serializer.Deserialize(rdr);

            this.Session["_BA"] = BA;
            return(null);
        }
Ejemplo n.º 16
0
        // Convert OuR Object (Building Area) To XMl String and download it
        public FileResult downloadFile()
        {
            BuildingArea  BA = (BuildingArea)this.Session["_BA"];
            string        a;
            XmlSerializer xsSubmit = new XmlSerializer(typeof(BuildingArea));
            StringWriter  sww      = new StringWriter();

            using (XmlWriter writer = XmlWriter.Create(sww))
            {
                xsSubmit.Serialize(writer, BA);
                var xml  = sww.ToString(); // Your XML
                var file = File(Encoding.UTF8.GetBytes(xml), "application/xml", "Xml.xml");
                a = xml;
            }
            this.Session["_BA"] = BA;
            a = a.Replace("utf-16", "utf-8");
            return(File(Encoding.UTF8.GetBytes(a), "application/xml", "job.zxml"));
        }
Ejemplo n.º 17
0
        protected void Session_Start(Object sender, EventArgs e)
        {
            Session.Timeout = 60;
            BuildingArea BA = new BuildingArea();

            //

            ////string defult = "<?xml version=\"1.0\" encoding=\"utf - 8\"?><BuildingArea><PISX_VER><Created>4.0.0.3</ Created >< Current > 4.0.0.3 </ Current ></ PISX_VER >< GeneralData >< ID > 1 </ ID >< Location >< AlongBuildingWidth >< FromGL > A </ FromGL >< ToGL > B </ ToGL >< Axes > A,B </ Axes ></ AlongBuildingWidth >< AlongBuildingLength >< FromGL > 1 </ FromGL >< ToGL > 2 </ ToGL >< Axes > 1,2 </ Axes ></ AlongBuildingLength ></ Location >< Width > 20.000 </ Width >< WidthReference > OUT TO OUT OF STEEL LINE(O / O OF EAVE STRUTS) </ WidthReference >< Length > 8.000 </ Length >< LengthReference > OUT TO OUT OF STEEL LINE(O / O ENDWALL GIRTS) </ LengthReference >< HeightReference > EAVE HEIGHT </ HeightReference >< FrameType > CLEAR SPAN </ FrameType >< FixedBaseAllowed > true </ FixedBaseAllowed >< Gables >< Gable >< ID > 1 </ ID >< LeftSlope > 1 </ LeftSlope >< RightSlope > -1 </ RightSlope >< Width > 20.000 </ Width >< RidgeDistance > 10.000 </ RidgeDistance >< LeftHeight > 6.000 </ LeftHeight >< LeftColBase > 0.000 </ LeftColBase >< RightHeight > 6.000 </ RightHeight >< RightColBase > 0.000 </ RightColBase >< EaveCondition >< NearSide >< EaveConditionEnum > NO EAVE </ EaveConditionEnum ></ NearSide >< FarSide >< EaveConditionEnum > NO EAVE </ EaveConditionEnum ></ FarSide ></ EaveCondition ></ Gable ></ Gables >< Bays >< Bay >< ID > 1 </ ID >< Width > 8.000 </ Width >< BracingAvailable > true </ BracingAvailable ></ Bay ></ Bays >< EndWalls >< LEW >< Type > RIGID FRAME </ Type >< Profile >< ID > 1 </ ID >< GablesWidthModules >< GableWidthModules >< GableNo > 1 </ GableNo >< WidthModules >< Width > 20.000 </ Width ></ WidthModules ></ GableWidthModules ></ GablesWidthModules ></ Profile ></ LEW >< REW >< Type > RIGID FRAME </ Type >< Profile >< ID > 1 </ ID >< GablesWidthModules >< GableWidthModules >< GableNo > 1 </ GableNo >< WidthModules >< Width > 20.000 </ Width ></ WidthModules ></ GableWidthModules ></ GablesWidthModules ></ Profile ></ REW ></ EndWalls >< Profiles >< Profile >< ID > 1 </ ID >< GablesWidthModules >< GableWidthModules >< GableNo > 1 </ GableNo >< WidthModules >< Width > 20.000 </ Width ></ WidthModules ></ GableWidthModules ></ GablesWidthModules ></ Profile ></ Profiles >< Frames >< FrameProfile >< ID > 1 </ ID >< ProfileNo > 1 </ ProfileNo ></ FrameProfile >< FrameProfile >< ID > 2 </ ID >< ProfileNo > 1 </ ProfileNo ></ FrameProfile ></ Frames >< BaysProfile > [email protected] </ BaysProfile >< FramesProfile > 2@1 </ FramesProfile >< FutureExtension >< TransverseDirection > false </ TransverseDirection >< LongitudinalDirection > false </ LongitudinalDirection ></ FutureExtension >< Remarks /></ GeneralData >< DesignCode >< DeadLoad >< AsPerDesign > As Per Design</ AsPerDesign >< UserValue > 1 </ UserValue ></ DeadLoad >< LiveLoadOnRoof > 0.57 </ LiveLoadOnRoof >< LiveLoadOnFrame > 0.57 </ LiveLoadOnFrame >< GroundSnowLoad > 0.00 </ GroundSnowLoad >< ThicknessGroundSnow > 0.00 </ ThicknessGroundSnow >< CollateralLoad > 0 </ CollateralLoad >< RainFall >< Intensity > 150 </ Intensity >< HeavyRainArea > false </ HeavyRainArea >< Years > 25 </ Years >< Minutes > 5 </ Minutes ></ RainFall >< Temperature >< Plus > 0.00 </ Plus >< Minus > 0.00 </ Minus ></ Temperature >< Wind >< WindSpeed > 137 </ WindSpeed >< WindExposure > B </ WindExposure >< WindSpeedEnum > 3 SECOND GUST SPEED </ WindSpeedEnum ></ Wind >< Seismic > NONE </ Seismic >< DesignCodes > AISC </ DesignCodes >< ApplyLoadsPer > MBMA 2002 </ ApplyLoadsPer >< ColdFormedDesignCodes > AISI 01 </ ColdFormedDesignCodes >< Remarks /></ DesignCode >< SurfaceTreatment >< PrimaryMembers >< SurfaceFinish > PAINTED </ SurfaceFinish >< SurfaceTreatment > NONE </ SurfaceTreatment >< PaintSystem > NONE </ PaintSystem >< Coats />< Remarks /></ PrimaryMembers >< SecondaryMembers >< SurfaceFinish > PRE GALVANIZED </ SurfaceFinish >< SurfaceTreatment > NONE </ SurfaceTreatment >< PaintSystem > NONE </ PaintSystem >< Coats />< Remarks /></ SecondaryMembers ></ SurfaceTreatment >< Bracings >< NSW > DIAGONAL </ NSW >< NSWHeight > 0 </ NSWHeight >< FSW > DIAGONAL </ FSW >< FSWHeight > 0 </ FSWHeight >< LEW > NONE </ LEW >< LEWHeight > 0 </ LEWHeight >< REW > NONE </ REW >< REWHeight > 0 </ REWHeight >< InteriorBracings />< Remarks /></ Bracings >< PanelsAndInsulations >< SingleSkinTypes >< SingleSkin >< ID > 1 </ ID >< ProfileType > S </ ProfileType >< BaseMetal > ZA - Steel </ BaseMetal >< PaintFinish > ZSP </ PaintFinish >< Thickness > 0.5 </ Thickness >< Color > FW </ Color >< Description > S - ZA - ZSP - 0.5 - FW </ Description ></ SingleSkin ></ SingleSkinTypes >< TempconTypes />< InsulationTypes /></ PanelsAndInsulations >< RoofWallCladding >< RoofPanel >< Panel >< ByWho > OTHER </ ByWho >< Weight > 0 </ Weight ></ Panel >< Insulation >< ByWho > NONE </ ByWho >< SupplyWireMesh > false </ SupplyWireMesh >< Area > 0 </ Area ></ Insulation >< Liner >< ByWho > NONE </ ByWho ></ Liner ></ RoofPanel >< WallPanel >< NSW >< Condition > FULLY BLOCKED </ Condition >< GirtCondition > BY PASS </ GirtCondition ></ NSW >< FSW >< Condition > FULLY BLOCKED </ Condition >< GirtCondition > BY PASS </ GirtCondition ></ FSW >< LEW >< Condition > FULLY BLOCKED </ Condition >< GirtCondition > BY PASS </ GirtCondition ></ LEW >< REW >< Condition > FULLY BLOCKED </ Condition >< GirtCondition > BY PASS </ GirtCondition ></ REW ></ WallPanel >< Remarks /></ RoofWallCladding >< WallPanelAccessories >< WallPanelRelatedAccessories > SPECIAL </ WallPanelRelatedAccessories >< WallAccessories />< Remarks /></ WallPanelAccessories >< Openings >< Louvers >< Remarks /></ Louvers >< Windows >< Remarks /></ Windows >< FiberglassRoofCurbs >< Remarks /></ FiberglassRoofCurbs >< GravityRidgeVentillators >< Remarks /></ GravityRidgeVentillators >< OtherSBO >< Remarks /></ OtherSBO >< PersonnelDoors >< Remarks /></ PersonnelDoors >< PipeFlashings >< Remarks /></ PipeFlashings >< PowerVentilators >< Remarks /></ PowerVentilators >< RollupDoors >< Remarks /></ RollupDoors >< SlidingDoors >< Remarks /></ SlidingDoors >< FramedOpenings >< Remarks /></ FramedOpenings >< OpenWalls >< Remarks /></ OpenWalls >< TranslucentPanels >< Remarks /></ TranslucentPanels ></ Openings >< Subsystems >< Canopies >< Remarks /></ Canopies >< RoofExtensions >< Remarks /></ RoofExtensions >< Fascias >< Remarks /></ Fascias >< RoofMonitors >< Remarks /></ RoofMonitors >< InteriorCatwalks >< Remarks /></ InteriorCatwalks >< Ladders >< Remarks /></ Ladders >< Partitions >< Remarks /></ Partitions >< RoofPlatforms >< Remarks /></ RoofPlatforms >< RoofWalkways >< Remarks /></ RoofWalkways >< Staircases >< Remarks /></ Staircases ></ Subsystems >< CraneSystems >< Remarks /></ CraneSystems >< Mezzanines >< Remarks /></ Mezzanines >< OldArea /></ BuildingArea > ";
            string Pathde = Server.MapPath(@"\App_Data\Defult.xml");
            string defult = File.ReadAllText(Pathde);

            XmlSerializer serializer = new XmlSerializer(typeof(BuildingArea));
            //xmlStr=xmlStr.Replace("utf-8", "utf-16");

            StringReader rdr = new StringReader(defult);

            BA = (BuildingArea)serializer.Deserialize(rdr);

            HttpContext.Current.Session.Add("_BA", BA);
            HttpContext.Current.Session.Add("_Job", "New Job");
        }
Ejemplo n.º 18
0
 public AppEvent GetEventForDeleteBuildingArea(string display, ClaimsPrincipal principal, BuildingArea entity)
 {
     return(new AppEvent
     {
         Id = Guid.NewGuid().ToString(),
         DisplayContent = display,
         Data = JsonConvert.SerializeObject(new
         {
             entity.Code
         }),
         HappenedTime = DateTime.UtcNow,
         Type = "DeleteBuildingArea",
         UserId = principal.Identity.Name
     });
 }
Ejemplo n.º 19
0
 public ValidationData ValidateDeleteBuildingArea(ClaimsPrincipal principal,
                                                  BuildingArea entity)
 {
     return(new ValidationData());
 }
Ejemplo n.º 20
0
 public BuildingArea UpdateBuildingArea(BuildingArea entity, UpdateBuildingAreaModel model)
 {
     model.CopyTo(entity);
     return(entity);
 }
Ejemplo n.º 21
0
 public BuildingArea DeleteBuildingArea(BuildingArea entity)
 {
     entity = context.BuildingArea.Remove(entity).Entity;
     return(entity);
 }
Ejemplo n.º 22
0
 protected void PrepareCreate(BuildingArea entity)
 {
 }
Ejemplo n.º 23
0
    public void NewLayer()
    {
        // get upper ceil
        // make new object (building area)
        // copy lines
        // offset to up
        // disable old layer

        List <BuildingArea> layers = GetLayers();


        if (layers [layers.Count - 1].lines.Count == 0)
        {
            return;
        }

        Mesh       lastCeil = layers [layers.Count - 1].IsBasement ? layers [layers.Count - 1].GetOuterCeil() : layers [layers.Count - 1].GetCeil();
        GameObject go;

        if (ceilFlag)
        {
            go = new GameObject("FloorCeil" + (layers.Count - 1).ToString());
        }
        else
        {
            go = new GameObject("Floor" + layers.Count.ToString());
        }



        go.AddComponent <MeshFilter> ().mesh = lastCeil;
        go.AddComponent <MeshCollider> ();
        go.AddComponent <MeshRenderer> ();
        BuildingArea newLayer = go.AddComponent <BuildingArea> ();


        if (layers.Count > 0)
        {
            layers [layers.Count - 1].CopyToNewLayer(newLayer);
        }


        go.transform.parent = this.transform;

        newLayer.lines.Clear();
//		if (newLayer.lines.Count != 0) {
//			//go.transform.position += Vector3.up * layers [layers.Count - 1].lines [0].Height;
//			for (int i = 0; i < newLayer.lines [0].Vertices.Count; i++) {
//				newLayer.lines [0].Vertices [i] += Vector3.up * layers [layers.Count - 1].lines [0].Height;
//			}
//
//			for (int i = 0; i < newLayer.lines.Count; ++i) {
//				for (int j = 0; j < newLayer.lines [i].Doors.Count; ++j)
//					newLayer.lines [i].Doors [j].Update ();
//
//				for (int j = 0; j < newLayer.lines [i].Windows.Count; ++j)
//					newLayer.lines [i].Windows [j].Update ();
//			}
//		}

        if (layers [layers.Count - 1].IsBasement)
        {
            GameObject.Destroy(newLayer.Basement);

            newLayer.Basement = null;
            for (int i = 0; i < newLayer.lines.Count; ++i)
            {
                newLayer.lines [i].Destroy();
            }
            GameObject.Destroy(newLayer.upperWallFace);
            newLayer.upperWallFace = null;
            newLayer.lines.Clear();
            newLayer.IsBasement = false;
        }

        newLayer.isCeil = ceilFlag;

        if (ceilFlag)
        {
            Mesh      mesh     = GameObject.Instantiate(layers [0].gameObject.GetComponent <MeshCollider> ().sharedMesh);
            Vector3[] newVerts = new Vector3[mesh.vertices.Length];
            for (int i = 0; i < mesh.vertices.Length; i++)
            {
                newVerts[i] = mesh.vertices [i] + Vector3.up * (layers [layers.Count - 1].lines [0].a.y + layers [layers.Count - 1].Height);
            }
            mesh.vertices = newVerts;
            newLayer.GetComponent <MeshCollider> ().sharedMesh = mesh;
            newLayer.Height = CeilThickness;
        }
        else
        {
            for (int i = 0; i < newLayer.lines.Count; i++)
            {
                newLayer.lines [i].Height = layers[layers.Count - 2].lines[0].Height;
            }
        }

        newLayer.SetWorkingHeight(layers [layers.Count - 1].lines [0].a.y + layers [layers.Count - 1].Height);


        layers.Add(newLayer);
        newLayer.regeneratePath(true);



        //enable roof on last layer only
        for (int i = 1; i < layers.Count; i++)
        {
            layers [i].RoofEnabled = false;
        }
//		slider.minValue = 0;
//		slider.maxValue = layers.Count - 1;
//		slider.value = slider.maxValue;

        ceilFlag = !ceilFlag;

        SelectLayer(layers.Count - 1);
    }
Ejemplo n.º 24
0
        public ActionResult GetXML(string xmlStr)
        {
            string Xmlse = xmlStr;

            try
            {
                BuildingArea  BA         = (BuildingArea)this.Session["_BA"];
                XmlSerializer serializer = new XmlSerializer(typeof(BuildingArea));
                //xmlStr=xmlStr.Replace("utf-8", "utf-16");
                if (Xmlse.Contains("<Years/>"))
                {
                    Xmlse = Xmlse.Replace("<Years/>", "<Years>0</Years>");
                }
                if (Xmlse.Contains("<Minutes/>"))
                {
                    Xmlse = Xmlse.Replace("<Minutes/>", "<Minutes>0</Minutes>");
                }
                if (Xmlse.Contains("<Thickness/>"))
                {
                    Xmlse = Xmlse.Replace("<Thickness/>", "<Thickness>0</Thickness>");
                }
                if (Xmlse.Contains("<Area/>"))
                {
                    Xmlse = Xmlse.Replace("<Area/>", "<Area>0</Area>");
                }
                if (Xmlse.Contains("<Height/>"))
                {
                    Xmlse = Xmlse.Replace("<Height/>", "<Height>0</Height>");
                }
                if (Xmlse.Contains("<Width/>"))
                {
                    Xmlse = Xmlse.Replace("<Width/>", "<Width>0</Width>");
                }
                if (Xmlse.Contains("<ClearHeightBelowBeam/>"))
                {
                    Xmlse = Xmlse.Replace("<ClearHeightBelowBeam/>", "<ClearHeightBelowBeam>0</ClearHeightBelowBeam>");
                }
                if (Xmlse.Contains("<ClearHeightAboveJoist/>"))
                {
                    Xmlse = Xmlse.Replace("<ClearHeightAboveJoist/>", "<ClearHeightAboveJoist>0</ClearHeightAboveJoist>");
                }
                if (Xmlse.Contains("<TopOfMezzFinishFromFFL/>"))
                {
                    Xmlse = Xmlse.Replace("<TopOfMezzFinishFromFFL/>", "<TopOfMezzFinishFromFFL>0</TopOfMezzFinishFromFFL>");
                }
                if (Xmlse.Contains("<Length/>"))
                {
                    Xmlse = Xmlse.Replace("<Length/>", "<Length>0</Length>");
                }
                if (Xmlse.Contains("<LiveLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<LiveLoad/>", "<LiveLoad>0</LiveLoad>");
                }
                if (Xmlse.Contains("<DeadLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<DeadLoad/>", "<DeadLoad>0</DeadLoad>");
                }
                if (Xmlse.Contains("<CollateralLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<CollateralLoad/>", "<CollateralLoad>0</CollateralLoad>");
                }
                if (Xmlse.Contains("<OtherLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<OtherLoad/>", "<OtherLoad>0</OtherLoad>");
                }
                if (Xmlse.Contains("<ID/>"))
                {
                    Xmlse = Xmlse.Replace("<ID/>", "<ID>0</ID>");
                }
                if (Xmlse.Contains("<HookHeightH3/>"))
                {
                    Xmlse = Xmlse.Replace("<HookHeightH3/>", "<HookHeightH3>0</HookHeightH3>");
                }
                if (Xmlse.Contains("<TopOfCraneBeamH1/>"))
                {
                    Xmlse = Xmlse.Replace("<TopOfCraneBeamH1/>", "<TopOfCraneBeamH1>0</TopOfCraneBeamH1>");
                }
                if (Xmlse.Contains("<WheelBase/>"))
                {
                    Xmlse = Xmlse.Replace("<WheelBase/>", "<WheelBase>0</WheelBase>");
                }
                if (Xmlse.Contains("<VertH2/>"))
                {
                    Xmlse = Xmlse.Replace("<VertH2/>", "<VertH2>0</VertH2>");
                }
                if (Xmlse.Contains("<HorizW2/>"))
                {
                    Xmlse = Xmlse.Replace("<HorizW2/>", "<HorizW2>0</HorizW2>");
                }
                if (Xmlse.Contains("<Crane/>"))
                {
                    Xmlse = Xmlse.Replace("<Crane/>", "<Crane>0</Crane>");
                }
                if (Xmlse.Contains("<Hoist/>"))
                {
                    Xmlse = Xmlse.Replace("<Hoist/>", "<Hoist>0</Hoist>");
                }
                if (Xmlse.Contains("<Trolley/>"))
                {
                    Xmlse = Xmlse.Replace("<Trolley/>", "<Trolley>0</Trolley>");
                }
                if (Xmlse.Contains("<Bridge/>"))
                {
                    Xmlse = Xmlse.Replace("<Bridge/>", "<Bridge>0</Bridge>");
                }
                if (Xmlse.Contains("<ClearHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<ClearHeight/>", "<ClearHeight>0</ClearHeight>");
                }
                if (Xmlse.Contains("<Projection/>"))
                {
                    Xmlse = Xmlse.Replace("<Projection/>", "<Projection>0</Projection>");
                }
                if (Xmlse.Contains("<ThroatOpening/>"))
                {
                    Xmlse = Xmlse.Replace("<ThroatOpening/>", "<ThroatOpening>0</ThroatOpening>");
                }
                if (Xmlse.Contains("<BottomHeightFromFFL/>"))
                {
                    Xmlse = Xmlse.Replace("<BottomHeightFromFFL/>", "<BottomHeightFromFFL>0</BottomHeightFromFFL>");
                }
                if (Xmlse.Contains("<HandrailLength/>"))
                {
                    Xmlse = Xmlse.Replace("<HandrailLength/>", "<HandrailLength>0</HandrailLength>");
                }
                if (Xmlse.Contains("<UniformLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<UniformLoad/>", "<UniformLoad>0</UniformLoad>");
                }
                if (Xmlse.Contains("<ConcentratedLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<ConcentratedLoad/>", "<ConcentratedLoad>0</ConcentratedLoad>");
                }
                if (Xmlse.Contains("<OpenWallLength/>"))
                {
                    Xmlse = Xmlse.Replace("<OpenWallLength/>", "<OpenWallLength>0</OpenWallLength>");
                }
                if (Xmlse.Contains("<OpenWallHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<OpenWallHeight/>", "<OpenWallHeight>0</OpenWallHeight>");
                }
                if (Xmlse.Contains("<LocationX/>"))
                {
                    Xmlse = Xmlse.Replace("<LocationX/>", "<LocationX>0</LocationX>");
                }
                if (Xmlse.Contains("<LocationY/>"))
                {
                    Xmlse = Xmlse.Replace("<LocationY/>", "<LocationY>0</LocationY>");
                }
                if (Xmlse.Contains("<CarryingWeight/>"))
                {
                    Xmlse = Xmlse.Replace("<CarryingWeight/>", "<CarryingWeight>0</CarryingWeight>");
                }
                if (Xmlse.Contains("<Throat/>"))
                {
                    Xmlse = Xmlse.Replace("<Throat/>", "<Throat>0</Throat>");
                }
                if (Xmlse.Contains("<Density/>"))
                {
                    Xmlse = Xmlse.Replace("<Density/>", "<Density>0</Density>");
                }
                if (Xmlse.Contains("<Offset/>"))
                {
                    Xmlse = Xmlse.Replace("<Offset/>", "<Offset>0</Offset>");
                }
                if (Xmlse.Contains("<LiveLoadOnRoof/>"))
                {
                    Xmlse = Xmlse.Replace("<LiveLoadOnRoof/>", "<LiveLoadOnRoof>0</LiveLoadOnRoof>");
                }
                if (Xmlse.Contains("<LiveLoadOnFrame/>"))
                {
                    Xmlse = Xmlse.Replace("<LiveLoadOnFrame/>", "<LiveLoadOnFrame>0</LiveLoadOnFrame>");
                }
                if (Xmlse.Contains("<ThicknessGroundSnow/>"))
                {
                    Xmlse = Xmlse.Replace("<ThicknessGroundSnow/>", "<ThicknessGroundSnow>0</ThicknessGroundSnow>");
                }
                if (Xmlse.Contains("<GroundSnowLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<GroundSnowLoad/>", "<GroundSnowLoad>0</GroundSnowLoad>");
                }
                if (Xmlse.Contains("<CollateralLoad/>"))
                {
                    Xmlse = Xmlse.Replace("<CollateralLoad/>", "<CollateralLoad>0</CollateralLoad>");
                }
                if (Xmlse.Contains("<Intensity/>"))
                {
                    Xmlse = Xmlse.Replace("<Intensity/>", "<Intensity>0</Intensity>");
                }
                if (Xmlse.Contains("<Plus/>"))
                {
                    Xmlse = Xmlse.Replace("<Plus/>", "<Plus>0</Plus>");
                }
                if (Xmlse.Contains("<Minus/>"))
                {
                    Xmlse = Xmlse.Replace("<Minus/>", "<Minus>0</Minus>");
                }
                if (Xmlse.Contains("<WindPressure/>"))
                {
                    Xmlse = Xmlse.Replace("<WindPressure/>", "<WindPressure>0</WindPressure>");
                }
                if (Xmlse.Contains("<WindSpeed/>"))
                {
                    Xmlse = Xmlse.Replace("<WindSpeed/>", "<WindSpeed>0</WindSpeed>");
                }
                if (Xmlse.Contains("<LeftSlope/>"))
                {
                    Xmlse = Xmlse.Replace("<LeftSlope/>", "<LeftSlope>0</LeftSlope>");
                }
                if (Xmlse.Contains("<RightSlope/>"))
                {
                    Xmlse = Xmlse.Replace("<RightSlope/>", "<RightSlope>0</RightSlope>");
                }
                if (Xmlse.Contains("<RidgeDistance/>"))
                {
                    Xmlse = Xmlse.Replace("<RidgeDistance/>", "<RidgeDistance>0</RidgeDistance>");
                }
                if (Xmlse.Contains("<LeftHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<LeftHeight/>", "<LeftHeight>0</LeftHeight>");
                }
                if (Xmlse.Contains("<LeftColBase/>"))
                {
                    Xmlse = Xmlse.Replace("<LeftColBase/>", "<LeftColBase>0</LeftColBase>");
                }
                if (Xmlse.Contains("<RightHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<RightHeight/>", "<RightHeight>0</RightHeight>");
                }
                if (Xmlse.Contains("<RightColBase/>"))
                {
                    Xmlse = Xmlse.Replace("<RightColBase/>", "<RightColBase>0</RightColBase>");
                }
                if (Xmlse.Contains("<NSWHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<NSWHeight/>", "<NSWHeight>0</NSWHeight>");
                }
                if (Xmlse.Contains("<FSWHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<FSWHeight/>", "<FSWHeight>0</FSWHeight>");
                }
                if (Xmlse.Contains("<LEWHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<LEWHeight/>", "<LEWHeight>0</LEWHeight>");
                }
                if (Xmlse.Contains("<REWHeight/>"))
                {
                    Xmlse = Xmlse.Replace("<REWHeight/>", "<REWHeight>0</REWHeight>");
                }
                //Xmlse = Xmlse.ToUpper();



                //StringReader rdr = new StringReader(Xmlse);

                XDocument doc = XDocument.Parse(Xmlse);

                foreach (var desc in doc.Descendants())
                {
                    var    nodes = desc.Nodes().Where(p => p.NodeType == XmlNodeType.Text);
                    string flow  = "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"";

                    foreach (XText node in nodes)
                    {
                        if (node.Value == "false" || node.Value == "true" || node.Value.Contains(flow))
                        {
                        }
                        else
                        {
                            node.Value = node.Value.ToUpper();
                        }
                    }
                }

                string res = Edit1Area(doc.Root);

                Vaildtion(doc.ToString());
                StringReader rdr = new StringReader(res.ToString());
                //StringReader rdr = new StringReader(doc.ToString());
                //BA = (BuildingArea)serializer.Deserialize(rdr);
                BA = (BuildingArea)serializer.Deserialize(rdr);
                this.Session["_BA"] = BA;

                return(null);
            }
            catch (Exception ex)
            {
                //BuildingArea BA = (BuildingArea)this.Session["_BA"];
                //this.Session["_BA"] = BA;
                StringReader rdr = new StringReader(Xmlse);
                var          err = FromDictionaryToJson(expections);
                return(Json(erors));
                //return Json(new { error = "Wrong File" + ex, baz = "Blech" });
            }
        }