Esempio n. 1
0
        public override bool Execute()
        {
            if (IdOperator <= 0)
            {
                Information = StringSource.OperatorNotFound();
                return(false);
            }


            using (var bankservice = new BankServiceClient()) {
                Operator = bankservice.GetEmployeeById(IdOperator);
                if (Operator != null)
                {
                    bankservice.RemoveEmployee(Operator);

                    Information = StringSource.OperatorRemoved();
                    return(true);
                }
                else
                {
                    Information = StringSource.OperatorNotFound();
                    return(false);
                }
            }
        }
Esempio n. 2
0
        public override bool Execute()
        {
            if (IdOperator <= 0)
            {
                Information = StringSource.OperatorNotFound();
                return(false);
            }
            if (!Verifier.CheckLogin(Login))
            {
                Information = StringSource.LoginStructureError();
                return(false);
            }
            if (!Verifier.CheckPassword(Password))
            {
                Information = StringSource.PasswordStructureError();
                return(false);
            }


            using (var bankservice = new BankServiceClient()) {
                Operator = bankservice.GetEmployeeById(IdOperator);

                if (Operator == null)
                {
                    Information = StringSource.OperatorNotFound();
                    return(false);
                }

                Operator.Login    = Login;
                Operator.Password = Password;
                //Operator.IsAdmin=Is

                bankservice.UpdateEmployee(Operator);
            }

            Information = StringSource.OperatorEdited();
            return(true);
        }