public static DbModel.Location.AreaAndDev.Bound ToDbModel(this Location.TModel.Location.AreaAndDev.Bound item1) { if (item1 == null) { return(null); } var item2 = new DbModel.Location.AreaAndDev.Bound(); item2.Update(item1); return(item2); }
private void DrawArea() { if (Area == null) { return; } var bound = Area.InitBound; if (bound == null) { if (MessageBox.Show("不存在边界信息,是否创建", "初始化", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { var bll = AppContext.GetLocationBll(); var dbBound = new DbModel.Location.AreaAndDev.Bound(); bool r = bll.Bounds.Add(dbBound); if (r) { var dbArea = Area.ToDbModel(); dbArea.InitBound = dbBound; bool r2 = bll.Areas.Edit(dbArea); if (r2) { bound = dbBound.ToTModel(); DrawArea(bound); } else { MessageBox.Show("修改Area失败"); } } else { MessageBox.Show("添加Bound失败"); } } else { return; } } else { DrawArea(bound); } }
public static DbModel.Location.AreaAndDev.Bound Update(this DbModel.Location.AreaAndDev.Bound item2, Location.TModel.Location.AreaAndDev.Bound item1) { if (item1 == null) { return(null); } item2.Id = item1.Id; item2.MinX = item1.MinX; item2.MaxX = item1.MaxX; item2.MinY = item1.MinY; item2.MaxY = item1.MaxY; item2.MinZ = item1.MinZ; item2.MaxZ = item1.MaxZ; item2.ZeroX = item1.ZeroX; item2.ZeroY = item1.ZeroY; item2.Shape = item1.Shape; item2.IsRelative = item1.IsRelative; item2.Points = item1.Points.ToDbModel(); return(item2); }