Beispiel #1
0
        public void ChangeRoles(User o)
        {
            using (var scope = new TransactionScope())
            {
                DbUtil.ExecuteNonQuerySp("clearRoles", new { o.Id }, Cs);

                foreach (var role in o.Roles)
                {
                    DbUtil.ExecuteNonQuerySp("assignRole", new { userId = o.Id, roleId = role.Id }, Cs);
                }
                scope.Complete();
            }
        }
Beispiel #2
0
        public override int Insert(User o)
        {
            using (var scope = new TransactionScope())
            {
                var userId = DbUtil.Insert(o, Cs, new[] { "Id", "Roles" });

                foreach (var role in o.Roles)
                {
                    DbUtil.ExecuteNonQuerySp("assignRole", new { userId, roleId = role.Id }, Cs);
                }

                scope.Complete();
                return(userId);
            }
        }
Beispiel #3
0
 public int Activate(int id)
 {
     return(DbUtil.ExecuteNonQuerySp("activateMeasureset", new { id }, Cs));
 }
Beispiel #4
0
 public int ChangeState(int id, int stateId)
 {
     return(DbUtil.ExecuteNonQuerySp("changeMeasuresetState", new { id, stateId }, Cs));
 }
Beispiel #5
0
 public int UnassignField(int fieldId, int fieldsetId)
 {
     return(DbUtil.ExecuteNonQuerySp("unassignField", new { fieldId, fieldsetId }, Cs));
 }
Beispiel #6
0
 public int Unassign(int measureId, int measuresetId)
 {
     return(DbUtil.ExecuteNonQuerySp("unassignMeasure", new { measureId, measuresetId }, Cs));
 }
Beispiel #7
0
 public void MoveToFpi(int fpiId)
 {
     DbUtil.ExecuteNonQuerySp("updateToFpi", new { fpiId }, Cs);
 }
Beispiel #8
0
 public void RollbackToIndicators(int fpiId)
 {
     DbUtil.ExecuteNonQuerySp("rollbackToIndicators", new { fpiId }, Cs);
 }
Beispiel #9
0
 public int RollbackWinners(int fpiId)
 {
     return(DbUtil.ExecuteNonQuerySp("rollbackWinners", new { fpiId }, Cs));
 }
Beispiel #10
0
 public int ChangeState(int id, DossierStates stateId)
 {
     return(DbUtil.ExecuteNonQuerySp("changeDossierState", new { id, stateId }, Cs));
 }