Ejemplo n.º 1
0
        internal List <Attachments> GetProductAttachments(int orderID, string prodName)
        {
            string query = "PORDERS?$filter=ORD eq " + orderID + "&$expand=EXTFILES_SUBFORM($filter=SHR_PARTNAME eq '" + prodName + "')";

            query = query.Replace("\"", "");

            string             res = Call_Get(query);
            List <Attachments> lst = null;

            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            if (null == ow)
            {
                return(lst);
            }

            if (null == ow.Value[0].EXTFILES_SUBFORM)
            {
                return(lst);
            }

            lst = new List <Attachments>();
            foreach (Attachments item in ow.Value[0].EXTFILES_SUBFORM)
            {
                lst.Add(item);
            }
            return(lst);
        }
Ejemplo n.º 2
0
        internal List <Order> GetSupplierOrders(string supplier)
        {
            OrdersWarpper ow = null;
            string        portalOrderStatus = GetOrderStatus();

            if (string.IsNullOrEmpty(portalOrderStatus))
            {
                AppLogger.log.Error("GetSupplierOrders ==> No oreders status were found!!!");
                return(new List <Order>());
            }
            try
            {//STATDES eq 'מאושרת' or STATDES eq 'נשלחה-עדכון' or STATDES eq 'נשלחה' or STATDES eq 'אישור ספק' or STATDES eq 'פתיחה חוזרת' or STATDES eq 'מוקפאת'
                string query = "PORDERS?$filter=SUPNAME eq '" + supplier + "' and CLOSEDBOOL ne 'Y' and(" + portalOrderStatus + ")&$select=EFI_ETYPEDES, EFI_ESTATDES,CURVERSION, TYPEDES, CLOSEDBOOL, ORDNAME,STATDES,CURDATE,ORD,CODEDES,SUPNAME,CDES,SHR_SUPTYPEDES,OWNERLOGIN&$expand=PORDERITEMS_SUBFORM($filter=CLOSEDBOOL ne 'Y';$expand=PORDERITEMSTEXT_SUBFORM)";
                string res   = Call_Get(query);

                ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);
                if ((null != ow) && (null != ow.Value) && (ow.Value.Count > 0))
                {
                    return(ow.Value);
                }
            }
            catch (Exception ex)
            {
                AppLogger.log.Error("GetSupplierOrders ==> supplier = " + supplier, ex);
            }
            return(new List <Order>());
        }
Ejemplo n.º 3
0
        internal Order GetOrderProductDetails(int orderID, string prodName)
        {
            string query = "PORDERS?$filter=ORD eq  " + orderID + "&$select=CURVERSION, TYPECODE, TYPEDES, ORDNAME,STATDES,CURDATE,ORD,CODEDES,SUPNAME,CDES,SHR_SUPTYPEDES,OWNERLOGIN&$expand=EXTFILES_SUBFORM($filter=SHR_PARTNAME eq '" + prodName + "'),PORDERITEMS_SUBFORM($filter=PARTNAME eq '" + prodName + "';$expand=PORDERITEMSTEXT_SUBFORM)";
            string res   = Call_Get(query);

            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            return(ow.Value[0]);
        }
Ejemplo n.º 4
0
        internal List <Revision> GetProdRevisionList(string oRDNAME, string supplierName, string pARTNAME, string rEVNAME)
        {
            //PART?$filter=PARTNAME eq '23559000'&$expand=REVISIONS_SUBFORM($filter=REVNUM eq 'C';$expand=MED_PARTQA_R_SUBFORM)
            //MED_SAMPLE?$filter=PARTNAME eq '" + pARTNAME + "' and SHR_SER_ORDER eq '" + oRDNAME + "' and SUPNAME eq '" + supplierName + "')"
            string query = "/PART?$filter=PARTNAME eq '" + pARTNAME + "'&$expand=REVISIONS_SUBFORM($filter=REVNUM eq '" + rEVNAME + "';$expand=MED_PARTQA_R_SUBFORM)";
            string res   = Call_Get(query);

            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            return(null);
        }
Ejemplo n.º 5
0
        internal Order GetProductDetailse(string SUPNAME, string ORDNAME, string PARTNAME)
        {
            //string query = "PORDERS?$filter=SUPNAME eq '" + SUPNAME + "' and ORDNAME eq '" + ORDNAME + "'&$expand=PORDERITEMS_SUBFORM($filter=PARTNAME eq '" + PARTNAME + "')";
            string query = "PORDERS?$filter=SUPNAME eq '" + SUPNAME + "' and ORDNAME eq '" + ORDNAME + "'&$select=EFI_ETYPEDES, EFI_ESTATDES,TYPECODE, TYPEDES, ORDNAME,STATDES,CURDATE,ORD,CODEDES,SUPNAME,CDES,SHR_SUPTYPEDES,OWNERLOGIN&$expand=PORDERITEMS_SUBFORM($filter=PARTNAME eq '" + PARTNAME + "';$expand=PORDERITEMSTEXT_SUBFORM)";
            string res   = Call_Get(query);

            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            if ((null != ow) && (null != ow.Value) && (ow.Value.Count > 0))
            {
                return(ow.Value[0]);
            }
            return(null);
        }
Ejemplo n.º 6
0
        internal Order GetOrderProductDetailsByLine(int orderID, string prodName, int ordLine)
        {
            string query = "PORDERS?$filter=ORD eq  " + orderID + "&$select=EFI_ETYPEDES, EFI_ESTATDES,CURVERSION, TYPECODE, TYPEDES, ORDNAME,STATDES,CURDATE,ORD,CODEDES,SUPNAME,CDES,SHR_SUPTYPEDES,OWNERLOGIN&$expand=EXTFILES_SUBFORM($filter=SHR_PARTNAME eq '" + prodName + "'),PORDERITEMS_SUBFORM($filter=PARTNAME eq '" + prodName + "' and LINE eq " + ordLine + ";$expand=PORDERITEMSTEXT_SUBFORM),PORDERSTEXT_SUBFORM";
            string res   = Call_Get(query);

            if (null == res)
            {
                AppLogger.log.Info("GetOrderProductDetailsByLine ERROR ==> query = " + query);
                return(null);
            }

            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            return(ow.Value[0]);
        }
Ejemplo n.º 7
0
        internal Order GetOrderDetails(int orderID)
        {
            //"/PORDERS?$filter=ORD eq " + orderID + "&$expand=EXTFILES_SUBFORM,PORDERITEMS_SUBFORM($expand=PORDERITEMSTEXT_SUBFORM)";
            string query = "PORDERS?$filter=ORD eq " + orderID + "&$select=EFI_ETYPEDES, EFI_ESTATDES, CURVERSION, TYPECODE, TYPEDES, ORDNAME,STATDES,CURDATE,ORD,CODEDES,SUPNAME,CDES,SHR_SUPTYPEDES,OWNERLOGIN&$expand=PORDERITEMS_SUBFORM($filter=CLOSEDBOOL ne 'Y';$expand=PORDERITEMSTEXT_SUBFORM),PORDERSTEXT_SUBFORM";
            string res   = Call_Get(query);

            if (null == res)
            {
                AppLogger.log.Info("GetOrderDetails ERROR ==> query = " + query);
                return(null);
            }
            OrdersWarpper ow = JsonConvert.DeserializeObject <OrdersWarpper>(res);

            return(ow.Value[0]);
        }