private static CostCentre GetCostCentre(AuthContext _context, EnumStatus costCentreCode) { var result = _context.CostCentres.Where(x => string.Compare(x.Code, costCentreCode.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result.FirstOrDefault()); }
private static Employee GetEmployee(AuthContext _context, EnumStatus employeeCode) { var result = _context.Employees.Where(x => string.Compare(x.Code, employeeCode.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result.FirstOrDefault()); }
private static Portfolio GetPortfolio(AuthContext context, EnumStatus portfolioType) { var result = context.Portfolios.Where(x => string.Compare(x.Code, portfolioType.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result.FirstOrDefault()); }
private static Department GetDepartment(AuthContext _context, EnumStatus departmentCode) { var result = _context.Deparments.Where(x => string.Compare(x.Code, departmentCode.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result.FirstOrDefault()); }
private static LineManager GetReviewPeriodUser(AuthContext context, EnumStatus employeeCode) { var result = context.LineManagers.Include(x => x.EmployeeDetail). FirstOrDefault(x => string.Compare(x.EmployeeDetail.Code, employeeCode.ToString()) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result); }
private static ReviewPeriod GetReviewPeriod(AuthContext context, EnumStatus reviewPeriodCode) { var result = context.ReviewPeriods.Include(x => x.RecordStatus). Where(x => string.Compare(x.Code, reviewPeriodCode.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0); return(result.FirstOrDefault()); }
static string _showEnumString(EnumStatus enumStatus) { switch (enumStatus) { case EnumStatus.Dormindo: return("Sleep"); case EnumStatus.Livre: return(enumStatus.ToString()); case EnumStatus.EmExecucao: return("Em execução"); case EnumStatus.Finalizado: return(enumStatus.ToString()); default: return(""); } }
private void changeStaus(EnumStatus eSatatus) { lblStatus.Text = eSatatus.ToString(); }
private static Organization GetOrg(AuthContext context, EnumStatus status) { return(context.Organizations.Include(x => x.RecordStatus). FirstOrDefault(x => string.Compare(x.RecordStatus.Code, status.ToString(), true) == 0)); }
private static RecordStatus GetStatus(AuthContext _context, EnumStatus type) { return(_context.RecordStatuses.FirstOrDefault(x => string.Compare(x.Code, type.ToString(), true) == 0)); }
private static Objective GetObjective(AuthContext context, EnumStatus objectiveCode) { return(context.Objectives.FirstOrDefault(x => string.Compare(x.Code, objectiveCode.ToString(), true) == 0)); }
private static PRDocumentType GetDocumentType(AuthContext _context, EnumStatus documentCode) { return(_context.PRDocumentTypes.FirstOrDefault(x => string.Compare(x.Code, documentCode.ToString(), true) == 0 && string.Compare(x.RecordStatus.Code, EnumStatus.ACT.ToString(), true) == 0)); }
public void SetStatus(EnumStatus value) { mStatus = value; switch (value) { case EnumStatus.ADDNEW: { btnAdd.Enabled = false; btnUpp.Enabled = false; btnDel.Enabled = false; btnSearch.Enabled = false; btnFirst.Enabled = false; btnPrev.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; btnCancel.Enabled = true; btnOk.Enabled = true; break; } case EnumStatus.EDIT: { btnAdd.Enabled = false; btnUpp.Enabled = false; btnDel.Enabled = false; btnSearch.Enabled = true; btnFirst.Enabled = false; btnPrev.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; btnCancel.Enabled = true; btnOk.Enabled = true; break; } case EnumStatus.DELETE: { btnAdd.Enabled = false; btnUpp.Enabled = false; btnDel.Enabled = false; btnSearch.Enabled = true; btnFirst.Enabled = false; btnPrev.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; btnCancel.Enabled = true; btnOk.Enabled = true; break; } case EnumStatus.SEARCH: { btnAdd.Enabled = true; btnUpp.Enabled = false; btnDel.Enabled = false; btnSearch.Enabled = true; btnFirst.Enabled = false; btnPrev.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; btnCancel.Enabled = true; btnOk.Enabled = true; break; } case EnumStatus.NAVIGATE: { btnAdd.Enabled = false; btnUpp.Enabled = true; btnDel.Enabled = true; btnSearch.Enabled = true; btnFirst.Enabled = true; btnPrev.Enabled = true; btnNext.Enabled = true; btnLast.Enabled = true; btnCancel.Enabled = true; btnOk.Enabled = true; break; } case EnumStatus.ADDGRIDLINE: case EnumStatus.EDITGRIDLINE: { btnAdd.Enabled = false; btnUpp.Enabled = false; btnDel.Enabled = false; btnSearch.Enabled = false; btnFirst.Enabled = false; btnPrev.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; btnCancel.Enabled = true; btnOk.Enabled = false; break; } } ItemsFormControl.ForEach(i => i.Status = value); if (CTLStatusBar != null) { if (MsgStatusLabel != null) { MsgStatusLabel.Text = value.ToString(); } } }
/// <summary> /// Entry point for Decoding Bar Code. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConvert_Click(object sender, EventArgs e) { switch (actionType) { //Encode Zip Code to Bar Code case EnumActionType.EncodeZipCode: if (txtBoxInput.Text.Length != 10) { showErrorMessage(EnumErrorType.InvalidZipCodeInput); } else { String barCode = BarCodeManager.encodeZipCode(txtBoxInput.Text); txtBoxOutput.Text = barCode; } break; //Decode Bar Code to Zip Code case EnumActionType.DecodeBarCode: if (txtBoxInput.Text.Length != 52) { showErrorMessage(EnumErrorType.InvalidBarCodeInput); } else { String zipCode = ""; EnumStatus status = BarCodeManager.decodeBarCode(txtBoxInput.Text, out zipCode); if (status == EnumStatus.Success) { string sVal = zipCode; string newst = Regex.Replace(sVal, ".{5}", "$0-"); txtBoxOutput.Text = newst; txtBoxOutput.SelectionStart = txtBoxOutput.Text.Length; } else { showErrorMessage((EnumErrorType)Enum.Parse(typeof(EnumErrorType), status.ToString())); } } break; } }