public List <int> AddTempMilestone(TempTransAddRequest request, int tempTransId) { int MId = 0; List <int> milestones = new List <int>(); for (var i = 0; i < request.Milestones.Count; i++) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Milestones_InsertTemp" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@TransactionId", tempTransId); paramCollection.AddWithValue("@Name", request.Milestones[i].Name); paramCollection.AddWithValue("@MilestoneStatusId", "1"); SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int); p.Direction = System.Data.ParameterDirection.Output; paramCollection.Add(p); }, returnParameters : delegate(SqlParameterCollection param) { int.TryParse(param["@Id"].Value.ToString(), out MId); }); milestones.Add(MId); } ; return(milestones); }
public int AddTempTrans(TempTransAddRequest request) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Transactions_InsertTemp" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@AuthorId", request.AuthorId); paramCollection.AddWithValue("@Name", request.Name); paramCollection.AddWithValue("@TransactionStatusId", "1"); paramCollection.AddWithValue("@Id", request.Id); }, returnParameters: null); return(request.Id); }
public List <List <int> > AddTempTasks(TempTransAddRequest request, List <int> tempMilestoneId) { int Id = 0; List <List <int> > milestone = new List <List <int> >(); for (var i = 0; i < request.Milestones.Count; i++) { if (request.Milestones[i].Tasks != null) { List <int> tasks = new List <int>(); for (var j = 0; j < request.Milestones[i].Tasks.Count; j++) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.Tasks_InsertTemp" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@MilestoneId", tempMilestoneId[i]); paramCollection.AddWithValue("@Name", request.Milestones[i].Tasks[j].Name); paramCollection.AddWithValue("@TaskStatusId", "1"); SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int); p.Direction = System.Data.ParameterDirection.Output; paramCollection.Add(p); }, returnParameters : delegate(SqlParameterCollection Param) { int.TryParse(Param["@Id"].Value.ToString(), out Id); }); tasks.Add(Id); } milestone.Add(tasks); } } ; return(milestone); }