Ejemplo n.º 1
0
        /// <summary>
        /// Convert Product To
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="fields"></param>
        /// <returns></returns>
        public Decimal?ConvertProductTo(Ctx ctx, string fields)
        {
            string[] paramValue = fields.ToString().Split(',');

            //Assign parameter value
            int     M_Product_ID = Util.GetValueOfInt(paramValue[0].ToString());
            int     C_UOM_To_ID  = Util.GetValueOfInt(paramValue[1].ToString());
            Decimal?QtyEntered   = Util.GetValueOfDecimal(paramValue[2].ToString());

            //End Assign parameter value


            return(MUOMConversion.ConvertProductTo(ctx, M_Product_ID,
                                                   C_UOM_To_ID, QtyEntered));
        }
Ejemplo n.º 2
0
        public JsonResult ConvertProductTo(string fields)
        {
            string retError = "";
            string retJSON  = "";

            if (Session["ctx"] != null)
            {
                VAdvantage.Utility.Ctx ctx = Session["ctx"] as Ctx;
                string[] paramValue = fields.Split(',');
                int      M_Product_ID, C_UOM_To_ID, QtyEntered;

                //Assign parameter value
                M_Product_ID = Util.GetValueOfInt(paramValue[0].ToString());
                C_UOM_To_ID  = Util.GetValueOfInt(paramValue[1].ToString());
                QtyEntered   = Util.GetValueOfInt(paramValue[2].ToString());


                //End Assign parameter value
                //var QtyOrdered = Utility.Util.getValueOfDecimal(mTab.getValue("QtyOrdered"));
                //var M_Warehouse_ID = ctx.getContextAsInt(WindowNo, "M_Warehouse_ID");
                //var M_AttributeSetInstance_ID = ctx.getContextAsInt(WindowNo, "M_AttributeSetInstance_ID");

                Decimal?retValue = (Decimal?)MUOMConversion.ConvertProductTo(ctx, M_Product_ID,
                                                                             C_UOM_To_ID, QtyEntered);


                List <Decimal?> retlst = new List <Decimal?>();

                retlst.Add(retValue);

                //retVal.Add(notReserved);


                retJSON = JsonConvert.SerializeObject(retlst);
            }
            else
            {
                retError = "Session Expired";
            }
            return(Json(new { result = retJSON, error = retError }, JsonRequestBehavior.AllowGet));
        }