/// <summary> /// Converts this instance of <see cref="systemuser"/> to an instance of <see cref="systemuserDto"/>. /// </summary> /// <param name="entity"><see cref="systemuser"/> to convert.</param> public static systemuserDto ToDTO(this systemuser entity) { if (entity == null) { return(null); } var dto = new systemuserDto(); dto.i_SystemUserId = entity.i_SystemUserId; dto.v_PersonId = entity.v_PersonId; dto.v_UserName = entity.v_UserName; dto.v_Password = entity.v_Password; dto.v_SecretQuestion = entity.v_SecretQuestion; dto.v_SecretAnswer = entity.v_SecretAnswer; dto.d_ExpireDate = entity.d_ExpireDate; dto.i_IsDeleted = entity.i_IsDeleted; dto.i_InsertUserId = entity.i_InsertUserId; dto.d_InsertDate = entity.d_InsertDate; dto.i_UpdateUserId = entity.i_UpdateUserId; dto.d_UpdateDate = entity.d_UpdateDate; dto.i_SystemUserTypeId = entity.i_SystemUserTypeId; dto.i_RolVentaId = entity.i_RolVentaId; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="systemuserDto"/> to an instance of <see cref="systemuser"/>. /// </summary> /// <param name="dto"><see cref="systemuserDto"/> to convert.</param> public static systemuser ToEntity(this systemuserDto dto) { if (dto == null) { return(null); } var entity = new systemuser(); entity.i_SystemUserId = dto.i_SystemUserId; entity.v_PersonId = dto.v_PersonId; entity.v_UserName = dto.v_UserName; entity.v_Password = dto.v_Password; entity.v_SecretQuestion = dto.v_SecretQuestion; entity.v_SecretAnswer = dto.v_SecretAnswer; entity.d_ExpireDate = dto.d_ExpireDate; entity.i_IsDeleted = dto.i_IsDeleted; entity.i_InsertUserId = dto.i_InsertUserId; entity.d_InsertDate = dto.d_InsertDate; entity.i_UpdateUserId = dto.i_UpdateUserId; entity.d_UpdateDate = dto.d_UpdateDate; entity.i_SystemUserTypeId = dto.i_SystemUserTypeId; entity.i_RolVentaId = dto.i_RolVentaId; dto.OnEntity(entity); return(entity); }
public bool RegisterUser(string fullname, string email, string password) { try { var data = _context.systemuser.Where(p => p.email == email).FirstOrDefault(); if (data == null) { systemuser su = new systemuser(); su.fullname = fullname; su.email = email; su.password = password; su.createdon = DateTime.Now; su.createdby = fullname; su.modifiedon = DateTime.Now; su.modifiedby = fullname; su.statuscode = 0; _context.systemuser.Add(su); _context.SaveChanges(); Guid lastid = su.systemuserid; systemuserrole sr = new systemuserrole(); sr.systemuserid = lastid; sr.roleid = new Guid("3edace78-cc1d-47c1-8e32-8356b2b0aa48"); sr.createdon = DateTime.Now; sr.createdby = fullname; sr.modifiedon = DateTime.Now; sr.modifiedby = fullname; _context.systemuserrole.Add(sr); _context.SaveChanges(); return(true); } else { return(false); } } catch (Exception ex) { throw ex; //return false; } }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="systemuser"/> converted from <see cref="systemuserDto"/>.</param> static partial void OnEntity(this systemuserDto dto, systemuser entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="systemuserDto"/> converted from <see cref="systemuser"/>.</param> static partial void OnDTO(this systemuser entity, systemuserDto dto);
public void UpdateProfile(systemuser systemuser) { throw new NotImplementedException(); }