Exemplo n.º 1
0
 void VisualLayoutsWhereThisIsPrinterList_OnBeforeRemove(object sender, EventArgs e)
 {
     Indico.DAL.VisualLayout obj = null;
     if (this.Context != null)
     {
         if (((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count > 0)
         {
             obj = ((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender)[((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count - 1].ObjDAL;
             this.ObjDAL.VisualLayoutsWhereThisIsPrinter.Remove(obj);
         }
     }
     else
     {
         IndicoContext objContext = new IndicoContext();
         obj = ((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender)[((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count - 1].SetDAL(objContext.Context);
         this.ObjDAL.VisualLayoutsWhereThisIsPrinter.Remove(obj);
         objContext.SaveChanges();
         objContext.Dispose();
     }
 }
Exemplo n.º 2
0
 void VisualLayoutsWhereThisIsResolutionProfileList_OnAfterAdd(object sender, EventArgs e)
 {
     Indico.DAL.VisualLayout obj = null;
     if (this.Context != null)
     {
         if (((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count > 0)
         {
             obj = ((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender)[((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count - 1].ObjDAL;
             this.ObjDAL.VisualLayoutsWhereThisIsResolutionProfile.Add(obj);
         }
     }
     else
     {
         IndicoContext objContext = new IndicoContext();
         obj = ((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender)[((IndicoList <Indico.BusinessObjects.VisualLayoutBO>)sender).Count - 1].SetDAL(objContext.Context);
         this.ObjDAL.VisualLayoutsWhereThisIsResolutionProfile.Add(obj);
         objContext.SaveChanges();
         objContext.Dispose();
     }
 }