/// <summary>The selected Def from the grid will be copied into a brand new Evaluation and saved to the DB. This includes all EvaluationCriterion as well. Used when creating a new Evaluation.</summary> private void CopyDefToEvaluation() { EvaluationDef evalDef=EvaluationDefs.GetOne(PIn.Long(gridMain.Rows[gridMain.GetSelectedIndex()].Tag.ToString())); Evaluation evalNew=new Evaluation(); evalNew.DateEval=DateTime.Today; evalNew.EvalTitle=evalDef.EvalTitle; evalNew.GradingScaleNum=evalDef.GradingScaleNum; evalNew.InstructNum=Security.CurUser.ProvNum; evalNew.SchoolCourseNum=evalDef.SchoolCourseNum; evalNew.EvaluationNum=Evaluations.Insert(evalNew); List<EvaluationCriterionDef> evalCritDefs=EvaluationCriterionDefs.GetAllForEvaluationDef(evalDef.EvaluationDefNum); EvaluationCriterion evalCrit; for(int i=0;i<evalCritDefs.Count;i++) { evalCrit=new EvaluationCriterion(); evalCrit.CriterionDescript=evalCritDefs[i].CriterionDescript; evalCrit.EvaluationNum=evalNew.EvaluationNum; evalCrit.GradingScaleNum=evalCritDefs[i].GradingScaleNum; evalCrit.IsCategoryName=evalCritDefs[i].IsCategoryName; evalCrit.ItemOrder=evalCritDefs[i].ItemOrder; evalCrit.MaxPointsPoss=evalCritDefs[i].MaxPointsPoss; EvaluationCriterions.Insert(evalCrit); } evalNew.IsNew=true; FormEvaluationEdit FormEE=new FormEvaluationEdit(evalNew); FormEE.ShowDialog(); }
///<summary></summary> public static long Insert(Evaluation evaluation){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){ evaluation.EvaluationNum=Meth.GetLong(MethodBase.GetCurrentMethod(),evaluation); return evaluation.EvaluationNum; } return Crud.EvaluationCrud.Insert(evaluation); }
///<summary></summary> public static void Update(Evaluation evaluation){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){ Meth.GetVoid(MethodBase.GetCurrentMethod(),evaluation); return; } Crud.EvaluationCrud.Update(evaluation); }
public FormEvaluationEdit(Evaluation evalCur) { InitializeComponent(); Lan.F(this); _evalCur=evalCur; }