Ejemplo n.º 1
0
        public int InsertReportUserInternal(ReportUserInternal ReportUserInternal)
        {
            using (SqlConnection con = new SqlConnection(_ConnectionString.Value.ConnectionString))
            {
                con.Open();
                SqlTransaction sqltrans = con.BeginTransaction();
                var            param    = new DynamicParameters();
                param.Add("@Id", ReportUserInternal.Id);
                param.Add("@Comment", ReportUserInternal.Comment);
                param.Add("@PeriodId", ReportUserInternal.PeriodId);
                param.Add("@UserAllocationId", ReportUserInternal.UserInternalId);
                param.Add("@UserId", ReportUserInternal.UserId);
                param.Add("@StatusId", ReportUserInternal.StatusId);
                var result = con.Execute("InsertUpdateReportUserInternal", param, sqltrans, 0, System.Data.CommandType.StoredProcedure);

                if (result > 0)
                {
                    sqltrans.Commit();
                }
                else
                {
                    sqltrans.Rollback();
                }
                return(result);
            }
        }
Ejemplo n.º 2
0
 public IActionResult MarkUserInternal(ReportUserInternal Internal)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _IReport.InsertReportUserInternal(Internal);
             return(RedirectToAction("Index"));
         }
         return(View(Internal));
     }
     catch
     {
         return(View());
     }
 }