protected override void PrepareSpecificControls(eControlMode state) { switch (state) { case eControlMode.Consulta: case eControlMode.Alta: this.hdnImage.Value = string.Empty; this.imgPreview.Src = string.Empty; this.btnBrowse.Visible = true; break; case eControlMode.Edicion: this.btnBrowse.Visible = true; break; case eControlMode.Ver: case eControlMode.Baja: case eControlMode.Aprobar: default: this.btnBrowse.Visible = false; break; } }
protected abstract void PrepareSpecificControls(eControlMode state);
protected virtual void PrepareControls(eControlMode state) { CheckBox chkD = this.chkDeactive; if (chkD != null) { this.chkDeactive.Visible = this.CurrentUserRoleIsA1OrSG; this.chkDeactive.Enabled = false; this.chkDeactive.AutoPostBack = false; } Label lbl = this.lblMessages; if (lbl != null) { lbl.Visible = false; lbl.Text = string.Empty; } switch (state) { case eControlMode.Ver: ControlsHelper.EnableControls(false, this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, false); break; case eControlMode.Baja: ControlsHelper.EnableControls(false, this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, false); if (chkD != null) this.chkDeactive.Visible = false; break; case eControlMode.Edicion: bool enable = (this.chkDeactive != null) ? !this.chkDeactive.Checked : false; ControlsHelper.EnableControls(enable, this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, false); if (chkD != null) this.chkDeactive.Enabled = this.CurrentUserRoleIsSG; break; case eControlMode.Aprobar: ControlsHelper.EnableControls(false, this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, false); break; case eControlMode.Consulta: ControlsHelper.EnableControls(true, this.Controls); ControlsHelper.ClearControls(this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, true); if (chkD != null) { if (this.IsPopup) this.chkDeactive.Visible = false; else this.chkDeactive.Enabled = this.CurrentUserRoleIsA1OrSG; } break; case eControlMode.Alta: ControlsHelper.EnableControls(true, this.Controls); ControlsHelper.ClearControls(this.Controls); ControlsHelper.ShowFiltersControls(this.Controls, false); if (chkD != null) this.chkDeactive.Visible = false; break; default: break; } }
protected override void PrepareSpecificControls(eControlMode state) { }
protected override void PrepareSpecificControls(eControlMode state) { switch (state) { case eControlMode.Consulta: this.Datasheets = null; this.idsForDelete = null; this.idsForEdit = null; this.EnableValidators(false); break; case eControlMode.Alta: case eControlMode.Edicion: this.ShowColumnActions(true); this.btnShowNewControls.Visible = true; this.ddlCompany.Enabled = this.txtArticleNameAsCompany.Enabled = true; this.txtArticlePrice.Enabled = true; this.txtAMLA.Enabled = this.txtConditionOfSale.Enabled = true; this.txtArticleDate.Enabled = true; this.EnableValidators(true); break; case eControlMode.Ver: case eControlMode.Baja: case eControlMode.Aprobar: default: this.ShowColumnActions(false); this.btnShowNewControls.Visible = false; this.EnableValidators(false); break; } }