Exemplo n.º 1
0
        public bool SchedulerSubjectLinkEnabled(AppointmentTemplateContainer oContainer)
        {
            //**************
            //* Declarações
            //**************
            string URL = string.Empty;

            //*****************************
            //* Existe oportunidade válida
            //*****************************
            if (Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDOportunidade"]) > 0 ||
                Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDOrcamento"]) > 0)
            {
                //*********************************************************
                //* O operador possui acesso ao cadastro de oportunidades?
                //*********************************************************
                if (oSecurity.IsActive(oLogin, (int)OptionLists.Seguranca.Cadastro_Oportunidade))
                {
                    //*************************************
                    //* Link para oportunidade e orçamento
                    //*************************************
                    return(true);
                }
                else
                {
                    //***********
                    //* Sem link
                    //***********
                    return(false);
                }
            }
            else if (Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDCliente"]) > 0)
            {
                //****************************************************
                //* O operador possui acesso ao cadastro de clientes?
                //****************************************************
                if (oSecurity.IsActive(oLogin, (int)OptionLists.Seguranca.Cadastro_Clientes))
                {
                    //********************
                    //* Link para cliente
                    //********************
                    return(true);
                }
                else
                {
                    //***********
                    //* Sem link
                    //***********
                    return(false);
                }
            }
            else
            {
                //***********
                //* Sem link
                //***********
                return(false);
            }
        }
Exemplo n.º 2
0
        public string SchedulerSubjectLink(AppointmentTemplateContainer oContainer)
        {
            //**************
            //* Declarações
            //**************
            string URL = string.Empty;

            //*****************************
            //* Existe oportunidade válida
            //*****************************
            if (Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDOportunidade"]) > 0 ||
                Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDOrcamento"]) > 0)
            {
                //*********************************************************
                //* O operador possui acesso ao cadastro de oportunidades?
                //*********************************************************
                if (oSecurity.IsActive(oLogin, (int)OptionLists.Seguranca.Cadastro_Oportunidade))
                {
                    //*************************************
                    //* Link para oportunidade e orçamento
                    //*************************************
                    URL += "oportunidades_edicao.aspx?Codigo=";
                    URL += oContainer.AppointmentViewInfo.Appointment.CustomFields["IDOportunidade"].ToString();
                    URL += "&back=agenda.aspx";
                }
                else
                {
                    //***********
                    //* Sem link
                    //***********
                    URL = "#";
                }
                return(URL);
            }
            else if (Convert.ToInt32(oContainer.AppointmentViewInfo.Appointment.CustomFields["IDCliente"]) > 0)
            {
                //****************************************************
                //* O operador possui acesso ao cadastro de clientes?
                //****************************************************
                if (oSecurity.IsActive(oLogin, (int)OptionLists.Seguranca.Cadastro_Clientes))
                {
                    //********************
                    //* Link para cliente
                    //********************
                    URL += "clientes_edicao.aspx?Codigo=";
                    URL += oContainer.AppointmentViewInfo.Appointment.CustomFields["IDCliente"].ToString();
                    URL += "&back=agenda.aspx";
                }
                else
                {
                    //***********
                    //* Sem link
                    //***********
                    URL = "#";
                }
                return(URL);
            }
            else
            {
                //***********
                //* Sem link
                //***********
                return("#");
            }
        }