public List <string> ChekedList(TreeNodeCollection node)
        {
            List <string> nodelist = new List <string>();

            if (node == null)
            {
                return(nodelist);
            }
            foreach (TreeNode chilednode in node)
            {
                if (chilednode.Checked)
                {
                    UsersJobs j = new UsersJobs();
                    j.UserID    = this.GetUserIDForSetJob;
                    j.JobsID    = Convert.ToInt32(chilednode.Tag);
                    j.StartDate = PublicVariebale.ToDayDate;
                    j.Status    = 1;
                    DBCommon.Context.UsersJobs.Add(j);
                    DBCommon.Context.SaveChanges();
                    MessageBox.Show("انتصاب شغل با موفقیت ثبت شذ", "Succses", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                nodelist.AddRange(ChekedList(chilednode.Nodes));
            }
            return(nodelist);
        }
Example #2
0
 public UsersJobsDto MapGetUsersJobsDto(UsersJobs entity)
 {
     return(new UsersJobsDto
     {
         Id = entity.Id,
         Created = entity.Created,
         UserId = entity.UserId,
         UserEmail = entity.User.Email,
         JobId = entity.JobId,
         JobiTitle = entity.Job.Title,
         Deleted = entity.Deleted
     });
 }
Example #3
0
 public UsersJobs Update(UsersJobs T)
 {
     _db.UsersJobs.Update(T);
     _db.SaveChanges();
     return(T);
 }
Example #4
0
 public UsersJobs Add(UsersJobs T)
 {
     _db.UsersJobs.Add(T);
     _db.SaveChanges();
     return(_db.UsersJobs.Include(o => o.User).Include(o => o.Job).FirstOrDefault(o => o.Id == T.Id));
 }