private void attach_tbl_Users(tbl_Users entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Roles = this;
		}
		private void detach_tbl_Users(tbl_Users entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Roles = null;
		}
 partial void Updatetbl_Users(tbl_Users instance);
 partial void Deletetbl_Users(tbl_Users instance);
 partial void Inserttbl_Users(tbl_Users instance);
		private void detach_tbl_Users(tbl_Users entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Applications = null;
		}
Exemple #7
0
 private bool Insert(UserInfo entUser)
 {
     TCRepositoryDataContext context = DataBaseUtils.GetContext();
     try
     {
         tbl_Users dbUser = new tbl_Users()
         {
             FirstName = entUser.FirstName,
             LastName = entUser.LastName,
             UserName = entUser.UserName,
             HashCode = entUser.HashCode,
             Password = entUser.Password,
             CreatedOn = DateTime.Now,
             Email = entUser.Email,
             IdCompany = entUser.EntCompany.IdCompany,
             IdStatus = entUser.EntStatus.IdStatus,
             IdRole = entUser.EntRole.IdRole,
             ModifiedOn = DateTime.Now
         };
         context.tbl_Users.InsertOnSubmit(dbUser);
         context.SubmitChanges();
         return true;
     }
     catch
     { }
     return false;
 }
Exemple #8
0
 private void AssignDataObjectToEntity(tbl_Users dbUser, ref UserInfo entUserInfo)
 {
     entUserInfo.UserCompleteName = String.Format("{0} {1}", dbUser.FirstName, dbUser.LastName);
     entUserInfo.IdUser = dbUser.IdUser;
     entUserInfo.UserName = dbUser.UserName;
     entUserInfo.FirstName = dbUser.FirstName;
     entUserInfo.LastName = dbUser.LastName;
     entUserInfo.Password = dbUser.Password;
     entUserInfo.HashCode = dbUser.HashCode;
     entUserInfo.CreatedOn = dbUser.CreatedOn;
     entUserInfo.ModifiedOn = dbUser.ModifiedOn;
     entUserInfo.EntCompany = new DataAccessLibrary.Services.CompanyService().GetByID(dbUser.IdCompany);
     entUserInfo.EntStatus = new DataAccessLibrary.Services.StatusService().GetById(dbUser.IdStatus);
     entUserInfo.EntRole = new RoleService().GetRoleByID(dbUser.IdRole);
     entUserInfo.Email = dbUser.Email;
 }
Exemple #9
0
 private void AssignDataObjectToEntity(tbl_Users dbUser, ref User entUser)
 {
     entUser.IdUser = dbUser.IdUser;
     entUser.UserName = dbUser.UserName;
     entUser.EntRole = new RoleService().GetRoleByUserID(entUser.IdUser);
     entUser.UserCompleteName = String.Format("{0} {1}", dbUser.FirstName, dbUser.LastName);
     entUser.Company = new DataAccessLibrary.Services.CompanyService().GetByID(dbUser.IdCompany);
     entUser.IdApplication = dbUser.IdApplication;
     entUser.Application = dbUser.tbl_Applications.Name;
 }