예제 #1
0
        public List <TopstockFormItem> GetTopstockForms()
        {
            var VReturn = new List <TopstockFormItem>();

            try
            {
                using (var sapConnection = new SAP.Connector.SAPConnection(GlobalContext.SapDestination))
                {
                    using (var prx = new SAPProxyReqTopstock.SAPProxyReqTopstock())
                    {
                        prx.Connection = sapConnection;
                        var itIn = new SAPProxyReqTopstock.ZFORM_TSTTable();
                        prx.Z_Gtopstock_Forms(ref itIn);
                        foreach (SAPProxyReqTopstock.ZFORM_TST item in itIn)
                        {
                            VReturn.Add(new TopstockFormItem {
                                FormCode = item.Vtext, FromName = item.Ttext
                            });
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(VReturn);
        }
예제 #2
0
        public TopStockHeader CreateTopstockDoc(TopStockHeader TopIn)
        {
            var VReturn = new TopStockHeader();

            try
            {
                using (var sapConnection = new SAP.Connector.SAPConnection(GlobalContext.SapDestination))
                {
                    using (var prx = new SAPProxyReqTopstock.SAPProxyReqTopstock())
                    {
                        prx.Connection = sapConnection;
                        var itIn   = new SAPProxyReqTopstock.ZREQTOPSTOCKTable();
                        var Msg    = "";
                        var ZDocNo = "";
                        foreach (var item in TopIn.Items)
                        {
                            var ItemAdd = new SAPProxyReqTopstock.ZREQTOPSTOCK();
                            ItemAdd.Bar         = item.BAR;
                            ItemAdd.Barcode     = item.BARCODE;
                            ItemAdd.Fname       = item.FNAME;
                            ItemAdd.Lgort       = item.LGORT;
                            ItemAdd.Lgort_Txt   = item.LGORT_TXT;
                            ItemAdd.Location_S  = item.LOCATION_S;
                            ItemAdd.Location_T  = item.LOCATION_T;
                            ItemAdd.Locclass    = item.LOCCLASS;
                            ItemAdd.Lochole     = item.LOCHOLE;
                            ItemAdd.Lochshelf   = item.LOCHSHELF;
                            ItemAdd.Locside     = item.LOCSIDE;
                            ItemAdd.Locside_Txt = item.LOCSIDE_TXT;
                            ItemAdd.Loczone     = item.LOCZONE;
                            ItemAdd.Loggr       = item.LOGGR;
                            ItemAdd.Loggr_Txt   = item.LOGGR_TXT;
                            ItemAdd.Matnr       = item.MATNR;
                            ItemAdd.Matnr_Txt   = item.MATNR_TXT;
                            ItemAdd.Meinh       = item.MEINH;
                            ItemAdd.Meinh_Txt   = item.MEINH_TXT;
                            ItemAdd.Qty         = item.QTY;
                            ItemAdd.Status      = item.STATUS;
                            ItemAdd.Msg         = item.MSG;
                            ItemAdd.Umrez       = item.UMREZ;
                            ItemAdd.Werks       = item.WERKS;
                            itIn.Add(ItemAdd);
                        }
                        prx.Z_Ctopstock_Hh(TopIn.EmpId, TopIn.WarhouseId, out ZDocNo, ref itIn);
                        if (ZDocNo.Trim() != "")
                        {
                            VReturn.Status  = true;
                            VReturn.ZDocNo  = ZDocNo;
                            VReturn.Message = Msg;
                        }
                        else
                        {
                            VReturn.Status  = false;
                            VReturn.Message = Msg;
                            VReturn.Items   = new List <TopStockItem>();
                            foreach (SAPProxyReqTopstock.ZREQTOPSTOCK item in itIn)
                            {
                                VReturn.Items.Add(new TopStockItem
                                {
                                    BAR         = item.Bar,
                                    BARCODE     = item.Barcode,
                                    FNAME       = item.Fname,
                                    LGORT       = item.Lgort,
                                    LGORT_TXT   = item.Lgort_Txt,
                                    LOCATION_S  = item.Location_S,
                                    LOCATION_T  = item.Location_T,
                                    LOCCLASS    = item.Locclass,
                                    LOCHOLE     = item.Lochole,
                                    LOCHSHELF   = item.Lochshelf,
                                    LOCSIDE     = item.Locside,
                                    LOCSIDE_TXT = item.Locside_Txt,
                                    LOCZONE     = item.Loczone,
                                    LOGGR       = item.Loggr,
                                    LOGGR_TXT   = item.Loggr_Txt,
                                    MATNR       = item.Matnr,
                                    MATNR_TXT   = item.Matnr_Txt,
                                    MEINH       = item.Meinh,
                                    MEINH_TXT   = item.Meinh_Txt,
                                    MSG         = item.Msg,
                                    QTY         = item.Qty,
                                    STATUS      = item.Status,
                                    UMREZ       = item.Umrez,
                                    WERKS       = item.Werks
                                });
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VReturn.Status  = false;
                VReturn.Message = ex.Message;
            }
            return(VReturn);
        }
예제 #3
0
        public TopStockHeader GetTopstockItems(string _ItemId, string _Barcode, string _Position, string _Branch, string _Warhouse, string _Status)
        {
            var VReturn = new TopStockHeader();

            try
            {
                using (var sapConnection = new SAP.Connector.SAPConnection(GlobalContext.SapDestination))
                {
                    using (var prx = new SAPProxyReqTopstock.SAPProxyReqTopstock())
                    {
                        prx.Connection = sapConnection;
                        var itIn   = new SAPProxyReqTopstock.ZREQTOPSTOCKTable();
                        var Msg    = "";
                        var Status = "";
                        prx.Z_Gtopstock_Items(_Branch, _Barcode, _ItemId, _Position, _Status, _Warhouse, out Msg, out Status, ref itIn);
                        if (Status.Trim().ToLower() == "y")
                        {
                            VReturn.Status = true;
                            VReturn.Items  = new List <TopStockItem>();
                            foreach (SAPProxyReqTopstock.ZREQTOPSTOCK item in itIn)
                            {
                                VReturn.Items.Add(new TopStockItem
                                {
                                    BAR         = item.Bar,
                                    BARCODE     = item.Barcode,
                                    FNAME       = item.Fname,
                                    LGORT       = item.Lgort,
                                    LGORT_TXT   = item.Lgort_Txt,
                                    LOCATION_S  = item.Location_S,
                                    LOCATION_T  = item.Location_T,
                                    LOCCLASS    = item.Locclass,
                                    LOCHOLE     = item.Lochole,
                                    LOCHSHELF   = item.Lochshelf,
                                    LOCSIDE     = item.Locside,
                                    LOCSIDE_TXT = item.Locside_Txt,
                                    LOCZONE     = item.Loczone,
                                    LOGGR       = item.Loggr,
                                    LOGGR_TXT   = item.Loggr_Txt,
                                    MATNR       = item.Matnr,
                                    MATNR_TXT   = item.Matnr_Txt,
                                    MEINH       = item.Meinh,
                                    MEINH_TXT   = item.Meinh_Txt,
                                    MSG         = item.Msg,
                                    QTY         = item.Qty,
                                    STATUS      = item.Status,
                                    UMREZ       = item.Umrez,
                                    WERKS       = item.Werks
                                });
                            }
                        }
                        else
                        {
                            VReturn.Status  = false;
                            VReturn.Message = Msg;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VReturn.Status  = false;
                VReturn.Message = ex.Message;
            }
            return(VReturn);
        }