private void SetEditBoxStatus(EnumEditStatus iStatus) { switch (iStatus) { case EnumEditStatus.Insert: EnableEditBox(true); this.txtUserID.Text = ""; this.chkActive.Checked = true; this.txtUserName.Text = ""; this.chkSurchargeSettings.Checked = false; this.chkClearHistory.Checked = false; this.txtUserID.ReadOnly = false; this.btnUpdate.Text = "Insert"; break; case EnumEditStatus.Update: EnableEditBox(true); this.txtUserID.Text = oUserList[lvUsers.FocusedItem.Index].UserID; this.chkActive.Checked = (oUserList[lvUsers.FocusedItem.Index].Status == User.EnumStatus.Active); this.txtUserName.Text = oUserList[lvUsers.FocusedItem.Index].UserName; this.chkSurchargeSettings.Checked = (oUserList[lvUsers.FocusedItem.Index].RightOfSurchargeSettings == UserRight.EnumAuthorization.Authorized); this.chkClearHistory.Checked = (oUserList[lvUsers.FocusedItem.Index].RightOfClearHistory == UserRight.EnumAuthorization.Authorized); this.txtUserID.ReadOnly = true; this.btnUpdate.Text = "Update"; break; case EnumEditStatus.None: EnableEditBox(false); this.txtUserID.Text = ""; this.chkActive.Checked = true; this.txtUserName.Text = ""; this.chkSurchargeSettings.Checked = false; this.chkClearHistory.Checked = false; this.txtUserID.ReadOnly = false; this.btnUpdate.Text = "Insert"; break; } // Special treatment for ADMIN if (this.txtUserID.Text == "ADMIN") { this.chkActive.Visible = false; } else { this.chkActive.Visible = true; } }
private void MachineShiftStting_Load(object sender, EventArgs e) { GetMachineInfo(); ShowMachineInfo(); GetShiftTypeGroupInfo(); ShowShiftTypeGropInfo(); BindComboBox_ShiftTypeCode(); SetControlsEnable(false); this.GroupEditStatus = EnumEditStatus.Readonly; this.ShiftTypeEditStatus = EnumEditStatus.Readonly; }