Ejemplo n.º 1
0
        /*********************************/

        /*************متدهای کلاس *************/
        private bool Freezed(int code)
        {
            Equipment_Data e = new Equipment_Data();

            if (e.Freezed_Data(code))
            {
                throw new HardWareExeption("این قطعه در حالت فریز می باشد");
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        internal bool Update(int code, int hardware, string model, string warranty, string warBegin, string warEnd, int state)
        {
            Equipment_Data myEquipment = new Equipment_Data();

            try
            {
                Code     = code;
                Model    = model;
                Warranty = warranty;
                WarBegin = warBegin;
                WarEnd   = warEnd;
                State    = state;
                Hardware = hardware;

                if (!myEquipment.Freezed_Data(Code))
                {
                    if (myEquipment.CheckCode(Code))
                    {
                        if (myEquipment.CheckCodeHardWare(Hardware))
                        {
                            if (myEquipment.CheckCodeState(State))
                            {
                                myEquipment.Update(Code, Hardware, Model, Warranty, WarBegin, WarEnd, State);
                                this._message = null;
                            }
                        }
                    }
                }

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