Exemplo n.º 1
0
        public void Insert(int ProjectID, int UserID)
        {
            ProjectAssignment item = new ProjectAssignment();

            item.ProjectID = ProjectID;

            item.UserID = UserID;


            item.Save(UserName);
        }
Exemplo n.º 2
0
        public void Update(int ProjectID, int UserID)
        {
            ProjectAssignment item = new ProjectAssignment();

            item.MarkOld();
            item.IsLoaded = true;

            item.ProjectID = ProjectID;

            item.UserID = UserID;

            item.Save(UserName);
        }
Exemplo n.º 3
0
        public static void SaveUserMap(int varId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [ProjectAssignments] WHERE [ProjectAssignments].[ProjectID] = @ProjectID", Project.Schema.Provider.Name);

            cmdDel.AddParameter("@ProjectID", varId, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProjectAssignment varProjectAssignment = new ProjectAssignment();
                varProjectAssignment.SetColumnValue("ProjectID", varId);
                varProjectAssignment.SetColumnValue("UserID", item);
                varProjectAssignment.Save();
            }
        }
Exemplo n.º 4
0
        public static void SaveProjectMap(int varId, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [ProjectAssignments] WHERE [ProjectAssignments].[UserID] = @UserID", User.Schema.Provider.Name);

            cmdDel.AddParameter("@UserID", varId, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    ProjectAssignment varProjectAssignment = new ProjectAssignment();
                    varProjectAssignment.SetColumnValue("UserID", varId);
                    varProjectAssignment.SetColumnValue("ProjectID", l.Value);
                    varProjectAssignment.Save();
                }
            }
        }
Exemplo n.º 5
0
 public bool Destroy(object ProjectID)
 {
     return(ProjectAssignment.Destroy(ProjectID) == 1);
 }
Exemplo n.º 6
0
 public bool Delete(object ProjectID)
 {
     return(ProjectAssignment.Delete(ProjectID) == 1);
 }