Exemplo n.º 1
0
 //StartRemoveInExercise1
 /// <summary>
 /// Overrides Safir.Dob.Requestor. Response for sent request
 /// </summary>
 public void OnResponse(Safir.Dob.ResponseProxy responseProxy)
 {
     if (responseProxy.RequestTypeId == Capabilities.Vehicles.DeleteVehicleCategoryService.ClassTypeId)
     {
         if (responseProxy.IsSuccess)
         {
             statusStrip.Items["toolStripStatus"].Text = "Category info for the chosen object has succesfully been deleted";
         }
         else
         {
             statusStrip.Items["toolStripStatus"].Text = "Category info for the chosen object could not be deleted";
         }
     }
     else
     {
         if (responseProxy.IsSuccess)
         {
             statusStrip.Items["toolStripStatus"].Text = "OK";
         }
         else
         {
             Safir.Dob.ErrorResponse errorResponse = (Safir.Dob.ErrorResponse)responseProxy.Response;
             if (errorResponse.AdditionalInfo.IsNull())
             {
                 statusStrip.Items["toolStripStatus"].Text = "Error";
             }
             else
             {
                 statusStrip.Items["toolStripStatus"].Text = "Error: " + errorResponse.AdditionalInfo.Val;
             }
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Overrides Safir.Dob.Requestor. Response for sent request.
 /// </summary>
 public void OnResponse(Safir.Dob.ResponseProxy responseProxy)
 {
     if (responseProxy.IsSuccess)
     {
         if (m_apply)
         {
             statusStrip.Items["toolStripStatus"].Text = "OK";
         }
         else
         {
             this.Hide();
         }
     }
     //StartRemoveInExercise6
     else
     {
         Safir.Dob.ErrorResponse errorResponse = (Safir.Dob.ErrorResponse)responseProxy.Response;
         //if (errorResponse.AdditionalInfo.IsNull())
         if (errorResponse.Code.IsNull())
         {
             // No error code.
             statusStrip.Items["toolStripStatus"].Text = "Unspecified error";
         }
         else
         {
             // Error code specified.
             if (errorResponse.Code.Val == Safir.Dob.ResponseGeneralErrorCodes.SafirReqErr)
             {
                 statusStrip.Items["toolStripStatus"].Text = "General request error";
             }
         }
     }
     //StopRemoveInExercise6
 }
Exemplo n.º 3
0
 /// <summary>
 /// Overrides Safir.Dob.Requestor. Response for sent request
 /// </summary>
 public void OnResponse(Safir.Dob.ResponseProxy responseProxy)
 {
     if (responseProxy.IsSuccess)
     {
         Capabilities.CalculateSpeedDifferenceResponse response = (Capabilities.CalculateSpeedDifferenceResponse)responseProxy.Response;
         textboxSpeedDiff.Text = response.SpeedDifference.Val.ToString();
         statusStrip.Items["toolStripStatus"].Text = "OK";
     }
     else
     {
         statusStrip.Items["toolStripStatus"].Text = "Error in speed service request.";
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Overrides Safir.Dob.Requestor. Response for sent request
        /// </summary>
        public void OnResponse(Safir.Dob.ResponseProxy responseProxy)
        {
            if (responseProxy.RequestTypeId == Capabilities.Vehicles.GetVehicleCategoryService.ClassTypeId)
            {
                if (responseProxy.IsSuccess)
                {
                    Capabilities.Vehicles.GetVehicleCategoryResponse response = (Capabilities.Vehicles.GetVehicleCategoryResponse)responseProxy.Response;

                    if (!response.VehicleCategoryInfo.Obj.MaxSpeed.IsNull())
                    {
                        textBoxSpeed.Text = response.VehicleCategoryInfo.Obj.MaxSpeed.Val.ToString();
                    }
                    if (!response.VehicleCategoryInfo.Obj.Remark.IsNull())
                    {
                        textboxAdditionalRemark.Text = response.VehicleCategoryInfo.Obj.Remark.Val;
                    }
                    if (!response.VehicleCategoryInfo.Obj.IsDrivingLicenceRequired.IsNull())
                    {
                        checkBoxDriversLicenseReq.Checked = response.VehicleCategoryInfo.Obj.IsDrivingLicenceRequired.Val;
                    }
                }
                else
                {
                    // The chosen category had no information stored persistently
                }
            }
            else if (responseProxy.RequestTypeId == Capabilities.Vehicles.SetVehicleCategoryService.ClassTypeId)
            {
                if (responseProxy.IsSuccess)
                {
                    if (m_apply)
                    {
                        statusStrip.Items["toolStripStatus"].Text = "OK";
                    }

                    else
                    {
                        this.Hide();
                    }
                }
                else
                {
                    statusStrip.Items["toolStripStatus"].Text = "Error in category information service request.";
                }
            }
        }