예제 #1
0
파일: Report.cs 프로젝트: mbhcast/CDP
        public int InsertReportUserMentor(ReportUserMentor ReportUserMentor)
        {
            using (SqlConnection con = new SqlConnection(_ConnectionString.Value.ConnectionString))
            {
                con.Open();
                SqlTransaction sqltrans = con.BeginTransaction();
                var            param    = new DynamicParameters();
                param.Add("@Id", ReportUserMentor.Id);
                param.Add("@Comment", ReportUserMentor.Comment);
                param.Add("@PeriodId", ReportUserMentor.PeriodId);
                param.Add("@UserAllocationId", ReportUserMentor.UserMentorId);
                param.Add("@UserId", ReportUserMentor.UserId);
                param.Add("@StatusId", ReportUserMentor.StatusId);
                var result = con.Execute("InsertUpdateReportUserMentor", param, sqltrans, 0, System.Data.CommandType.StoredProcedure);

                if (result > 0)
                {
                    sqltrans.Commit();
                }
                else
                {
                    sqltrans.Rollback();
                }
                return(result);
            }
        }
예제 #2
0
 public IActionResult MarkUserMentor(ReportUserMentor Mentor)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _IReport.InsertReportUserMentor(Mentor);
             return(RedirectToAction("Index"));
         }
         return(View(Mentor));
     }
     catch
     {
         return(View());
     }
 }