Ejemplo n.º 1
0
        public bool Freezed(int code)
        {
            Person_Data p = new Person_Data();

            if (p.Freezed_Data(code))
            {
                throw new HardWareExeption("این پرسنل در حالت فریز می باشد");
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool Update(int code, string name, string lastName, string dakheli, int bulding, string room, int group)
        {
            Person_Data   myPerson = new Person_Data();
            Building_Data myBuild  = new Building_Data();

            try
            {
                Name     = name;
                LastName = lastName;
                Dakheli  = dakheli;
                Bulding  = bulding;
                Room     = room;
                Group    = group;

                if (!myPerson.Freezed_Data(code))
                {
                    if (myPerson.CheckCode(code))
                    {
                        if (myBuild.CheckCode(bulding))
                        {
                            myPerson.Update(Code, Name, LastName, Dakheli, Bulding, Room, Group);
                            this._password = myPerson.Pass;
                            this._message  = null;
                        }
                    }
                }

                return(true);
            }
            catch (HardWareExeption ex)
            {
                this._message = ex.Message;
                return(false);
            }
            catch (Exception ex)
            {
                this._message = ex.Message;
                return(false);
            }
        }