Esempio n. 1
0
        /// <summary>
        /// De
        /// </summary>
        /// <param name="idWorkOrder"></param>
        /// <returns></returns>
        internal WorkOrders GetWorkOrder(String jsonKeys, out List <Tuple <Type, String> > paramsAditional)
        {
            paramsAditional = null;
            WorkOrderDmsV1Keys WorkOrderKeys = JsonConvert.DeserializeObject <WorkOrderDmsV1Keys>(jsonKeys);

            if (int.TryParse(WorkOrderKeys?.WorkOrderNumber, out int number) && short.TryParse(WorkOrderKeys?.IdErpShop, out short shop))
            {
                DataBase.Database.CommandTimeout = 10000;
                tall_encabeza_orden worOrderErp = null;
                if (ParamsContract?.SupportShop?.Length > 0)
                {
                    DateTime dateTime = new DateTime(2016, 1, 1);
                    if (ParamsContract.SupportShop.Contains(shop.ToString().ToUpper()))
                    {
                        worOrderErp = DataBase.tall_encabeza_orden.Where(w => w.numero == number && w.bodega == shop && w.fecha >= dateTime).OrderByDescending(w => w.fecha).FirstOrDefault();
                    }
                }

                if (worOrderErp != null)
                {
                    return(ParsheWorkOrder(worOrderErp, out paramsAditional));
                }
            }
            return(null);
        }
Esempio n. 2
0
        internal bool SupporItem(string jsonKeys)
        {
            WorkOrderDmsV1Keys WorkOrderKeys = JsonConvert.DeserializeObject <WorkOrderDmsV1Keys>(jsonKeys);

            return(ParamsContract.SupportShop.Contains(WorkOrderKeys.IdErpShop));
        }