Exemplo n.º 1
0
        private string UpdateItem()
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var obj  = new BEProduct();

            obj.ItemCode = txtItemcode.Text;
            obj.ItemName = txtItemname.Text;
            //obj.ItemType = Convert.ToString(cbbItemType.Value);
            obj.ItmsGrpCod = Convert.ToString(cbbItmsGrpCod.Value);
            obj.IssueMthd  = Convert.ToString(cbbIssueMthd.Value);
            //obj.MngMethod = Convert.ToString(cbbMngMethod.Value);
            obj.U_BPP_TIPEXIST = Convert.ToString(cbbTipExist.Value);
            obj.GLMethod       = Convert.ToString(cbbGLMethod.Value);
            /*PRECIOS CON SU LISTA - BOTON AGREGAR PARA AÑADIR PRECIO SEGUN SELECTED INDEX*/
            obj.InvntItem       = Convert.ToString(checkArticuloInventario.Value);
            obj.SellItem        = Convert.ToString(checkArticuloVenta.Value);
            obj.U_GOS_MARCA     = txtMarca.Text;
            obj.U_DXP_PLANINT   = Convert.ToString(cbbPlan.Text);
            obj.DetalleServicio = Convert.ToString(cbbDetalleServicio.Value);
            obj.U_GOS_MODELO    = txtModelo.Text;
            obj.PrchseItem      = Convert.ToString(checkArticuloCompra.Value);
            obj.ByWh            = Convert.ToString(checkByWh.Value);
            obj.Active          = Convert.ToString(rbtnestado.SelectedItem.Value);
            obj.BuyUnitMsr      = Convert.ToString(cbbBuyUnitMsr.Value);
            obj.NumInBuy        = Convert.ToInt32(txtNuminBuy.Text);
            obj.PurPackMsr      = Convert.ToString(cbbPurPackMsr.Value);
            obj.PurPackUn       = Convert.ToInt32(txtPurPackUn.Text);
            obj.TaxCodeAP       = Convert.ToString(cbbTaxCodeAP.Value);
            obj.SalUnitMsr      = Convert.ToString(cbbSalUnitMsr.Value);
            obj.NumInSale       = Convert.ToInt32(txtNuminSale.Text);
            obj.SalPackMsr      = Convert.ToString(cbbSalPackMsr.Value);
            obj.SalPackUn       = Convert.ToInt32(txtSalPackUn.Text);
            obj.TaxCodeAR       = Convert.ToString(cbbTaxCodeAR.Value);
            obj.ActivoC         = Convert.ToString(checkContrato.Value);
            obj.ActivoS         = Convert.ToString(checkServicio.Value);
            obj.NoFacturable    = Convert.ToString(checkFacturable.Value);
            obj.InvntryUom      = Convert.ToString(cbbInvntryUOM.Value);
            //obj.LastPurCur = "SOL";
            //obj.LastPurPrc = Convert.ToDecimal(txtPrice.Text);

            obj.Almacenes = ((List <BEAlmacen>)Session["oitw"]);
            obj.Precios   = ((List <BEPrice>)Session["opln"]);

            using (var obrd = new BRDocument())
            {
                obrd.UpdateItems(obj, ((BEParameters)Session["InitPar"]).objSapSbo);
            }
            var _err = !string.IsNullOrWhiteSpace(obj.Msg) ? obj.Msg : "OKUPDBP";

            //Init_VarSessions();
            return(_err);
        }
        private void Qua_BatchNum()
        {
            ((List <BEDocumentLine>)Session["rin1"]).ForEach(item =>
            {
                if (!string.IsNullOrWhiteSpace(item.BatchNum))
                {
                    var _arlt = item.BatchNum.Split('#');
                    var _oibt = new List <BEProduct>();
                    _arlt.ToList()
                    .ForEach(i =>
                    {
                        var _larl = i.Split('!');
                        var _i    = new BEProduct()
                        {
                            BatchNum = _larl[0], Quantity = Convert.ToInt32(_larl[1])
                        };
                        _oibt.Add(_i);
                    });

                    var batn    = string.Empty;
                    var qtemp   = item.Quantity;
                    var dobreak = false;
                    _oibt.ForEach(_item =>
                    {
                        if (dobreak)
                        {
                            return;
                        }
                        var _quan = qtemp - _item.Quantity;
                        if (_quan <= 0)
                        {
                            batn           = string.Format("{0}{1}¡{2}!", batn, _item.BatchNum, qtemp);
                            _item.Quantity = _item.Quantity - qtemp;
                            dobreak        = true;
                        }
                        else
                        {
                            batn           = string.Format("{0}{1}¡{2}!", batn, _item.BatchNum, _item.Quantity);
                            _item.Quantity = 0;
                            qtemp          = _quan;
                        }
                    });
                    item.BatchNums = batn;
                    var _spl       = item.BatchNums.Split('¡');
                    item.U_BF_LOTE = _spl[0];
                }
            });
        }
Exemplo n.º 3
0
        protected void gdvHijos_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            var obec = ((BEParameters)Session["InitPar"]);

            if (e.Parameters.Contains("GET"))
            {
                var spl  = e.Parameters.Split(':');
                var obep = new BEParameters()
                {
                    Socied   = obec.Socied,
                    ItemCode = spl[1],
                    //WhsCode = obec.WhsCode
                };
                var obrd = new BRDocument();
                var olst = obrd.DXP_GET_HIJOS_KITS(obep);
                Session["itt1"]     = olst;
                gdvHijos.DataSource = olst;
                gdvHijos.DataBind();
            }
            else if (e.Parameters.Contains("CLR"))
            {
                ((List <BEProduct>)Session["itt1"]).Clear();
                gdvHijos.DataSource = Session["itt1"];
                gdvHijos.DataBind();
            }
            else if (e.Parameters.Contains("ADDPRODUCT"))
            {
                var spl  = e.Parameters.Split(':');
                var Hijo = spl[1].Split(',');
                var line = new BEProduct()
                {
                    Code       = Hijo[0],
                    ItemName   = Hijo[1],
                    Quantity2  = Convert.ToDecimal(Hijo[2]),
                    InvntryUom = Hijo[4],
                    Warehouse  = Hijo[3]
                };
                ((List <BEProduct>)Session["itt1"]).Add(line);
                Set_LineNum();
                gdvHijos.DataSource = Session["itt1"];
                gdvHijos.DataBind();
            }
        }
Exemplo n.º 4
0
        private string UpdateKits()
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var obj  = new BEProduct();

            obj.ItemCode = bteItemcode.Text;
            obj.ItemName = txtItemName.Text;
            obj.TreeType = cbbTreeType.Value.ToString();
            obj.HideComp = checkHideComp.Value.ToString();
            obj.Hijos    = ((List <BEProduct>)Session["itt1"]);

            using (var obrd = new BRDocument())
            {
                obrd.UpdateKits(obj, ((BEParameters)Session["InitPar"]).objSapSbo);
            }
            var _err = !string.IsNullOrWhiteSpace(obj.Msg) ? obj.Msg : "OKBP";

            return(_err);
        }
Exemplo n.º 5
0
        protected void gdvHijos_RowInserting(object sender, ASPxDataInsertingEventArgs e)
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var x    = ((List <BEProduct>)Session["itt1"]).Count;
            var line = new BEProduct()
            {
                Code       = Convert.ToString(e.NewValues["Code"]),
                ItemName   = Convert.ToString(e.NewValues["ItemName"]),
                Warehouse  = Convert.ToString(e.NewValues["Warehouse"]),
                Quantity2  = Convert.ToDecimal(e.NewValues["Quantity2"]),
                InvntryUom = Convert.ToString(e.NewValues["InvntryUom"]),
                Linea      = x
            };

            Set_LineNum();
            ((List <BEProduct>)Session["itt1"]).Add(line);
            gdvHijos.CancelEdit();
            e.Cancel            = true;
            gdvHijos.DataSource = ((List <BEProduct>)Session["itt1"]);
            gdvHijos.DataBind();
        }