protected void btnSubmitInfoCompany_OnClick(object sender, EventArgs e) { try { var companyName = txtFullNameCompany.Text; var companyShortName = txtShortNameCompany.Text; var companySize = new CompanySize(ddlQuyMoCongTy.SelectedValue, ddlQuyMoCongTy.SelectedItem.Text); var address = txtAddress.Text; Recruitor1 = (Recruitor)Session["Recruitor"]; var returnValue = Recruitor1.SetFullCompanyInfo(companyName, companyShortName, companySize, address); SetExistRecruiterInfo(); if (returnValue) { Session["Recruitor"] = Recruitor1; SetExistRecruiterInfo(); JavaScriptAleart("Thực hiện thành công"); } else { JavaScriptAleart("Chỉnh sửa không thành công. Vui lòng load lại trang và thử lại"); } } catch (Exception) { JavaScriptAleart("Chỉnh sửa không thành công. Vui lòng load lại trang và thử lại"); } }
/// <summary> /// Delete User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> DeleteCompanySize(int CompanySizeId) { #region Declare a return type with initial value. bool isCompanySizeDeleted = default(bool); #endregion try { if (CompanySizeId > default(int)) { #region Vars CompanySize CompanySize = null; #endregion #region Get CompanySize by id CompanySize = await UnitOfWork.CompanySizeRepository.GetById(CompanySizeId); #endregion #region check if object is not null if (CompanySize != null) { CompanySize.IsDeleted = (byte)DeleteStatusEnum.Deleted; #region Apply the changes to the database UnitOfWork.CompanySizeRepository.Update(CompanySize); isCompanySizeDeleted = await UnitOfWork.Commit() > default(int); #endregion } #endregion } } catch (Exception exception) { } return(isCompanySizeDeleted); }
void ReleaseDesignerOutlets() { if (CompanyName != null) { CompanyName.Dispose(); CompanyName = null; } if (CompanySize != null) { CompanySize.Dispose(); CompanySize = null; } if (RevenueLabel != null) { RevenueLabel.Dispose(); RevenueLabel = null; } if (SizeLabel != null) { SizeLabel.Dispose(); SizeLabel = null; } }
public void Delete(int id) { CompanySize item = context.CompanySize.Where(c => c.Id == id).FirstOrDefault(); context.CompanySize.Remove(item); context.SaveChanges(); }
public CompanySize ConvertToEF(CompanySizeDTO DTO) { var EF = new CompanySize() { CompanySizeId = DTO.CompanySizeId, CSMax = DTO.CSMax, CSMin = DTO.CSMin, CSShow = DTO.CSShow }; return(EF); }
public CompanySizeDTO ConvertToDTO(CompanySize EF) { var DTO = new CompanySizeDTO() { CompanySizeId = EF.CompanySizeId, CSMax = EF.CSMax, CSMin = EF.CSMin, CSShow = EF.CSShow }; return(DTO); }
public async Task <IActionResult> InsertCompanySize([FromBody] List <ScopeBusinessBindModel> scopeBusiness) { foreach (var item in scopeBusiness) { var newScope = new CompanySize() { NameVI = item.NameVI, NameEN = item.NameEN }; await unitOfWork.GetRepository <CompanySize>().InsertAsync(newScope); } return(ApiResponder.RespondSuccessTo(HttpStatusCode.Ok, "Insert OK!")); }
/// <summary> /// Mapping User Activity Log DTO to Action /// </summary> /// <param name=></param> /// <param name=></param> /// <returns></returns> public CompanySize MappingCompanySizeupdateDTOToCompanySize(CompanySize companySize, CompanySizeUpdateDTO CompanySizeUpdateDTO) { #region Declare Return Var with Intial Value CompanySize CompanySize = companySize; #endregion try { if (CompanySizeUpdateDTO.CompanySizeId > default(int)) { CompanySize.CompanySizeId = CompanySizeUpdateDTO.CompanySizeId; CompanySize.CompanySizeName = CompanySizeUpdateDTO.CompanySizeName; } } catch (Exception exception) { } return(CompanySize); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<CompanySize></returns> public CompanySize MappingCompanySizeAddDTOToCompanySize(CompanySizeAddDTO CompanySizeAddDTO) { #region Declare a return type with initial value. CompanySize CompanySize = null; #endregion try { CompanySize = new CompanySize { CompanySizeName = CompanySizeAddDTO.CompanySizeName, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(CompanySize); }
public CompanySizeReturnDTO MappingCompanySizeToCompanySizeReturnDTO(CompanySize CompanySize) { #region Declare a return type with initial value. CompanySizeReturnDTO CompanySizeReturnDTO = null; #endregion try { if (CompanySize != null) { CompanySizeReturnDTO = new CompanySizeReturnDTO { CompanySizeId = CompanySize.CompanySizeId, CompanySizeName = CompanySize.CompanySizeName }; } } catch (Exception exception) { } return(CompanySizeReturnDTO); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<CompanySizeReturnDTO></returns> public async Task <CompanySizeReturnDTO> GetCompanySizeById(int CompanySizeId) { #region Declare a return type with initial value. CompanySizeReturnDTO CompanySize = new CompanySizeReturnDTO(); #endregion try { CompanySize companySize = await UnitOfWork.CompanySizeRepository.GetById(CompanySizeId); if (companySize != null) { if (companySize.IsDeleted != (byte)DeleteStatusEnum.Deleted) { CompanySize = CompanySizeMapping.MappingCompanySizeToCompanySizeReturnDTO(companySize); } } } catch (Exception exception) { } return(CompanySize); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddCompanySize(CompanySizeAddDTO CompanySizeAddDTO) { #region Declare a return type with initial value. bool isCompanySizeCreated = default(bool); #endregion try { #region Vars CompanySize CompanySize = null; #endregion CompanySize = CompanySizeMapping.MappingCompanySizeAddDTOToCompanySize(CompanySizeAddDTO); if (CompanySize != null) { await UnitOfWork.CompanySizeRepository.Insert(CompanySize); isCompanySizeCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isCompanySizeCreated); }
/// <summary> /// Update User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> UpdateCompanySize(CompanySizeUpdateDTO CompanySizeUpdateDTO) { #region Declare a return type with initial value. bool isCompanySizeUpdated = default(bool); #endregion try { if (CompanySizeUpdateDTO != null) { #region Vars CompanySize CompanySize = null; #endregion #region Get Activity By Id CompanySize = await UnitOfWork.CompanySizeRepository.GetById(CompanySizeUpdateDTO.CompanySizeId); #endregion if (CompanySize != null) { #region Mapping CompanySize = CompanySizeMapping.MappingCompanySizeupdateDTOToCompanySize(CompanySize, CompanySizeUpdateDTO); #endregion if (CompanySize != null) { #region Update Entity UnitOfWork.CompanySizeRepository.Update(CompanySize); isCompanySizeUpdated = await UnitOfWork.Commit() > default(int); #endregion } } } } catch (Exception exception) { } return(isCompanySizeUpdated); }
public Customer(int id, string name, CompanySize companySize) { Id = id; Name = name; CompanySize = companySize; }
public void Update(CompanySize entity) { context.Entry(entity).State = EntityState.Modified; context.SaveChanges(); }
public void Insert(CompanySize entity) { context.CompanySize.Add(entity); context.SaveChanges(); }