public ActionResult Edit(EvaluationGrade model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var flag = reposatoryGrade.Editone(model);
             if (flag)
             {
                 TempData["Message"] = HR.Resource.pers_2.addedSuccessfully;
                 //=================================check for alert==================================
                 var get_result_check = HR.Controllers.check.check_alert("evaluation grade", HR.Models.user.Action.edit, HR.Models.user.type_field.form);
                 if (get_result_check != null)
                 {
                     var inbox = new Models.user.Alert_inbox {
                         send_from_user_id = User.Identity.Name, send_to_user_id = get_result_check.send_to_ID_user, title = get_result_check.Subject, Subject = get_result_check.Message
                     };
                     if (get_result_check.until != null)
                     {
                         if (get_result_check.until.Value.Year != 0001)
                         {
                             inbox.until = get_result_check.until;
                         }
                     }
                     ApplicationDbContext dbcontext = new ApplicationDbContext();
                     dbcontext.Alert_inbox.Add(inbox);
                     dbcontext.SaveChanges();
                 }
                 //==================================================================================
                 return(RedirectToAction("index"));
             }
             else
             {
                 TempData["Message"] = HR.Resource.pers_2.Faild;
                 return(View(model));
             }
         }
         else
         {
             TempData["Message"] = HR.Resource.pers_2.Faild;
             return(View(model));
         }
     }
     catch (Exception)
     {
         TempData["Message"] = HR.Resource.pers_2.Faild;
         return(View(model));
     }
 }
Exemplo n.º 2
0
        //-----------------------------------
        // Method (public)
        //-----------------------------------
		public void Play(EvaluationGrade grade, int combo)
		{
			m_Timer.Start(m_ShowTime);

			if (m_GradeText != null)
			{
				m_GradeText.text = GetGradeMessage(grade);
				m_GradeText.gameObject.SetActive(true);
			}
			if (m_ComboText != null)
			{
				m_ComboText.text = combo.ToString();
				m_ComboText.gameObject.SetActive(true);
			}
		}
Exemplo n.º 3
0
 public bool AddOne(EvaluationGrade model)
 {
     try
     {
         context.EvaluationGrade.Add(model);
         context.SaveChanges();
         return(true);
     }
     catch (DbUpdateException)
     {
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 4
0
		//-----------------------------------
		// Method (private)
		//-----------------------------------
		private string GetGradeMessage(EvaluationGrade grade)
		{
			switch (grade)
			{
				case EvaluationGrade.Perfect:
					return m_PerfectMessage;

				case EvaluationGrade.Great:
					return m_GreatMessage;

				case EvaluationGrade.Good:
					return m_GoodMessage;

				default:
					break;
			}
			return m_MissMessage;
		}
Exemplo n.º 5
0
 public bool Editone(EvaluationGrade model)
 {
     try
     {
         var record = context.EvaluationGrade.FirstOrDefault(m => m.ID == model.ID);
         record.Description   = model.Description;
         record.Decision_Type = model.Decision_Type;
         record.FromScore     = model.FromScore;
         record.ToScore       = model.ToScore;
         record.Name          = model.Name;
         context.SaveChanges();
         return(true);
     }
     catch (DbUpdateException)
     {
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 6
0
Arquivo: Track.cs Projeto: nemak1d/OTG
		private int GetScore(EvaluationGrade grade)
		{
			var scale = 0.0f;
			switch (grade)
			{
				case EvaluationGrade.Perfect:
					scale = GameConfig.instance.PerfectScoreScale;
					break;

				case EvaluationGrade.Great:
					scale = GameConfig.instance.GreatScoreScale;
					break;

				case EvaluationGrade.Good:
					scale = GameConfig.instance.GoodScoreScale;
					break;

				default:
					break;
			}

			return (int)(scale * m_ScorePerNote);
		}
 public ActionResult Create()
 {
     try
     {
         /////////create code///////
         var stru    = reposatorystructure.find(ChModels.Personnel).Structure_Code;
         var ALLList = reposatoryGrade.GetAll();
         var model   = new EvaluationGrade();
         if (ALLList.Count() == 0)
         {
             model.Code = stru + "1";
         }
         else
         {
             model.Code = stru + (ALLList.LastOrDefault().ID + 1).ToString();
         }
         model.Decision_Type = Decisiontype.Positive;
         return(View(model));
     }
     catch (Exception)
     {
         return(RedirectToAction("Index"));
     }
 }