public ActionResult CreateCheckRelation() { CheckRelationJsonContract checkRelationJsonContract = RequestArgs <CheckRelationJsonContract>(); if (checkRelationJsonContract == null) { return(RespondResult(false, "参数无效。")); } checkRelationJsonContract.Domain = UserContext.Domain.Id; _settingsManager.CreateCheckRelation(checkRelationJsonContract); return(RespondResult()); }
public void CreateCheckRelation(CheckRelationJsonContract checkRelationJsonContract) { if (checkRelationJsonContract == null) { return; } List <CommandParameter> list = new List <CommandParameter>(); list.Add(new CommandParameter("@checker", checkRelationJsonContract.Checker)); this._dataBase.ExecuteNonQuery("DELETE FROM [CheckRelation] WHERE [Checker] = @checker", list); List <SqlExpression> list2 = new List <SqlExpression>(); foreach (Guid current in checkRelationJsonContract.StaffList) { list2.Add(RelationalMappingUnity.GetSqlExpression(new CheckRelation { Domain = checkRelationJsonContract.Domain, Checker = checkRelationJsonContract.Checker, Staff = current }, SqlExpressionType.Insert)); } this._dataBase.ExcuteSqlExpression(list2); }