public CompanySite()
        {
            Site = ApplicationDataContext.Instance.SystemEntityContext.SYS_Site.Include("SYS_Entity").FirstOrDefault(n => n.SYS_Entity.Id == ApplicationDataContext.Instance.LoggedInUser.DefaultSite.Id);

            Entity          = Site.SYS_Entity;
            billingAddress  = Site.SYS_Address_BillingAddress;  //dataContext.EntitySystemContext.SYS_Address.FirstOrDefault(n => n.Id == Site.BillingAddress);
            shippingAddress = Site.SYS_Address_ShippingAddress; //dataContext.EntitySystemContext.SYS_Address.FirstOrDefault(n => n.Id == Site.ShippingAddress);
            printerBarcode  = Site.SYS_Printer_Barcode;         //dataContext.EntitySystemContext.SYS_Printer.FirstOrDefault(n => n.Id == Site.PrinterBarcode);
            printerPicker   = Site.SYS_Printer_Picker;          //dataContext.EntitySystemContext.SYS_Printer.FirstOrDefault(n => n.Id == Site.PrinterPicker);
            printerReceipt  = Site.SYS_Printer_Receipt;         //dataContext.EntitySystemContext.SYS_Printer.FirstOrDefault(n => n.Id == Site.PrinterReceipt);
        }
Example #2
0
        internal static String Save(DB.SYS_Printer entry, DataContext dataContext)
        {
            try
            {
                if (dataContext.EntitySystemContext.GetEntityState(entry) == EntityState.Detached)
                {
                    dataContext.EntitySystemContext.SYS_Printer.Add(entry);
                }

                Validation.ValidateEntity(dataContext.EntitySystemContext, entry);
            }
            catch (Validation.EntityValidationException ex)
            {
                return(dataContext.PackageValidationException());
            }

            return("Success");
        }
Example #3
0
 public static DB.SYS_Printer GetPreviousItem(DB.SYS_Printer SYS_Printer, DataContext dataContext)
 {
     return(dataContext.EntitySystemContext.SYS_Printer.OrderByDescending(o => o.Name).FirstOrDefault(n => n.Name.CompareTo(SYS_Printer.Name) < 0 && n.Name.CompareTo(SYS_Printer.Name) != 0));
 }
Example #4
0
 public static DB.SYS_Printer GetNextItem(DB.SYS_Printer SYS_Printer, DataContext dataContext)
 {
     return(dataContext.EntitySystemContext.SYS_Printer.OrderBy(o => o.Name).FirstOrDefault(n => n.Name.CompareTo(SYS_Printer.Name) > 0 && n.Name.CompareTo(SYS_Printer.Name) != 0));
 }