/// <summary> /// Delete particular request training raised by manager /// </summary> /// <value>RaiseID</value> /// <value>TrainingTypeID</value> public ActionResult DeleteTrainingRequest(string raiseID, string trainingTypeID) { //initialize model int trainingID = Convert.ToInt32(trainingTypeID); TrainingModel RaiseTraining = new TrainingModel(); RaiseTraining.RaiseID = Convert.ToInt32(raiseID); RaiseTraining.Status = "0"; Master objmaster = new Master(); RaiseTraining.UserEmpId = objmaster.GetEmployeeIDByEmailID(); //check training type selected by user string result = string.Empty; switch (trainingID) { case (CommonConstants.TechnicalTrainingID): //Delete technical training and send email to managers and trainee result = _service.DeleteTechnicalSoftSkillsTraining(RaiseTraining, trainingID); EmailHelper.SendMailForTechSoftSkillDeleted(RaiseTraining.RaiseID, _service.GetEmailIDForAppRejTechSoftSkill(RaiseTraining.RaiseID)); break; case (CommonConstants.SoftSkillsTrainingID): //Delete technical training and send email to managers and trainee result = _service.DeleteTechnicalSoftSkillsTraining(RaiseTraining, trainingID); EmailHelper.SendMailForTechSoftSkillDeleted(RaiseTraining.RaiseID, _service.GetEmailIDForAppRejTechSoftSkill(RaiseTraining.RaiseID)); break; case (CommonConstants.SeminarsID): //Delete seminar training and send email to managers and trainee result = _service.DeleteSeminarsTraining(RaiseTraining); EmailHelper.SendMailForSeminarDeleted(RaiseTraining.RaiseID, _service.GetEmailIDForAppRejTechSoftSkill(RaiseTraining.RaiseID)); break; case (CommonConstants.KSSID): //pass model and delete kss training result = _service.DeleteKSSTraining(RaiseTraining); break; } //set message on view page returned from above operation TempData[CommonConstants.Result] = string.Format(CommonConstants.StringFormat, result, CommonConstants.Request_Deleted); return(RedirectToAction(CommonConstants.ViewTechnicalTrainingRequestGrid, new { trainingTypeID = trainingTypeID })); }
/// </summary> /// This method is used for deleteing the KSS Training details /// <param name="RaiseTraining"></param> /// <returns>RaiseKSSID</returns> public string DeleteKSSTraining(TrainingModel RaiseTraining) { return(_repository.DeleteKSSTraining(RaiseTraining)); }