Exemplo n.º 1
0
        protected void gvDirecciones_RowInserting(object sender, ASPxDataInsertingEventArgs e)
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var x    = ((List <BEClientAddress>)Session["dire"]).Count;
            var line = new BEClientAddress()
            {
                Address        = Convert.ToString(e.NewValues["Address"]),
                Street         = Convert.ToString(e.NewValues["Street"]),
                State          = Convert.ToString(e.NewValues["State"]),
                StateName      = Convert.ToString(e.NewValues["StateName"]),
                AdresType      = Convert.ToString(e.NewValues["AdresType"]),
                Active         = Convert.ToString(e.NewValues["Active"]),
                U_DXP_BIZ_COPR = Convert.ToString(e.NewValues["U_DXP_BIZ_COPR"]),
                U_DXP_BIZ_PROV = Convert.ToString(e.NewValues["U_DXP_BIZ_PROV"]),
                U_DXP_BIZ_CODI = Convert.ToString(e.NewValues["U_DXP_BIZ_CODI"]),
                U_DXP_BIZ_DIST = Convert.ToString(e.NewValues["U_DXP_BIZ_DIST"]),
                U_DXP_BIZ_ZONA = Convert.ToString(e.NewValues["U_DXP_BIZ_ZONA"]),
                GlblLocNum     = Convert.ToString(e.NewValues["GlblLocNum"]),
                Building       = Convert.ToString(e.NewValues["Building"]),
                StreetNo       = Convert.ToString(e.NewValues["StreetNo"]),
                Linea          = x
            };

            ((List <BEClientAddress>)Session["dire"]).Add(line);
            Set_LineNum_Direcciones();
            gvDirecciones.CancelEdit();
            e.Cancel = true;
            gvDirecciones.DataSource = ((List <BEClientAddress>)Session["dire"]);
            gvDirecciones.DataBind();
        }
Exemplo n.º 2
0
        protected void listdirecciones_Callback(object sender, CallbackEventArgsBase e)
        {
            var obec = ((BEParameters)Session["InitPar"]);

            //var x = listdirecciones.SelectedItems[1].Text;


            if (e.Parameter.Contains("ADDITEM"))
            {
                var             spl = e.Parameter.Split(':');
                BEClientAddress line;
                var             direc = spl[1].Split('-');

                for (var i = 0; i < direc.Count(); i++)
                {
                    var item = direc[i].Split(';');

                    line = new BEClientAddress()
                    {
                        Address        = item[0].Trim(),
                        Street         = item[1].Trim(),
                        Country        = "PE",
                        AdresType      = item[8].Trim(),
                        State          = item[3].Trim(),
                        U_DXP_BIZ_COPR = item[4].Trim(),
                        U_DXP_BIZ_PROV = item[5].Trim(),
                        U_DXP_BIZ_CODI = item[6].Trim(),
                        U_DXP_BIZ_DIST = item[7].Trim(),
                        Linea          = i,
                    };

                    ((List <BEClientAddress>)Session["dire"]).Add(line);
                    Set_LineNum_Direcciones();
                }


                //var line = new BEClientAddress();

                //line.Address = textAddress.Text;
                //line.Street = txtStreet.Text;
                //line.Country = "PE";
                //line.AdresType = rdbtntipofact.SelectedItem.Value.ToString();
                //line.State = cbbState.Value.ToString();
                //line.U_DXP_BIZ_COPR = cbbU_DXP_BIZ_COPR.Value.ToString();
                //line.U_DXP_BIZ_PROV = cbbU_DXP_BIZ_COPR.Text;
                //line.U_DXP_BIZ_CODI = cbbU_DXP_BIZ_CODI.Value.ToString();
                //line.U_DXP_BIZ_DIST = cbbU_DXP_BIZ_CODI.Text;

                //((List<BEClientAddress>)Session["dire"]).Add(line);
                //Set_LineNum_Direcciones();
            }
            else if (e.Parameter.Contains("SRCH"))
            {
                var lista = "";
                var spl   = e.Parameter.Split(':');
                ListaDirecciones.Where(i => i.Address == spl[0]).ToList().ForEach(item =>
                {
                    lista = item.Address + "," + item.Street + "," + item.State + ","
                            + item.U_DXP_BIZ_COPR + ',' + item.U_DXP_BIZ_CODI + "," + item.AdresType;
                });
            }
        }