public JsonResult Analyze(RectangleModel model)
        {
            AppBusObj busObj = new AppBusObj();
            try
            {
                RectangleDO r1 = new RectangleDO(model.r1.Top, model.r1.Left,  model.r1.Width, model.r1.Height);
                RectangleDO r2 = new RectangleDO(model.r2.Top, model.r2.Left,  model.r2.Width, model.r2.Height);
                RelationshipDO rel = busObj.GetRelationship(r1, r2);
                model.Header = rel.TypeName;
                model.Message = rel.TypeDescription;
                model.Success = true;
                if (rel.CompResult != null)
                {
                    model.Diff = (Shape)rel.CompResult;
                }
            }
            catch (Exception ex)
            {
                PackageError(model, ex);
            }

            finally
            {
                busObj.Dispose();
                busObj = null;
            }
            return Json(model);
        }
 private void PackageError(RectangleModel model, Exception ex)
 {
     model.Success = false;
     model.Header = TextFactory.Instance.GetText("MSG_ERR_HEADER", "eng");
     model.Message = GeometryException.GetFullMessage(ex);
 }
 public JsonResult InitBlocks(RectangleModel model)
 {
     return Json(model);
 }