protected void PaintAutoComplete()
        {
            MembershipUser currentUser = Membership.GetUser();
            Guid VolID = (Guid)currentUser.ProviderUserKey;
            List<sp_VolSkill_DM> dt = VolSkillBLL.ListVolSkills(VolID);

            foreach (sp_VolSkill_DM item in dt)
            {
                AutoCompleteBoxEntry autoItem = new AutoCompleteBoxEntry();
                autoItem.Value = item.SkillID.ToString();
                autoItem.Text = item.SkillName.ToString();
                rACSkills.Entries.Add(autoItem);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles the OnClick event of the rbAddRole control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void rbAddRole_OnClick(object sender, EventArgs e)
        {
            var entry = new AutoCompleteBoxEntry {
                Text = dcbContactRolePopup.SelectedText, Value = "Role|" + dcbContactRolePopup.SelectedId
            };

            racbRecipientsPopup.Entries.Add(entry);
            RecipientsPopupList.Add(new SiteActionTemplateRecipientMap {
                ContactRoleID = dcbContactRolePopup.SelectedId, Key = "Role|" + dcbContactRolePopup.SelectedId
            });

            if (!Page.ClientScript.IsStartupScriptRegistered(this.ClientID + "_AutoHeight"))
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), this.ClientID + "_AutoHeight", this.ClientID + "_AutoHeight();", true);
            }
        }
        private void Item_Cargar(decimal idPrecioCliente)
        {
            ItemWCFClient  objItemWCF     = new ItemWCFClient();
            VBG01124Result objProducto    = new VBG01124Result();
            VBG01134Result objCliente     = new VBG01134Result();
            string         ID_Item        = null;
            decimal?       precioEspecial = null;
            DateTime?      vigInicio      = null;
            DateTime?      vigFinal       = null;

            try
            {
                btnBuscarProducto.Visible = false;
                objItemWCF.Item_BuscarPrecioCliente(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                    ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idPrecioCliente, ref precioEspecial, ref vigInicio,
                                                    ref vigFinal, ref objCliente, ref objProducto, ref ID_Item);
                AutoCompleteBoxEntry entry = new AutoCompleteBoxEntry();
                entry.Text = objCliente.ID_Agenda + "-" + objCliente.Nombre;
                acbCliente.Entries.Add(entry);
                acbCliente.Enabled = false;
                entry      = new AutoCompleteBoxEntry();
                entry.Text = ID_Item + "-" + objProducto.Nombre;
                acbProducto.Entries.Add(entry);
                acbProducto.Enabled        = false;
                txtKardex.Text             = objProducto.Item_ID.ToString();
                cboMoneda.SelectedValue    = objProducto.ID_Moneda.ToString();
                txtPrecio.Text             = objProducto.Precio.ToString();
                txtUnidad.Text             = objProducto.UnidadInv;
                txtPrecEspecial.Value      = Convert.ToDouble(precioEspecial);
                dpFechaInicio.SelectedDate = vigInicio;
                if (vigFinal != null)
                {
                    dpFechaFinal.SelectedDate = vigFinal;
                }
                else
                {
                    dpFechaFinal.Enabled = false;
                    btnTermino.Checked   = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Handles the OnClick event of the rbAddCustom control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void rbAddCustom_OnClick(object sender, EventArgs e)
        {
            var entryText = !string.IsNullOrEmpty(txtDisplayNamePopup.Text)
                                ? string.Format("{0} &lt;{1}&gt;", txtDisplayNamePopup.Text, txtEmailPopup.Text)
                                : string.Format("&lt;{0}&gt;", txtEmailPopup.Text);
            var entry = new AutoCompleteBoxEntry {
                Text = entryText
            };

            racbRecipientsPopup.Entries.Add(entry);
            RecipientsPopupList.Add(new SiteActionTemplateRecipientMap {
                Email = txtEmailPopup.Text, DisplayName = !string.IsNullOrEmpty(txtDisplayNamePopup.Text) ? txtDisplayNamePopup.Text : null
            });

            txtEmailPopup.Text       = string.Empty;
            txtDisplayNamePopup.Text = string.Empty;

            if (!Page.ClientScript.IsStartupScriptRegistered(this.ClientID + "_AutoHeight"))
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), this.ClientID + "_AutoHeight", this.ClientID + "_AutoHeight();", true);
            }
        }
        private void DocVenta_Cargar(decimal Op)
        {
            SolDevolucionWCFClient  objSolDevolucionWCF = new SolDevolucionWCFClient();
            gsDocVenta_BuscarResult objDocVenta;

            gsDocVenta_BuscarDetalleResult[]   lstProductos = null;
            gsDevolucionSolicitud_BuscarResult objSolDev;

            gsDevolucionSolicitudDetalle_BuscarResult[] lstProdDev = null;
            try
            {
                if (Request.QueryString["idDevolucionSolicitud"] != "0")
                {
                    objSolDev = objSolDevolucionWCF.DevolucionSolicitud_Buscar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                               ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, int.Parse(Request.QueryString["idDevolucionSolicitud"]), ref lstProdDev);

                    //txtFlete.Value = Convert.ToDouble(objSolDev.flete);
                    //if (objSolDev.flete > 0)
                    //{
                    //    btnCobrarFlete.Checked = true;
                    //    txtFlete.Enabled = true;
                    //}
                    dpFechaDevolucion.SelectedDate = objSolDev.fechaEnvioDev;
                    dpFechaEnvio.SelectedDate      = objSolDev.fechaEnvio;

                    AutoCompleteBoxEntry entry = new AutoCompleteBoxEntry();
                    entry.Text = objSolDev.ID_Transportista + "-" + objSolDev.Transportista;
                    acbTransporte.Entries.Add(entry);

                    txtObservacion.Text          = objSolDev.observacion;
                    txtNroDocumento.Text         = objSolDev.idDevolucionSolicitud.ToString();
                    cboAlmacen.SelectedValue     = objSolDev.ID_Almacen.ToString();
                    cboMotivo.SelectedValue      = objSolDev.idDevolucionMotivo.ToString();
                    txtNroGuiaCliente.Text       = objSolDev.guiaCliente;
                    txtNroGuiaTransportista.Text = objSolDev.guiaTransportista;

                    if ((bool)objSolDev.aprobacion1)
                    {
                        btnGuardar.Enabled             = !(bool)objSolDev.aprobacion1;
                        btnAprobar.Text                = "Desaprobar";
                        btnAprobar.Icon.PrimaryIconUrl = "../../Images/Icons/sign-error-16.png";
                    }

                    ViewState["lstProductos"] = JsonHelper.JsonSerializer(lstProdDev);
                }

                objDocVenta = objSolDevolucionWCF.DocVenta_Buscar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                  ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, Op, ref lstProductos);
                txtCliente.Text           = objDocVenta.Agenda;
                txtZona.Text              = objDocVenta.ZonaVendedor;
                txtVendedor.Text          = objDocVenta.Vendedor;
                dpFechaVenta.SelectedDate = objDocVenta.Fecha;
                txtNroFactura.Text        = objDocVenta.Transaccion;

                grdDocVentaDetalle.DataSource = lstProductos;
                grdDocVentaDetalle.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Usuario"] == null)
            {
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true);
            }

            if (!ConnectionHelpers.CheckForInternetConnection())
            {
                throw new ArgumentException("ERROR: Revisar su conexión a internet.");
            }

            AutoCompleteBoxEntry entry;

            try {
                if (!Page.IsPostBack)
                {
                    LoginWCF.LoginWCFClient objLoginWCF = new LoginWCF.LoginWCFClient();
                    objLoginWCF.AuditoriaMenu_Registrar(System.Web.HttpContext.Current.Request.Url.AbsolutePath, Environment.MachineName,
                                                        ((Usuario_LoginResult)System.Web.HttpContext.Current.Session["Usuario"]).idUsuario);

                    dpFecEmision.SelectedDate = DateTime.Now;
                    txtIGV.Value      = 0;
                    txtImpBase.Value  = 0;
                    txtInafecto.Value = 0;
                    txtImporte.Value  = 0;
                    TipoGasto_Cargar();
                    Documento_ListarTipoCompra();
                    if (Request.QueryString["objRecibo"] != "0")
                    {
                        Title = "Modificar documnento";

                        gsEgresosVarios_BuscarDetalleResult objEVDetalle = JsonHelper.JsonDeserialize <gsEgresosVarios_BuscarDetalleResult>(Request.QueryString["objRecibo"]);

                        txtComentario.Text = objEVDetalle.Observaciones;

                        if (!string.IsNullOrEmpty(objEVDetalle.ID_Agenda))
                        {
                            entry      = new AutoCompleteBoxEntry();
                            entry.Text = objEVDetalle.ID_Agenda + "-" + objEVDetalle.Agenda;
                            acbProveedor.Entries.Add(entry);
                        }

                        if (!string.IsNullOrEmpty(objEVDetalle.ID_Item))
                        {
                            cboTipoGasto.SelectedValue = objEVDetalle.ID_Item;
                        }

                        if (!string.IsNullOrEmpty(objEVDetalle.ID_Documento.ToString()))
                        {
                            //entry = new AutoCompleteBoxEntry();
                            //entry.Text = objEVDetalle.ID_Documento + "-" + objEVDetalle.NombreDocumento;
                            //acbTipoDocumento.Entries.Add(entry);
                            cboTipoDocumento.SelectedValue = objEVDetalle.ID_Documento.ToString();
                        }

                        txtSerie.Text     = objEVDetalle.Serie;
                        txtNumero.Text    = objEVDetalle.Numero.ToString();
                        txtImporte.Value  = (double)objEVDetalle.Importe;
                        txtIGV.Value      = (double)objEVDetalle.ImporteIGV;
                        txtImpBase.Value  = (double)objEVDetalle.ImporteBaseIGV;
                        txtInafecto.Value = (double)objEVDetalle.ImporteInafecto;
                        if (objEVDetalle.FechaEmision != null)
                        {
                            dpFecEmision.SelectedDate = objEVDetalle.FechaEmision;
                        }

                        lblMensaje.Text = "Datos del gasto " + objEVDetalle.ID_Amarre.ToString() + " cargados con éxito";
                    }
                    else
                    {
                        Title           = "Registrar documento";
                        lblMensaje.Text = "Datos iniciales cargados con éxito";
                    }

                    lblMensaje.CssClass = "mensajeExito";
                }
            }
            catch (Exception ex) {
                lblMensaje.Text     = "ERROR: " + ex.Message;
                lblMensaje.CssClass = "mensajeError";
            }
        }
Beispiel #7
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        public void BindData()
        {
            ddlActionType.DataSource     = _dataManager.ActionTypes.SelectAll();
            ddlActionType.DataTextField  = "Title";
            ddlActionType.DataValueField = "ID";
            ddlActionType.DataBind();

            rblReplaceLinks.Items.Clear();
            rblReplaceLinks.Items.Add(new ListItem(EnumHelper.GetEnumDescription(BusinessLogicLayer.Enumerations.ReplaceLinks.None), ((int)BusinessLogicLayer.Enumerations.ReplaceLinks.None).ToString()));
            rblReplaceLinks.Items.Add(new ListItem(EnumHelper.GetEnumDescription(BusinessLogicLayer.Enumerations.ReplaceLinks.ThroughService), ((int)BusinessLogicLayer.Enumerations.ReplaceLinks.ThroughService).ToString()));
            rblReplaceLinks.Items.Add(new ListItem(EnumHelper.GetEnumDescription(BusinessLogicLayer.Enumerations.ReplaceLinks.GoogleLinks), ((int)BusinessLogicLayer.Enumerations.ReplaceLinks.GoogleLinks).ToString()));

            pnlTitle.Visible      = ShowTitle;
            pnlActionType.Visible = ShowActionType;

            if (SiteActionTemplateCategory != SiteActionTemplateCategory.Workflow)
            {
                var filter = new DictionaryOnDemandComboBox.DictionaryFilterColumn
                {
                    Name      = "RoleTypeID",
                    DbType    = DbType.Int32,
                    Value     = ((int)ContactRoleType.WorkflowRole).ToString(),
                    Operation = FilterOperation.NotEqual
                };

                dcbContactRole.Filters.Add(filter);
                dcbContactRolePopup.Filters.Add(filter);
            }

            dcbContactRole.SiteID = _siteId;
            dcbContactRole.BindData();
            dcbContactRolePopup.SiteID = _siteId;
            dcbContactRolePopup.BindData();

            var optionReplyEmailName = ((LeadForceBasePage)Page).CurrentModuleEditionOptions.SingleOrDefault(a => a.SystemName == "ReplyEmailName");

            trReplyEmailName.Visible = optionReplyEmailName != null;

            racbRecipients.Entries.Clear();

            if (SiteActionTemplateId != Guid.Empty)
            {
                tbl_SiteActionTemplate siteActionTemplate;
                if (!FromSession)
                {
                    siteActionTemplate = _dataManager.SiteActionTemplate.SelectById(_siteId, SiteActionTemplateId);
                }
                else
                {
                    siteActionTemplate = ((List <tbl_SiteActionTemplate>)Session["SiteActionTemplates"]).FirstOrDefault(a => a.ID == SiteActionTemplateId);
                }

                txtTitle.Text = siteActionTemplate.SiteActionTemplateCategoryID == (int)SiteActionTemplateCategory.System ? siteActionTemplate.Title : siteActionTemplate.MessageCaption;

                ddlActionType.Items.FindByValue(siteActionTemplate.ActionTypeID.ToString()).Selected = true;
                //txtToEmail.Text = siteActionTemplate.ToEmail;
                txtReplyEmail.Text = siteActionTemplate.ReplyToEmail;
                txtReplyName.Text  = siteActionTemplate.ReplyToName;
                rblReplaceLinks.Items.FindByValue(siteActionTemplate.ReplaceLinksID.ToString()).Selected = true;

                if (siteActionTemplate.FromContactRoleID.HasValue)
                {
                    dcbContactRole.SelectedId   = (Guid)siteActionTemplate.FromContactRoleID;
                    dcbContactRole.SelectedText = _dataManager.ContactRole.SelectById(_siteId, (Guid)siteActionTemplate.FromContactRoleID).Title;
                }
                else
                {
                    txtFromEmail.Text = siteActionTemplate.FromEmail;
                    txtFromName.Text  = siteActionTemplate.FromName;
                    dcbContactRole.SelectedIdNullable = null;
                    dcbContactRole.SelectedText       = "Конкретные Email и имя";
                }

                pnlFrom.Visible    = !siteActionTemplate.FromContactRoleID.HasValue;
                pnlToEmail.Visible = (ActionType)siteActionTemplate.ActionTypeID != ActionType.EmailToUser;

                if (!FromSession)
                {
                    ViewState["Recipients"] =
                        _dataManager.SiteActionTemplateRecipient.SelectAll(SiteActionTemplateId).Select(
                            a =>
                            new SiteActionTemplateRecipientMap()
                    {
                        ID = a.ID,
                        SiteActionTemplateID = a.SiteActionTemplateID,
                        ContactID            = a.ContactID,
                        ContactRoleID        = a.ContactRoleID,
                        Email       = a.Email,
                        DisplayName = a.DisplayName
                    }).ToList();
                }
                else
                {
                    ViewState["Recipients"] =
                        siteActionTemplate.tbl_SiteActionTemplateRecipient.Select(
                            a =>
                            new SiteActionTemplateRecipientMap()
                    {
                        ID = a.ID,
                        SiteActionTemplateID = a.SiteActionTemplateID,
                        ContactID            = a.ContactID,
                        ContactRoleID        = a.ContactRoleID,
                        Email       = a.Email,
                        DisplayName = a.DisplayName
                    }).ToList();
                }

                foreach (var recipient in RecipientsList)
                {
                    var entry = new AutoCompleteBoxEntry();
                    if (recipient.ContactID.HasValue)
                    {
                        var contact = _dataManager.Contact.SelectById(_siteId, (Guid)recipient.ContactID);
                        if (contact != null)
                        {
                            entry.Text = !string.IsNullOrEmpty(contact.UserFullName)
                                        ? string.Format("{0} &lt;{1}&gt;", contact.UserFullName, contact.Email)
                                        : string.Format("&lt;{0}&gt;", contact.Email);
                            entry.Value = "Contact|" + contact.ID.ToString();
                            RecipientsList.Find(a => a.ID == recipient.ID).Key = entry.Value;
                        }
                    }

                    if (recipient.ContactRoleID.HasValue)
                    {
                        var contactRole = _dataManager.ContactRole.SelectById(_siteId, (Guid)recipient.ContactRoleID);
                        if (contactRole != null)
                        {
                            entry.Text  = contactRole.Title;
                            entry.Value = "Role|" + contactRole.ID.ToString();
                            RecipientsList.Find(a => a.ID == recipient.ID).Key = entry.Value;
                        }
                    }

                    if (!recipient.ContactID.HasValue && !recipient.ContactRoleID.HasValue)
                    {
                        entry.Text = !string.IsNullOrEmpty(recipient.DisplayName)
                                    ? string.Format("{0} &lt;{1}&gt;", recipient.DisplayName, recipient.Email)
                                    : string.Format("&lt;{0}&gt;", recipient.Email);
                    }

                    racbRecipients.Entries.Add(entry);
                }
            }
            else
            {
                txtTitle.Text = string.Empty;
                ddlActionType.Items[0].Selected = true;
                txtToEmail.Text    = string.Empty;
                txtFromEmail.Text  = string.Empty;
                txtFromName.Text   = string.Empty;
                txtReplyEmail.Text = string.Empty;
                txtReplyName.Text  = string.Empty;
                rblReplaceLinks.Items[0].Selected = true;
                pnlToEmail.Visible = false;

                ViewState["Recipients"] = new List <SiteActionTemplateRecipientMap>();
            }
        }
        private void CargarSeguimientoImportacion()
        {
            objOrdenCompraWCF = new OrdenCompraWCFClient();
            List <USP_Sel_Genesys_Oc_SegImp_IdSegResult> lst = new List <USP_Sel_Genesys_Oc_SegImp_IdSegResult>();

            lst = objOrdenCompraWCF.Seleccionar_GenesysOC_SegImp_IdSeg(
                ((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario,
                _idSeguimiento).ToList();

            cboEstado.SelectedValue = Convert.ToString(lst.Select(x => x.Id_Estado).First());


            AutoCompleteBoxEntry objEntry = new AutoCompleteBoxEntry();

            objEntry.Text = lst.Select(x => (x.Id_Agente + "-" + x.AgenteNombre)).First();
            acbAgente.Entries.Add(objEntry);
            acbAgente.Enabled = true;

            dtpfechaetdaprox.SelectedDate      = lst.Select(x => x.FechaETDAprox).First();
            dtpfechaetdconfirmado.SelectedDate = lst.Select(x => x.FechaETD).First();
            dtpfechaeta.SelectedDate           = lst.Select(x => x.FechaETA).First();
            txtdiaslibresSe2.Text = lst.Select(x => x.DiasLibresSE).First().ToString();
            if (txtdiaslibresSe2.Text.Trim() == string.Empty || lst.Select(x => x.FechaETA).First() == (DateTime?)null)
            {
                dtpfechadiaslibrese.SelectedDate = (DateTime?)null;
            }
            else
            {
                dtpfechadiaslibrese.SelectedDate = lst.Select(x => x.FechaETA).First() == (DateTime?)null ? (DateTime?)null : Convert.ToDateTime(lst.Select(x => x.FechaETA).First()).AddDays(Convert.ToInt32(txtdiaslibresSe2.Text == string.Empty ? "0" : txtdiaslibresSe2.Text));
            }

            dtpfechaingreso.SelectedDate = lst.Select(x => x.FechaIngresoAlm).First();

            if (dtpfechaingreso.SelectedDate.ToString() != string.Empty)
            {
                if (dtpfechadiaslibrese.SelectedDate != (DateTime?)null)
                {
                    TimeSpan dias = Convert.ToDateTime(dtpfechadiaslibrese.SelectedDate) - Convert.ToDateTime(dtpfechaingreso.SelectedDate);
                    txtdiasSe.Text   = dias.Days.ToString();
                    txtestadoSe.Text = Convert.ToInt32(txtdiasSe.Text) <= 0 ? "NO" : "SI";
                }
            }
            txtdiasalmacenaje2.Text  = lst.Select(x => x.DiasAlmacenaje).First().ToString();
            cbotipovia.SelectedValue = lst.Select(x => x.Id_TipoVia.ToString()).First();
            txtnrodua.Text           = lst.Select(x => x.NumeroDua).First().ToString();
            txtnrobl.Text            = lst.Select(x => x.NumeroBL).First();
            txtlinkdua.Text          = lst.Select(x => x.LinkDua).First();
            txtnrocontenedores.Text  = lst.Select(x => x.CantidadContenedor).First().ToString();

            if (txtdiasalmacenaje2.Text.Trim() == string.Empty || lst.Select(x => x.FechaETA).First() == (DateTime?)null)
            {
                dtpfechaalmacenaje.SelectedDate = (DateTime?)null;
            }
            else
            {
                dtpfechaalmacenaje.SelectedDate = lst.Select(x => x.FechaETA).First() == (DateTime?)null ? (DateTime?)null : Convert.ToDateTime(lst.Select(x => x.FechaETA).First()).AddDays(Convert.ToInt32(txtdiasalmacenaje2.Text == string.Empty ? "0" : txtdiasalmacenaje2.Text));
            }

            if (lst.Select(x => x.Liquidacion).First() == 1)
            {
                btnguardar.Enabled     = false;
                btneliminarseg.Enabled = false;
                btnliquidacion.Enabled = false;
            }
            else
            {
                btnguardar.Enabled     = true;
                btneliminarseg.Enabled = true;
                btnliquidacion.Enabled = true;
            }
        }