Exemplo n.º 1
0
    public List <string> GetCityByContextKeyAndPrefixText(string prefixText, string contextKey)
    {
        var masterDal = new Falcon.DataAccess.Master.MasterDAL();

        // TODO: Using '0' is a hook here will have to be removed once we modify autoCompleteExtender.
        return((!string.IsNullOrEmpty(contextKey) && contextKey != "0") ? masterDal.GetCitybyState(contextKey, prefixText, 4).Select <ECity, string>(city => city.Name).ToList <string>() : masterDal.GetUniqueCity(prefixText, 6).Select <ECity, string>(city => city.Name).ToList <string>());
    }
Exemplo n.º 2
0
    public string[] GetMatchingMarketingOffers_nonSSL(string prefixText, int count)
    {
        List <string> items = new List <string>();

        //HealthYes.Web.UI.CouponService.CouponService objCService = new HealthYes.Web.UI.CouponService.CouponService();
        // remove services references
        Falcon.DataAccess.Master.MasterDAL objDAL = new Falcon.DataAccess.Master.MasterDAL();

        int icount = 0;
        //HealthYes.Web.UI.CouponService.EMarketingOffer[] objMarketingOffers = objCService.GetMarketingOfferByName(prefixText, 1, true, 50, true, out icount, out bolIcountSpecefied);
        List <Falcon.Entity.Other.EMarketingOffer> objMarketingOffers = objDAL.GetMarketingOfferPaged(prefixText, 2, 1, 50, out icount);

        try
        {
            string strOffer = string.Empty;


            foreach (Falcon.Entity.Other.EMarketingOffer objMarketingOffer in objMarketingOffers)
            {
                strOffer = objMarketingOffer.MarketingOffer + " [" + objMarketingOffer.MarketingOfferID + "]";
                items.Add(strOffer);
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }
        return(items.ToArray());
    }
Exemplo n.º 3
0
    public List <ECity> GetCityByStateAndPrefixText(string prefixText, string stateName)
    {
        var cities = new List <ECity>();

        var masterDal = new Falcon.DataAccess.Master.MasterDAL();

        try
        {
            cities = !string.IsNullOrEmpty(stateName) ? masterDal.GetCitybyState(stateName, prefixText, 4) : masterDal.GetUniqueCity(prefixText, 6);
        }
        catch { }

        return(cities);
    }
Exemplo n.º 4
0
    public string[] GetMatchingCity(string prefixText, int count, string contextKey)
    {
        List <string> items = new List <string>();

        //HealthYes.Web.UI.CityService.CityService service = new HealthYes.Web.UI.CityService.CityService();

        var masterDal = new Falcon.DataAccess.Master.MasterDAL();

        try
        {
            //ECity[] cityarr = new ECity[0];
            if (!string.IsNullOrEmpty(contextKey))
            {
                //cityarr = service.GetCitybyNameandState(Convert.ToInt32(contextKey), true, prefixText);
                var cities = masterDal.GetCitybyState(contextKey, prefixText, 4);
                foreach (ECity city in cities)
                {
                    items.Add(city.Name);
                }
            }
            else
            {
                //cityarr = service.GetUniqueCity(prefixText);
                var cities = masterDal.GetUniqueCity(prefixText, 6);
                foreach (ECity city in cities)
                {
                    items.Add(city.Name);
                }
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }

        return(items.ToArray());
    }
Exemplo n.º 5
0
    public string[] GetSimilarCity(string prefixText, int count)
    {
        var items = new List <string>();

        var masterDal = new Falcon.DataAccess.Master.MasterDAL();
        var cities    = masterDal.GetCity(prefixText, 5);

        try
        {
            if (cities != null)
            {
                foreach (ECity city in cities)
                {
                    items.Add(city.Name);
                }
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }

        return(items.ToArray());
    }
Exemplo n.º 6
0
    private bool SaveMeeting()
    {
        string  strUser    = null;
        string  strRole    = null;
        string  strShell   = null;
        decimal minutes    = 0;
        Int64   ProspectID = 0;

        MasterDAL objMasterDal = new MasterDAL();
        var       meeting      = new Falcon.Entity.Other.EContactMeeting();

        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        long temp;

        meeting.CallStatus = new Falcon.Entity.Other.ECallStatus();
        meeting.Contact    = new Falcon.Entity.Other.EContact();

        if (ViewState["ContactMeetingID"] != null)
        {
            meeting.ContactMeetingID = Convert.ToInt32(ViewState["ContactMeetingID"]);
            meeting.ProspectID       = 0;
        }

        meeting.Subject     = txtSubject.Text;
        meeting.Description = txtDescription.Text;

        meeting.StartDate = txtStartDate.Text;

        if (txtStartTime.Text != null && txtStartTime.Text != "")
        {
            DateTime dt   = Convert.ToDateTime(string.Format("{0:T}", txtStartTime.Text));
            int      Hour = Convert.ToInt16(dt.ToString("hh"));

            if ((dt.Minute > 60) || (dt.Second >= 60) || (Hour > 12))
            {
                return(false);
            }
            meeting.StartTime = txtStartTime.Text;
        }
        else
        {
            meeting.StartTime = "";
        }


        minutes          = Convert.ToInt32(ddlDuration.SelectedValue);
        meeting.Duration = minutes;

        //What is this ?? - Bidhan
        meeting.AssignedToUserId  = Convert.ToInt32(strUser);
        meeting.AssignedToShellID = Convert.ToInt32(strShell);
        meeting.AssignedToRoleID  = Convert.ToInt32(strRole);

        meeting.CreatedByUserId  = Convert.ToInt32(currentSession.UserId);
        meeting.CreatedByShellID = Convert.ToInt32(currentSession.CurrentOrganizationRole.OrganizationId);
        meeting.CreatedByRoleID  = Convert.ToInt32(currentSession.CurrentOrganizationRole.RoleId);


        meeting.Reminder = false;
        meeting.CallStatus.CallStatusID = Convert.ToInt32(ddlStatus.SelectedValue);
        meeting.Venue = txtVenue.Text;

        // Assign Prospect
        if (!string.IsNullOrEmpty(Request["ProspectID"]))
        {
            ProspectID = Convert.ToInt64(Request["ProspectID"]);
        }
        meeting.ProspectID = ProspectID;
        if (!string.IsNullOrEmpty(HidAllContactID.Value))
        {
            string   strAllContact     = HidAllContactID.Value;
            string[] strAllContactCall = strAllContact.Split(',');

            if (strAllContactCall.Length > 0)
            {
                for (int i = 0; i < strAllContactCall.Length; i++)
                {
                    if (!string.IsNullOrEmpty(strAllContactCall[i]))
                    {
                        EContactMeeting ContactMeeting = new EContactMeeting();
                        ContactMeeting.CallStatus = new ECallStatus();
                        ContactMeeting.Contact    = new EContact();

                        ContactMeeting.Contact.ContactID = Convert.ToInt32(strAllContactCall[i]);

                        ContactMeeting.IsActive                = true;
                        ContactMeeting.ContactMeetingID        = meeting.ContactMeetingID;
                        ContactMeeting.CreatedByUserId         = meeting.CreatedByUserId;
                        ContactMeeting.CreatedByShellID        = meeting.CreatedByShellID;
                        ContactMeeting.CreatedByRoleID         = meeting.CreatedByRoleID;
                        ContactMeeting.AssignedToUserId        = meeting.AssignedToUserId;
                        ContactMeeting.AssignedToShellID       = meeting.AssignedToShellID;
                        ContactMeeting.AssignedToRoleID        = meeting.AssignedToRoleID;
                        ContactMeeting.ProspectID              = meeting.ProspectID;
                        ContactMeeting.Duration                = meeting.Duration;
                        ContactMeeting.Subject                 = meeting.Subject;
                        ContactMeeting.Description             = meeting.Description;
                        ContactMeeting.StartDate               = meeting.StartDate;
                        ContactMeeting.StartTime               = meeting.StartTime;
                        ContactMeeting.CallStatus.CallStatusID = meeting.CallStatus.CallStatusID;
                        ContactMeeting.Venue = meeting.Venue;
                        if (ViewState["ContactMeetingID"] != null)
                        {
                            if (ViewState["ContactMeetingID"].ToString() != string.Empty)
                            {
                                temp = objMasterDal.SaveMeeting(ContactMeeting, Convert.ToInt32(EOperationMode.Update));
                            }
                        }
                        else
                        {
                            temp = objMasterDal.SaveMeeting(ContactMeeting, Convert.ToInt32(EOperationMode.Insert));
                        }
                    }
                }
            }
        }
        else
        {
            if (ViewState["ContactMeetingID"] != null)
            {
                if (ViewState["ContactMeetingID"].ToString() != string.Empty)
                {
                    temp = objMasterDal.SaveMeeting(meeting, Convert.ToInt32(EOperationMode.Update));
                }
            }
            else
            {
                temp = objMasterDal.SaveMeeting(meeting, Convert.ToInt32(EOperationMode.Insert));
            }
        }

        // Add Call
        if (chkboxCall.Checked)
        {
            EContactCall FollowUpCall = new EContactCall();

            FollowUpCall.CallStatus = new ECallStatus();
            FollowUpCall.Contact    = new EContact();

            FollowUpCall.IsActive          = true;
            FollowUpCall.CreatedByUserId   = meeting.CreatedByUserId;
            FollowUpCall.CreatedByShellID  = meeting.CreatedByShellID;
            FollowUpCall.CreatedByRoleID   = meeting.CreatedByRoleID;
            FollowUpCall.AssignedToUserId  = meeting.AssignedToUserId;
            FollowUpCall.AssignedToShellID = meeting.AssignedToShellID;
            FollowUpCall.AssignedToRoleID  = meeting.AssignedToRoleID;
            FollowUpCall.Contact.ContactID = meeting.Contact.ContactID;
            FollowUpCall.ProspectID        = meeting.ProspectID;
            FollowUpCall.Duration          = 0;
            //FollowUpCall.ContactCallID = meeting.ContactCallID;
            FollowUpCall.CallResult   = 0;
            FollowUpCall.FutureAction = 0;

            //
            FollowUpCall.Subject   = txtCallSubject.Text;
            FollowUpCall.Notes     = "";
            FollowUpCall.StartDate = txtCallStartDate.Text;
            FollowUpCall.StartTime = txtCallStartTime.Text;
            temp = objMasterDal.SaveCall(FollowUpCall, Convert.ToInt32(EOperationMode.Insert));
        }
        //Add Meeting
        if (chkboxMeeting.Checked)
        {
            EContactMeeting objEContactMeeting = new EContactMeeting();
            objEContactMeeting.Contact    = new EContact();
            objEContactMeeting.CallStatus = new ECallStatus();

            objEContactMeeting.StartDate         = txtMeetingStartDate.Text;
            objEContactMeeting.StartTime         = txtMeetingStartTime.Text;
            objEContactMeeting.Venue             = txtVenue.Text;
            objEContactMeeting.Subject           = "";
            objEContactMeeting.Description       = "";
            objEContactMeeting.AssignedToUserId  = meeting.AssignedToUserId;
            objEContactMeeting.AssignedToShellID = meeting.AssignedToShellID;
            objEContactMeeting.AssignedToRoleID  = meeting.AssignedToRoleID;
            objEContactMeeting.CreatedByUserId   = meeting.CreatedByUserId;
            objEContactMeeting.CreatedByShellID  = meeting.CreatedByShellID;
            objEContactMeeting.CreatedByRoleID   = meeting.CreatedByRoleID;
            objEContactMeeting.Contact.ContactID = meeting.Contact.ContactID;
            objEContactMeeting.ProspectID        = meeting.ProspectID;

            temp = objMasterDal.SaveMeeting(objEContactMeeting, Convert.ToInt32(EOperationMode.Insert));
        }

        // Add Task
        if (chkboxTask.Checked)
        {
            if ((!string.IsNullOrEmpty(txtTask.Text)) || (!string.IsNullOrEmpty(txtTaskDueDate.Text)) || (!string.IsNullOrEmpty(txtTaskDueTime.Text)))
            {
                var masterDal = new Falcon.DataAccess.Master.MasterDAL();
                var task      = new Falcon.Entity.Other.ETask();

                task.TaskStatusType   = new Falcon.Entity.Other.ETaskStatusType();
                task.TaskPriorityType = new Falcon.Entity.Other.ETaskPriorityType();
                task.TaskType         = new Falcon.Entity.Other.ETaskType();
                task.UserShellModule  = new Falcon.Entity.User.EUserShellModuleRole();

                task.Active  = true;
                task.Subject = txtTask.Text;
                if (txtTaskDueDate.Text != "")
                {
                    task.DueDate = txtTaskDueDate.Text;
                }
                if (txtTaskDueTime.Text != "")
                {
                    task.DueTime = txtTaskDueTime.Text;
                }
                task.Notes     = "";
                task.StartDate = DateTime.Now.ToString();
                task.StartTime = DateTime.Now.ToString();

                task.UserShellModule.ShellID     = currentSession.CurrentOrganizationRole.OrganizationId.ToString();
                task.UserShellModule.RoleShellID = (int)currentSession.CurrentOrganizationRole.OrganizationRoleUserId;
                task.UserShellModule.RoleID      = currentSession.CurrentOrganizationRole.RoleId.ToString();
                task.UserShellModule.UserID      = currentSession.UserId.ToString();


                task.ProspectID = meeting.ProspectID;
                task.ContactID  = meeting.Contact.ContactID;
                task.CreatedBY  = Convert.ToInt32(currentSession.UserId);
                task.ModifiedBY = Convert.ToInt32(currentSession.UserId);

                temp = masterDal.SaveTask(task, Convert.ToInt32(EOperationMode.Insert), currentSession.UserId.ToString(), currentSession.CurrentOrganizationRole.OrganizationId.ToString(), currentSession.CurrentOrganizationRole.RoleId.ToString());
                if (temp == 0)
                {
                    temp = 9999990;
                }
            }
        }

        // Assign prospect to salesrep
        if (ProspectID > 0)
        {
            if (currentSession.CurrentOrganizationRole.CheckRole((long)Roles.SalesRep))
            {
                FranchisorDAL franchisorDAL = new FranchisorDAL();
                franchisorDAL.AssignProspect(1, ProspectID, Convert.ToInt64(currentSession.UserId));
            }
        }
        if (Request.QueryString["Referrer"] != null)
        {
            string strReferrer = Request.QueryString["Referrer"].ToString();
            if ((strReferrer != string.Empty) && (strReferrer == "Calendar"))
            {
                Response.RedirectUser(this.ResolveUrl("~/App/Common/Calendar.aspx"));
            }
        }
        return(true);
    }