Пример #1
0
 public CustomResponse CreateUser(Users user)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             Users bUser = businessLogin.CreateUser(user);
             if (bUser.Status == true)// if User Create
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bUser.Message;
                 response.ResponseData = bUser;
             }
             else // if user already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bUser.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #2
0
        public CustomResponse SaveServices(NewServiceModel NewService)
        {
            // ArrayList array = new ArrayList();
            // create object of response class

            response = new CustomResponse();
            try
            {
                using (businessLogin = new MotormechsRepository())
                {
                    Services bService = businessLogin.AddServices(NewService);
                    if (bService.Status == true)// if Service Saved Successfully
                    {
                        response.IsSuccess = true;
                        // Set Message
                        response.Message = bService.Message;
                        //response.ResponseData = bService.ListService;
                    }
                    else // if error occure during save
                    {
                        response.IsSuccess = false;
                        response.Message   = bService.Message;
                    }
                }
            }
            catch (Exception ex)
            {
                response.IsSuccess = false;
                response.Message   = ex.Message.ToString();
            }
            return(response);
        }
Пример #3
0
 public CustomResponse GetUserServiceDetail(int OrderServiceId)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             UserServiceDetailList bService = businessLogin.GetUserServiceDetail(OrderServiceId);
             if (bService.Status == true)// if Service Exist
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bService.Message;
                 response.ResponseData = bService.List;
             }
             else // if Service not exist
             {
                 response.IsSuccess = false;
                 response.Message   = bService.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #4
0
 public CustomResponse GetForgetPasswordStatus(Guid Fpc)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             List <PasswordStatus> bUsers = businessLogin.GetForgetPasswordStatus(Fpc);
             if (bUsers.Count() > 0)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = "";
                 response.ResponseData = bUsers;
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = "";
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #5
0
 public CustomResponse NewPassword(NewPasswordModel user)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             NewPasswordModel bUsers = businessLogin.NewPassword(user);
             if (bUsers.Status == true)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bUsers.Message;
                 response.ResponseData = bUsers.List;
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bUsers.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #6
0
 public CustomResponse GetUserDetailbyEmail(string Email)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             Guid  Fpc    = Guid.NewGuid();
             Users bUsers = businessLogin.UpdateMembershipForForgetPassword(Email, Fpc, DateTime.Now, true);
             if (bUsers.Status == true)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bUsers.Message;
                 response.ResponseData = bUsers;
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bUsers.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #7
0
 public CustomResponse GetUserDetail(int Id)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             Users bUsers = businessLogin.GetUserDetail(Id);
             if (bUsers.Status == true)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bUsers.Message;
                 response.ResponseData = bUsers;
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bUsers.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #8
0
 public CustomResponse UpdateRole(Role role)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             Role bRole = businessLogin.UpdateRole(role);
             if (bRole.Status == true)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bRole.Message;
                 response.ResponseData = bRole;
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bRole.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #9
0
 public CustomResponse LoginCheck(Login login)
 {
     // create response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             Users bUser = businessLogin.CheckLogin(login);
             if (bUser.Status == true)// if User Exist
             {
                 // set Sucess
                 response.IsSuccess = true;
                 // Set Message
                 response.Message = bUser.Message;
                 // Set Data
                 response.ResponseData = bUser;
             }
             else // if user does not exist
             {
                 response.IsSuccess = false;
                 response.Message   = bUser.Message;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }
Пример #10
0
 public CustomResponse DeleteVehicle(int Id, int UserId)
 {
     // create object of response class
     response = new CustomResponse();
     try
     {
         using (businessLogin = new MotormechsRepository())
         {
             var bVehicle = businessLogin.DeleteVehicle(Id, UserId);
             if (bVehicle.Status == true)// if vehicle Created
             {
                 response.IsSuccess = true;
                 // Set Message
                 response.Message      = bVehicle.Message;
                 response.ResponseData = bVehicle.List.Count();
             }
             else // if vehicle already exist
             {
                 response.IsSuccess = false;
                 response.Message   = bVehicle.Message;
                 //response.ResponseData = bVehicle;
             }
         }
     }
     catch (Exception ex)
     {
         response.IsSuccess = false;
         response.Message   = ex.Message.ToString();
     }
     return(response);
 }