/// <summary> /// وارد کردن داده های فعالیت یک پروژه مشخص از PWA /// </summary> internal void Sync(Guid projectID) { try { string commandText = string.Format(@" Select ProjectUID, TaskUID, TaskName, TaskParentUID From dbo.MSP_EpmTask_UserView Where ProjectUID = '{0}'", projectID); SqlCommand sqlCommand = new SqlCommand(commandText, new SqlConnection(_PWAConnString)); var dataTable = SqlQueryExecute.GetDataTable(commandText, _PWAConnString); List <Task> tasks = PWATranslator.ToTasks(dataTable); tasks.ForEach(entity => { if (IsExistById(entity.ID)) { Edit(entity); } else { Add(entity); } }); } catch { } }
/// <summary> /// وارد کردن داده های فعالیت از PWA /// </summary> internal void Sync() { string commandText = @" Select ProjectUID, TaskUID, TaskName, TaskParentUID From ProjectWebApp.dbo.MSP_EpmTask_UserView" ; SqlCommand sqlCommand = new SqlCommand(commandText, new SqlConnection(_PWAConnString)); var dataTable = SqlQueryExecute.GetDataTable(commandText, _PWAConnString); List <Task> tasks = PWATranslator.ToTasks(dataTable); tasks.ForEach(entity => { if (IsExistById(entity.ID)) { Edit(entity); } else { Add(entity); } }); }