Example #1
0
        public bool AmalgammaFSTI_IMTR01(string FSTI_fields, string Ammalgamma_User)
        {
            //Transaction Object
            IMTR01 MyIMTR01 = new IMTR01();

            //IntemNumber,STK-BINFrom,InvCatFrom,STK-BINTo,InvCatTo,Qty
            string[] Fields_Array = FSTI_fields.Split(',');

            //Item Number
            MyIMTR01.ItemNumber.Value = Fields_Array[0];

            //from

            string[] LocFrom = Fields_Array[1].Split('-');
            string   BinFrom = "";

            if (LocFrom.Count() > 2)
            {
                for (int i = 1; i < LocFrom.Count(); i++)
                {
                    if (i == 1)
                    {
                        BinFrom += LocFrom[i];
                    }
                    else
                    {
                        BinFrom += "-" + LocFrom[i];
                    }
                }
            }
            else
            {
                BinFrom = LocFrom[1];
            }

            MyIMTR01.StockroomFrom.Value = LocFrom[0];
            MyIMTR01.BinFrom.Value       = BinFrom;

            MyIMTR01.InventoryCategoryFrom.Value = Fields_Array[2];

            //to

            //IntemNumber,STK-BINFrom,InvCatFrom,STK-BINTo,InvCatTo,Qty

            string[] LocTo = Fields_Array[3].Split('-');
            string   BinTo = "";

            if (LocTo.Count() > 2)
            {
                for (int i = 1; i < LocTo.Count(); i++)
                {
                    if (i == 1)
                    {
                        BinTo += LocTo[i];
                    }
                    else
                    {
                        BinTo += "-" + LocTo[i];
                    }
                }
            }
            else
            {
                BinTo = LocTo[1];
            }


            MyIMTR01.StockroomTo.Value = LocTo[0];
            MyIMTR01.BinTo.Value       = BinTo;

            MyIMTR01.InventoryCategoryTo.Value = Fields_Array[4];

            //QTY
            MyIMTR01.InventoryQuantity.Value = Fields_Array[5];
            MyIMTR01.LotIdentifier.Value     = "N";


            CDFResponse = MyIMTR01.GetString(TransactionStringFormat.fsCDF);

            if (_fstiClient.ProcessId(MyIMTR01, null))
            {
                //
                FSTI_ErrorMsg   = "";
                Trans_Error_Msg = "";

                FSTI_Log(CDFResponse, Ammalgamma_User, "ITMB03", "");

                return(true);
            }
            else
            {
                // failure, retrieve the error object
                // and then dump the information in the list box
                itemError       = null;
                itemError       = _fstiClient.TransactionError;
                Trans_Error_Msg = itemError.Description;
                // DumpErrorObject(myItem, itemError);

                FSTI_Log(CDFResponse, Ammalgamma_User, "ITMB03", Trans_Error_Msg);
                return(false);
            }
        }