protected void OnConfirm(object sender, EventArgs e) { string operationResult = "Successo"; string optionSelected = null; string description = Server.HtmlDecode(DescriptionInput.Text).Trim(); CleanMessage(MessagePanel, ErrorPanel); try { optionSelected = btnConfirm.CommandName; switch (optionSelected) { case "CRE": CreateRecord(description); break; case "DEL": DeleteRecord(int.Parse(IdInput.Text)); break; case "UPD": UpdateRecord(int.Parse(IdInput.Text), description); break; case "QRY": break; } BindEntities(1); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.04.02", GetOperation(optionSelected), operationResult); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetPageDescription(Resources.Resource.lControlPanel); BindCompanies(ddlCompany); BindFormStates(ddlFormState); User user = WebSecurity.GetUserInfo(Page.User.Identity.Name); int? companyId = user.CompanyID; ddlCompany.SelectedValue = companyId.ToString(); if (companyId != null && companyId != 0) { ddlCompany.Enabled = false; ProcessUserProductionUnitsForms(user); } else { GetZEEFormsInQueue(user.FunctionalAreaID); BindZEEUserForms(user); } AuditAction.Create(Page.User.Identity.Name, "ControlPanel", GetOperation("QRY"), "Successo"); } }
protected void OnConfirm(object sender, EventArgs e) { string operationResult = "Successo"; string optionSelected = null; string description = Server.HtmlDecode(DescriptionInput.Text).Trim(); string smallDescription = Server.HtmlDecode(SmallDescriptionInput.Text).Trim(); string isoCode = Server.HtmlDecode(IsoInput.Text).Trim(); CleanMessage(MessagePanel, ErrorPanel); if (DescriptionInput.Text == "") { ShowError(ErrorPanel, Resources.Resource.mMandatoryCountryName); return; } if (SmallDescriptionInput.Text == "") { ShowError(ErrorPanel, Resources.Resource.mMandatoryCountryLabelName); return; } if (IsoInput.Text == "") { ShowError(ErrorPanel, Resources.Resource.mMandatoryCountryIsoCode); return; } try { optionSelected = btnConfirm.CommandName; switch (optionSelected) { case "CRE": CreateRecord(smallDescription, description, isoCode); break; case "DEL": DeleteRecord(int.Parse(IdInput.Text)); break; case "UPD": UpdateRecord(int.Parse(IdInput.Text), smallDescription, description, isoCode); break; case "QRY": break; } BindEntities(1); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.02.02", GetOperation(optionSelected), operationResult); } }
private void UpdateEvent(int formState) { string operationResult = "Successo"; string optionSelected = "UPD"; int HumanResourceQualificationFormId = 0; int?localWorkerWithLowQualification = GetIntValueFromInput(LocalWorkerWithLowQualificationInput.Text); int?localWorkerWithMediumQualification = GetIntValueFromInput(LocalWorkerWithMediumQualificationInput.Text); int?localWorkerWithHighQualification = GetIntValueFromInput(LocalWorkerWithHighQualificationInput.Text); int?externalWorkerWithLowQualification = GetIntValueFromInput(ExternalWorkerWithLowQualificationInput.Text); int?externalWorkerWithMediumQualification = GetIntValueFromInput(ExternalWorkerWithMediumQualificationInut.Text); int?externalWorkerWithHighQualification = GetIntValueFromInput(ExternalWorkerWithHighQualificationInput.Text); CleanMessage(MessagePanel, ErrorPanel); try { HumanResourceQualificationFormId = int.Parse(CompanyFormID.Value); UpdateRecord(HumanResourceQualificationFormId, formState, localWorkerWithLowQualification, localWorkerWithMediumQualification, localWorkerWithHighQualification, externalWorkerWithLowQualification, externalWorkerWithMediumQualification, externalWorkerWithHighQualification); BackPanel.Visible = true; ConfirmButtonPanel.Visible = false; DetailPanel.Visible = true; DetailPanel.Enabled = false; ApprovePanel.Visible = false; if (formState == 2) { ShowInfo(MessagePanel, Resources.Resource.mUpdateOK); } else if (formState == 3) { ShowInfo(MessagePanel, Resources.Resource.mSubmitedOK); } else if (formState == 4) { ShowInfo(MessagePanel, Resources.Resource.mApprovedOK); } else if (formState == 5) { ShowInfo(MessagePanel, Resources.Resource.mRejectedOK); } } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.03.06", GetOperation(optionSelected), operationResult); } }
private void UpdateEvent(int formState) { string operationResult = "Successo"; string optionSelected = "UPD"; int HumanResourceFormId = 0; int?nrTotalHorasFormacao = GetIntValueFromInput(NrTotalHorasFormacaoInput.Text); int?nrDiasAusenciaTrabalho = GetIntValueFromInput(NrDiasAusenciaTrabalhoInput.Text); int?nrDiasUteisPeriodo = GetIntValueFromInput(NrDiasUteisPeriodoInput.Text); int?nrColaboradoresAdmitidos = GetIntValueFromInput(NrColaboradoresAdmitidosInput.Text); int?nrSaidas = GetIntValueFromInput(NrSaidasInput.Text); CleanMessage(MessagePanel, ErrorPanel); try { HumanResourceFormId = int.Parse(CompanyFormID.Value); UpdateRecord(HumanResourceFormId, formState, nrTotalHorasFormacao, nrDiasAusenciaTrabalho, nrDiasUteisPeriodo, nrColaboradoresAdmitidos, nrSaidas); BackPanel.Visible = true; ConfirmButtonPanel.Visible = false; DetailPanel.Visible = true; DetailPanel.Enabled = false; ApprovePanel.Visible = false; if (formState == 2) { ShowInfo(MessagePanel, Resources.Resource.mUpdateOK); } else if (formState == 3) { ShowInfo(MessagePanel, Resources.Resource.mSubmitedOK); } else if (formState == 4) { ShowInfo(MessagePanel, Resources.Resource.mApprovedOK); } else if (formState == 5) { ShowInfo(MessagePanel, Resources.Resource.mRejectedOK); } } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.03.05", GetOperation(optionSelected), operationResult); } }
protected void OnConfirm(object sender, EventArgs e) { string operationResult = "Successo"; string optionSelected = null; string email = Server.HtmlDecode(EmailInput.Text).Trim(); string userName = UserNameInput.Text; string password = PasswordInput.Text; string firstName = FirstNameInput.Text; string lastName = LastNameInput.Text; int companyID = int.Parse(ddlCompany.SelectedValue); int functionalAreaID = int.Parse(ddlFunctionalArea.SelectedValue); Boolean isManager = cbManager.Checked; Boolean isExecutive = cbExecutive.Checked; Boolean?isLockedOut = cbIsLockedOut.Checked; CleanMessage(MessagePanel, ErrorPanel); try { optionSelected = btnConfirm.CommandName; switch (optionSelected) { case "CRE": if (!IsValidUser()) { return; } CreateRecord(userName, password, email, firstName, lastName, companyID, functionalAreaID, isManager, isExecutive, isLockedOut); break; case "DEL": DeleteRecord(userName); break; case "UPD": UpdateRecord(userName, password, email, firstName, lastName, companyID, functionalAreaID, isManager, isExecutive, isLockedOut); break; case "QRY": break; } BindEntities(1); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.04.01", GetOperation(optionSelected), operationResult); } }
private void UpdateEvent(int formState) { string operationResult = "Successo"; string optionSelected = "UPD"; int operationalFormId = 0; CleanMessage(MessagePanel, ErrorPanel); try { operationalFormId = int.Parse(CompanyFormID.Value); UpdateRecord(operationalFormId, formState); BackPanel.Visible = true; ConfirmButtonPanel.Visible = false; DetailPanel.Visible = true; DetailPanel.Enabled = false; ApprovePanel.Visible = false; if (formState == 2) { ShowInfo(MessagePanel, Resources.Resource.mUpdateOK); } else if (formState == 3) { ShowInfo(MessagePanel, Resources.Resource.mSubmitedOK); } else if (formState == 4) { ShowInfo(MessagePanel, Resources.Resource.mApprovedOK); } else if (formState == 5) { ShowInfo(MessagePanel, Resources.Resource.mRejectedOK); } } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.03.04", GetOperation(optionSelected), operationResult); } }
protected void OnConfirm(object sender, EventArgs e) { string operationResult = "Successo"; CleanMessage(MessagePanel, ErrorPanel); try { BindEntities(1); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.04.03", GetOperation("QRY"), operationResult); } }
protected void OnConfirm(object sender, EventArgs e) { string operationResult = "Successo"; string optionSelected = null; string description = DescriptionInput.Text; int areaId = int.Parse(CBArea.SelectedValue); int companyId = int.Parse(CBCompany.SelectedValue); int sectorId = int.Parse(CBSector.SelectedValue); int? hectares = GetIntValueFromInput(HectaresInput.Text); CleanMessage(MessagePanel, ErrorPanel); if (DescriptionInput.Text == "") { ShowError(ErrorPanel, Resources.Resource.mMandatoryDescription); return; } if (areaId == 0) { ShowError(ErrorPanel, Resources.Resource.mMandatoryArea); return; } if (sectorId == 0) { ShowError(ErrorPanel, Resources.Resource.mMandatorySector); return; } if (companyId == 0) { ShowError(ErrorPanel, Resources.Resource.mMandatoryCompany); return; } try { optionSelected = btnConfirm.CommandName; switch (optionSelected) { case "CRE": CreateRecord(description, areaId, companyId, sectorId, hectares); break; case "DEL": DeleteRecord(int.Parse(IdInput.Text)); break; case "UPD": UpdateRecord(int.Parse(IdInput.Text), description, areaId, companyId, sectorId, hectares); break; case "QRY": break; } BindEntities(1); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); operationResult = exp.Message; } finally { AuditAction.Create(Page.User.Identity.Name, "SMI.02.11", GetOperation(optionSelected), operationResult); } }