Esempio n. 1
0
 public List <User> GetAxUser()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.Users.ToList());
     }
 }
Esempio n. 2
0
 public List <BarcodeDisplaySettingsDetail> GetBarcodeDisplaySettingsDetail(int BarcodeDisplaySettingsHeader)
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.BarcodeDisplaySettingsDetails.Where(x => x.BarcodeDisplaySettingsHeader == BarcodeDisplaySettingsHeader).ToList());
     }
 }
Esempio n. 3
0
 public List <BarcodeDisplaySettingsHeader> GetBarcodeDisplaySettingsHeader()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.BarcodeDisplaySettingsHeaders.ToList());
     }
 }
Esempio n. 4
0
        private List <RouteCardInvoiceHeader> GetRouteCardInvoiceHeader(int skip, int take, string sort, string filter, Dictionary <string, object> valuesObjects, out int fullCount, out List <Vendor> Vendors)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                IQueryable <RouteCardInvoiceHeader> query;
                if (filter != null)
                {
                    var parameterCollection = SharedOperation.ConvertToParamters(valuesObjects);

                    fullCount = context.RouteCardInvoiceHeaders.Where(filter, parameterCollection.ToArray()).Count();
                    query     = context.RouteCardInvoiceHeaders.Where(filter, parameterCollection.ToArray()).OrderBy(sort).Skip(skip).Take(take);
                }
                else
                {
                    fullCount = context.RouteCardInvoiceHeaders.Count();
                    query     = context.RouteCardInvoiceHeaders.OrderBy(sort).Skip(skip).Take(take);
                }


                var codes = query.Select(w => w.Vendor).ToList();
                Vendors = context.Vendors.Where(x => codes.Contains(x.vendor_code)).ToList();

                return(query.ToList());
            }
        }
Esempio n. 5
0
 public List <tbl_lkp_BarcodeOperations> GetBarcodeOperationsLkp()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.tbl_lkp_BarcodeOperations.ToList());
     }
 }
Esempio n. 6
0
 public List <TblAuthPermission> GetUserSpectialPermissions()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.TblAuthPermissions.Where(x => x.PermissionTyp == "P").OrderBy(x => x.PermOrder).ToList());
     }
 }
Esempio n. 7
0
 public void CopyPermission(int Job)
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         var perm   = context.TblAuthJobPermissions.Where(x => x.Tbljob == Job).ToList();
         var job    = context.TblAuthJobs.FirstOrDefault(w => w.Iserial == Job);
         var newjob = new TblAuthJob()
         {
             Aname = "Copy " + job.Aname,
             Ename = "Copy " + job.Ename,
             Code  = "Copy " + job.Code,
         };
         context.TblAuthJobs.AddObject(newjob);
         context.SaveChanges();
         foreach (var item in perm)
         {
             var newAuthJobPermission = new TblAuthJobPermission()
             {
                 AllowDelete   = item.AllowDelete,
                 AllowNew      = item.AllowNew,
                 AllowUpdate   = item.AllowUpdate,
                 Value         = item.Value,
                 WFM_DOMAINID  = item.WFM_DOMAINID,
                 TblPermission = item.TblPermission,
                 Tbljob        = newjob.Iserial
             };
             context.TblAuthJobPermissions.AddObject(newAuthJobPermission);
         }
         context.SaveChanges();
     }
 }
Esempio n. 8
0
        private ItemsDto AccWithConfigAndSize(ItemsDto item)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                var comList =
                    (from x in context.tbl_AccessoryAttributesDetails
                     where (x.Code == (item.Code))
                     select x).ToList();

                var criteria = comList.Select(x => x.Configuration).ToList();
                //var result_tag = (from i in _ctx.Items
                //                  where criteria.Contains(i.ID)
                //                  select i).ToList();
                //var result = from i in result_tag
                //             join s in itemScores on i.ID equals s._id
                //             orderby s._score descending
                //             select new ItemSearchResult(i, s._score);

                var accList =
                    (from c in context.TblColors
                     ///    join x in comList on c.Code equals x.Configuration

                     where (c.TblLkpColorGroup == 24 && criteria.Contains(c.Code))
                     orderby c.Code
                     select(c)).ToList();

                item.CombinationList = comList;
                item.AccConfigList   = accList;
                return(item);
            }
        }
Esempio n. 9
0
        private List <StoreForAllCompany> GetStoresForAllCompany(int skip, int take, string organization, string sort, string filter, Dictionary <string, object> valuesObjects, out int fullCount)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                IQueryable <StoreForAllCompany> query;
                if (filter != null)
                {
                    if (organization != null)
                    {
                        filter = filter + " and it.Organization ==(@Group0)";
                        valuesObjects.Add("Group0", organization);
                    }
                    var parameterCollection = ConvertToParamters(valuesObjects);

                    fullCount = context.StoreForAllCompanies.Where(filter, parameterCollection.ToArray()).Count();
                    query     = context.StoreForAllCompanies.Where(filter, parameterCollection.ToArray()).OrderBy(sort).Skip(skip).Take(take);
                }
                else
                {
                    fullCount = context.StoreForAllCompanies.Count(x => x.Organization == organization || organization == null);
                    query     = context.StoreForAllCompanies.OrderBy(sort).Where(x => x.Organization == organization || organization == null).Skip(skip).Take(take);
                }
                return(query.ToList());
            }
        }
Esempio n. 10
0
 public List <DyeingAxService> GetAxSummaryServices()
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.DyeingAxServices.ToList());
     }
 }
Esempio n. 11
0
 public List <DyeingSummaryService> GetSavedSummaryServices(int iserial)
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.DyeingSummaryServices.Where(x => x.SummaryRowIserial == iserial).ToList());
     }
 }
Esempio n. 12
0
 public List <FabricsDyedGroup> GetFabricDyedList()
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.FabricsDyedGroups.ToList());
     }
 }
Esempio n. 13
0
 public List <TblDyeingSummary> GetDyeingSummary(int headerIserial)
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.TblDyeingSummaries.Include("TblDyeingPlanLotsMasters").Where(x => x.DyeingHeader == headerIserial).ToList());
     }
 }
Esempio n. 14
0
 public List <tbl_lkp_DyingClassification> GetDyeingClassificaiton()
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.tbl_lkp_DyingClassification.ToList());
     }
 }
Esempio n. 15
0
 public List <FabricStorage_Result> GetLocationDetails(string location)
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.FabricStorage(location).ToList());
     }
 }
Esempio n. 16
0
        private List <TblTransferMsg> GetTblTransferMsg(int skip, int take, string sort, string filter, Dictionary <string, object> valuesObjects, string code, out int fullCount)
        {
            using (var model = new TimeAttEntities())
            {
                var emp = model.EmployeesViews.FirstOrDefault(x => x.Emplid == code);

                using (var context = new WorkFlowManagerDBEntities())
                {
                    IQueryable <TblTransferMsg> query;
                    if (filter != null)
                    {
                        filter = filter + " and it.Company ==(@Company0)";
                        valuesObjects.Add("Company0", emp.Company);
                        filter = filter + " and it.Store ==(@Store0)";
                        valuesObjects.Add("Store0", emp.Store);
                        var parameterCollection = ConvertToParamters(valuesObjects);

                        fullCount = context.TblTransferMsgs.Where(filter, parameterCollection.ToArray()).Count();
                        query     = context.TblTransferMsgs.Where(filter, parameterCollection.ToArray()).OrderBy(sort).Skip(skip).Take(take);
                    }
                    else
                    {
                        fullCount = context.TblTransferMsgs.Count(x => x.Company == emp.Company && x.Store == emp.Store);
                        query     = context.TblTransferMsgs.Where(x => x.Company == emp.Company && x.Store == emp.Store).OrderBy(sort).Skip(skip).Take(take);
                    }
                    return(query.ToList());
                }
            }
        }
Esempio n. 17
0
 private TblStyleTNAColorDetail UpdateOrInsertTblStyleTNAColorDetail(TblStyleTNAColorDetail newRow, bool save, int index, int user, out int outindex)
 {
     outindex = index;
     try
     {
         using (var context = new WorkFlowManagerDBEntities())
         {
             if (save)
             {
                 context.TblStyleTNAColorDetails.AddObject(newRow);
             }
             else
             {
                 var oldRow = (from e in context.TblStyleTNAColorDetails
                               where e.Iserial == newRow.Iserial
                               select e).SingleOrDefault();
                 if (oldRow != null)
                 {
                     SharedOperation.GenericUpdate(oldRow, newRow, context);
                 }
             }
             context.SaveChanges();
             return(newRow);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 18
0
 private TblTransferMsg UpdateOrInsertTblTransferMsg(TblTransferMsg newRow, bool save, int index,
                                                     out int outindex, string code)
 {
     outindex = index;
     using (var model = new TimeAttEntities())
     {
         var emp = model.EmployeesViews.FirstOrDefault(x => x.Emplid == code);
         newRow.Company = emp.Company;
         newRow.Store   = emp.Store;
         using (var context = new WorkFlowManagerDBEntities())
         {
             if (save)
             {
                 context.TblTransferMsgs.AddObject(newRow);
             }
             else
             {
                 var oldRow = (from e in context.TblTransferMsgs
                               where e.Iserial == newRow.Iserial
                               select e).SingleOrDefault();
                 if (oldRow != null)
                 {
                     GenericUpdate(oldRow, newRow, context);
                 }
             }
             context.SaveChanges();
             return(newRow);
         }
     }
 }
Esempio n. 19
0
        public void SaveJobPerm(List <TblAuthJobPermission> listToSave, List <TblAuthJobPermission> listToDelete, int tblJob)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                foreach (var newPerm in listToSave)
                {
                    var rowToSave =
                        context.TblAuthJobPermissions.FirstOrDefault(x => x.Tbljob == tblJob && x.TblPermission == newPerm.TblPermission);
                    if (rowToSave == null)
                    {
                        context.TblAuthJobPermissions.AddObject(newPerm);
                        context.SaveChanges();
                    }
                    else
                    {
                        GenerUpdate(rowToSave, newPerm, context);
                        context.SaveChanges();
                    }
                }

                foreach (var newPerm in listToDelete)
                {
                    var rowToSave =
                        context.TblAuthJobPermissions.FirstOrDefault(x => x.Tbljob == tblJob && x.TblPermission == newPerm.TblPermission);
                    if (rowToSave != null)
                    {
                        context.TblAuthJobPermissions.DeleteObject(rowToSave);
                        context.SaveChanges();
                    }
                }
            }
        }
Esempio n. 20
0
        public static List <T> GetLookupItems <T>(string query, Guid requestId, out Guid responseId)
        {
            responseId = requestId;
            var entity = new WorkFlowManagerDBEntities();

            return(entity.CreateQuery <T>(query).ToList());
        }
Esempio n. 21
0
 private RouteCardInvoiceHeader UpdateOrInsertRouteCardInvoiceHeader(RouteCardInvoiceHeader newRow, bool save, int index, out int outindex)
 {
     outindex = index;
     using (var context = new WorkFlowManagerDBEntities())
     {
         if (save)
         {
             var seqCode = SharedOperation.GetChainSetup("GlRouteInvoiceSequence");
             var seqProd = context.TblSequenceProductions.FirstOrDefault(w => w.Code == seqCode);
             newRow.Code = SharedOperation.HandelSequence(seqProd);
             context.RouteCardInvoiceHeaders.AddObject(newRow);
         }
         else
         {
             var oldRow = (from e in context.RouteCardInvoiceHeaders
                           where e.Iserial == newRow.Iserial
                           select e).SingleOrDefault();
             if (oldRow != null)
             {
                 SharedOperation.GenericUpdate(oldRow, newRow, context);
             }
         }
         context.SaveChanges();
         return(newRow);
     }
 }
Esempio n. 22
0
        public List <TblColorLink> GetTblColorLink(int skip, int take, string brand, int brandSection, int season, string sort, string filter, Dictionary <string, object> valuesObjects, out int fullCount)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                IQueryable <TblColorLink> query;
                if (filter != null)
                {
                    filter = filter + " and it.TblBrand LIKE(@Brand0)" + " and it.TblLkpBrandSection ==(@BrandSection0)" + " and it.TblLkpSeason ==(@season0)";
                    valuesObjects.Add("Brand0", brand);
                    valuesObjects.Add("BrandSection0", brandSection);
                    valuesObjects.Add("season0", season);

                    var parameterCollection = ConvertToParamters(valuesObjects);

                    fullCount = context.TblColorLinks.Include("TblColor1").Where(filter, parameterCollection.ToArray()).Count();
                    query     = context.TblColorLinks.Include("TblColor1").Where(filter, parameterCollection.ToArray()).OrderBy(sort).Skip(skip).Take(take);
                }
                else
                {
                    fullCount = context.TblColorLinks.Include("TblColor1").Count(x => x.TblBrand == brand && x.TblLkpBrandSection == brandSection && x.TblLkpSeason == season);
                    query     = context.TblColorLinks.Include("TblColor1").Where(x => x.TblBrand == brand && x.TblLkpBrandSection == brandSection && x.TblLkpSeason == season).OrderBy(sort).Skip(skip).Take(take);
                }
                return(query.ToList());
            }
        }
Esempio n. 23
0
 public List <TblDyeingSummaryAcc> GetDyeingSummaryAcc(int headerIserial)
 {
     using (var entities = new WorkFlowManagerDBEntities())
     {
         return(entities.TblDyeingSummaryAccs.Where(x => x.DyeingHeader == headerIserial).ToList());
     }
 }
Esempio n. 24
0
        private void CopyColorLink(TblColorLink newRow, string brand, int brandsection, int season)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                var colorList = (from e in context.TblColorLinks
                                 where e.TblLkpSeason == newRow.TblLkpSeason &&
                                 e.TblLkpBrandSection == newRow.TblLkpBrandSection &&
                                 e.TblBrand == newRow.TblBrand
                                 select e
                                 ).ToList();

                foreach (var tblColorLink in colorList)
                {
                    var oldRow = (from e in context.TblColorLinks
                                  where e.TblLkpSeason == season &&
                                  e.TblBrand == brand &&
                                  e.TblLkpBrandSection == brandsection &&
                                  e.TblColor == tblColorLink.TblColor
                                  select e).SingleOrDefault();
                    if (oldRow == null)
                    {
                        var row = new TblColorLink
                        {
                            TblBrand           = brand,
                            TblLkpBrandSection = brandsection,
                            TblLkpSeason       = season,
                            TblColor           = tblColorLink.TblColor
                        };
                        context.TblColorLinks.AddObject(row);
                    }
                }
                context.SaveChanges();
            }
        }
Esempio n. 25
0
 public List <PrintingBarcodeProperty> GetBarcodeProperty()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.PrintingBarcodeProperties.ToList());
     }
 }
Esempio n. 26
0
 public List <Warehouse> GetWareHouses()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.WareHouses.ToList());
     }
 }
Esempio n. 27
0
        public void UpdateAndSaveBarcodeDisplaySettingsDetails(int BarcodeDisplaySettingsHeader, double?FontSize, bool?BoldProperty, bool?ItalicProperty, double CanvasTop, double CanvasLeft, string FontFamily, int propertyIserial, string PropertyName, string PropertyNameArabic, string PropertyType)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                var newRecord         = false;
                var displayDetailsRow = (from h in context.BarcodeDisplaySettingsDetails
                                         where h.BarcodeDisplaySettingsHeader == BarcodeDisplaySettingsHeader && h.printingPropertiesIserial == propertyIserial &&
                                         h.PropertyName == PropertyName
                                         select h).SingleOrDefault();
                if (displayDetailsRow == null)
                {
                    displayDetailsRow = new BarcodeDisplaySettingsDetail();
                    newRecord         = true;
                }

                displayDetailsRow.BarcodeDisplaySettingsHeader = BarcodeDisplaySettingsHeader;
                displayDetailsRow.PropertyName              = PropertyName;
                displayDetailsRow.PropertyNameArabic        = PropertyNameArabic;
                displayDetailsRow.PropertyType              = PropertyType;
                displayDetailsRow.FontSize                  = FontSize;
                displayDetailsRow.BoldProperty              = BoldProperty;
                displayDetailsRow.ItalicProperty            = ItalicProperty;
                displayDetailsRow.FontFamily                = FontFamily;
                displayDetailsRow.CanvasLeft                = CanvasLeft;
                displayDetailsRow.CanvasTop                 = CanvasTop;
                displayDetailsRow.printingPropertiesIserial = propertyIserial;

                if (newRecord)
                {
                    context.BarcodeDisplaySettingsDetails.AddObject(displayDetailsRow);
                }
                context.SaveChanges();
            }
        }
Esempio n. 28
0
 public List <V_Warehouse> GetAllWarehousesByCompanyName(string company)
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.V_Warehouse.Where(x => x.DataAreaID.ToLower() == company.ToLower()).ToList());
     }
 }
Esempio n. 29
0
        public string UpdateAndSaveBarcodeDisplaySettingsHeader(int Iserial, int barcodeOperation, string PrintingBarcodeFormate, double BarcodeWidth, double BarcodeHeight, string code, double PageWidth, double PageHeight, string PageSizeUnit)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                var displayHeaderRow = new BarcodeDisplaySettingsHeader();

                if (Iserial != 0)
                {
                    displayHeaderRow = (from h in context.BarcodeDisplaySettingsHeaders
                                        where h.Iserial == Iserial
                                        select h).SingleOrDefault();
                }

                displayHeaderRow.BarcodeOperation       = barcodeOperation;
                displayHeaderRow.PrintingBarcodeFormate = PrintingBarcodeFormate;
                displayHeaderRow.BarcodeWidth           = BarcodeWidth;
                displayHeaderRow.BarcodeHeight          = BarcodeHeight;
                displayHeaderRow.Code         = code;
                displayHeaderRow.PageHeight   = PageHeight;
                displayHeaderRow.PageWidth    = PageWidth;
                displayHeaderRow.PageSizeUnit = PageSizeUnit;
                if (Iserial == 0)
                {
                    context.BarcodeDisplaySettingsHeaders.AddObject(displayHeaderRow);
                }
                context.SaveChanges();
                return(code);
            }
        }
Esempio n. 30
0
 public List <TblAuthJob> GetAllJobs()
 {
     using (var context = new WorkFlowManagerDBEntities())
     {
         return(context.TblAuthJobs.ToList());
     }
 }