Example #1
0
 public List <Store> GetStoresList()
 {
     return(exceptionTrap.Catch(delegate()
     {
         List <Store> result;
         using (SomeLinqDataContext lis = new SomeLinqDataContext(builder.ConnectionString))
         {
             lis.CommandTimeout = connectionTimeOut;
             result = lis
                      .mpzGetMxList()
                      .Select(
                 s => new Store
             {
                 OidStore = s.OidStore,
                 StoreString = s.StoreString,
                 Higher = s.Higher ?? Guid.Empty
             })
                      .ToList();
         }
         return result;
     }));
 }
Example #2
0
 public IEnumerable <string> GetStoreCells()
 {
     return(exceptionTrap.Catch(delegate()
     {
         List <string> result;
         using (SomeLinqDataContext sl = new SomeLinqDataContext(builder.ConnectionString))
         {
             sl.CommandTimeout = connectionTimeOut;
             var listCells = sl.СкладскаяЯчейкаs
                             .Where(
                 w => w.GCRecord == null)
                             .Select(
                 s => s.Наименование)
                             .Distinct()
                             .OrderBy(o => o)
                             .ToList();
             listCells.Insert(0, "");
             result = listCells;
         }
         return result;
     }));
 }
Example #3
0
        public bool UpdateStoreCell(Guid guid, string cell)
        {
            return(exceptionTrap.Catch(() =>
            {
                using (SomeLinqDataContext sl = new SomeLinqDataContext(builder.ConnectionString))
                {
                    sl.CommandTimeout = connectionTimeOut;
                    if (cell == "")
                    {
                        var n = sl.НоменклатурнаяПозицияs
                                .Where(
                            w => w.Oid == guid)
                                .Select(
                            s => s)
                                .FirstOrDefault();

                        n.ЯчейкаОтпуска = (Guid?)null;
                        sl.SubmitChanges();
                    }
                    Guid cellGui = sl.СкладскаяЯчейкаs
                                   .Where(
                        w => w.Наименование == cell)
                                   .Select(
                        s => s.Oid)
                                   .FirstOrDefault();
                    var nn = sl.НоменклатурнаяПозицияs
                             .Where(
                        w => w.Oid == guid)
                             .Select(
                        s => s)
                             .FirstOrDefault();
                    nn.ЯчейкаОтпуска = cellGui;
                    sl.SubmitChanges();
                }
            }));
        }