Esempio n. 1
0
        private void UpdateProfile()
        {
            Profile.Title             = this.txtTitle.Text;
            Profile.TimeFrequency     = (decimal)(BaseDate.Add(this.rtpActiveFrequency.SelectedDate.Value.TimeOfDay) - BaseDate).TotalSeconds;
            Profile.IdlingFrequency   = (decimal)(BaseDate.Add(this.rtpIdleReportTime.SelectedDate.Value.TimeOfDay) - BaseDate).TotalSeconds;
            Profile.SleepingFrequency = (decimal)(BaseDate.Add(this.rtpSleepFrequency.SelectedDate.Value.TimeOfDay) - BaseDate).TotalSeconds;
            Profile.SendFrequency     = (decimal)(BaseDate.Add(this.rtpSendFrequency.SelectedDate.Value.TimeOfDay) - BaseDate).TotalSeconds;
            Profile.DirectionAngle    = (decimal)this.rntDirectionAngle.Value;
            Profile.DistanceFrequency = (decimal)this.rntDistance.Value;
            Profile.ReportOnEvents    = chkReportOnEvents.Checked;
            Profile.ReportOnCANEvents = chkReportOnCANEvents.Checked;
            this.Profile.IsDefault    = chkIsDefault.Checked;

            ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();
#if DEBUG
            bool updateResult = client.ManageLocationProfile(Profile, new Guid("BEA0F9A9-E630-4D04-851B-36BD1D97EEEB"));
#else
            bool updateResult = client.ManageLocationProfile(this.Profile, new Guid(Configuration.BlueSphereCustomerId));
#endif


            if (updateResult)
            {
                pnlInfo.Visible = true;
                if (this.Profile.ProfileID == Guid.Empty)
                {
                    lblMessage.Text = "The Profile has been added.";
                }
                else
                {
                    lblMessage.Text = "Your changes have been saved.";
                }
            }
        }
        void btnSaveVehicles_Click(object sender, EventArgs e)
        {
            // remove whatever is in the list.
            this.Profile.GPSUnits.Clear();

            // save the profile
            foreach (RadListBoxItem item in lstVehiclesInProfile.Items)
            {
                if (!string.IsNullOrEmpty(item.Value))
                {
                    this.Profile.GPSUnits.Add(item.Value);
                }
            }

            ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();

#if DEBUG
            Guid customerID = new Guid("BEA0F9A9-E630-4D04-851B-36BD1D97EEEB");
#else
            Guid customerID = new Guid(Configuration.BlueSphereCustomerId);
#endif
            client.AssignVehiclesToPerformanceProfile(customerID, this.Profile.ProfileID, this.Profile.GPSUnits);
            this.rmpProfiles.SelectedIndex = 0;
            this.rgProfiles.Rebind();
        }
Esempio n. 3
0
        void rgProfiles_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();
#if DEBUG
            List <ProfilesService.TrackingProfile> profiles = client.GetLocationProfiles(new Guid("BEA0F9A9-E630-4D04-851B-36BD1D97EEEB"));
#else
            List <ProfilesService.TrackingProfile> profiles = client.GetLocationProfiles(new Guid(Configuration.BlueSphereCustomerId));
#endif

            rgProfiles.DataSource = profiles.Where(p => p.IsDeleted == false);
        }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["profileID"] != null)
         {
             //Load the profile
             ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();
             this.Profile = client.GetLocationProfile(new Guid(Request.QueryString["profileID"]));
             ShowProfile();
         }
     }
 }
Esempio n. 5
0
        void rgProfiles_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                e.Canceled = true;
                // go to the the edit display
                this.mpProfile.SelectedIndex = 1;

                // Load the Selected Profile
                ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();
                this.Profile = client.GetLocationProfile(new Guid(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProfileID"].ToString()));
                ShowProfile();
            }

            if (e.CommandName == "Vehicles")
            {
                e.Canceled = true;
                this.mpProfile.SelectedIndex = 2;
                ProfilesService.ProfilesClient client = new ProfilesService.ProfilesClient();
                this.Profile = client.GetLocationProfile(new Guid(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProfileID"].ToString()));
                ShowVehicles();
            }
        }