Ejemplo n.º 1
0
        /// <summary>
        /// Parses the command line arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        void ParseCommandLineArgs(string[] args)
        {
            _appMode = Enums.Mode.ExitNow;

            if (args.Count() == 1)
            {
                string cmdSwitch = args[0].ToLower();

                if (cmdSwitch.StartsWith("/config") && cmdSwitch.Length == 7)
                {
                    _appMode = Enums.Mode.Config;
                }
                else if (cmdSwitch.StartsWith("/llama") && cmdSwitch.Length == 6)
                {
                    _appMode = Enums.Mode.Llama;
                }
                else if (cmdSwitch.StartsWith("/kiosk") && cmdSwitch.Length == 6)
                {
                    _appMode = Enums.Mode.Kiosk;
                    throw new NotImplementedException();
                }
                else if (cmdSwitch.StartsWith("/score:") && cmdSwitch.Length > 7)
                {
                    // Parse score value.
                    int  value;
                    bool success = Int32.TryParse(cmdSwitch.Substring(7), out value);
                    if (success)
                    {
                        Score = value;
                    }

                    _appMode = Enums.Mode.Score;
                }
            }
        }
Ejemplo n.º 2
0
        private void dgvItemOptions_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvItemOptions.Columns[e.ColumnIndex].Name == "Remove" && string.IsNullOrEmpty(dgvItemOptions.Columns[e.ColumnIndex].HeaderText))
            {
                DialogResult dr = MessageBox.Show("Do you want to delete this item ?", "Bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    mode = Enums.Mode.Delete;

                    if (this.dgvItemOptions.SelectedRows.Count > 0)
                    {
                        row           = dgvItemOptions.Rows.Count - 1;
                        counter       = counter - 1;
                        totalQuantity = Convert.ToDouble(txtTotalQuantity.Text) - Convert.ToDouble(dgvItemOptions.Rows[e.RowIndex].Cells["Quantity"].Value);
                        grandTotal    = Convert.ToDouble(txtGrandTotal.Text) - Convert.ToDouble(dgvItemOptions.Rows[e.RowIndex].Cells["Total"].Value);
                        totalItems    = Convert.ToInt32(txtTotalItems.Text) - 1;

                        txtTotalQuantity.Text = totalQuantity.ToString();
                        txtGrandTotal.Text    = grandTotal.ToString();
                        txtTotalItems.Text    = totalItems.ToString();

                        dgvItemOptions.Rows.RemoveAt(this.dgvItemOptions.SelectedRows[0].Index);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private Enums.Mode SetConnection(CallEventArgs call)
        {
            Port portOut = Ports.FirstOrDefault(x => x.PhoneNumber == call.OutPhoneNumber);

            if (portOut == null)
            {
                return(Enums.Mode.NotExist);
            }
            Port portIn = Ports.First(x => x.PhoneNumber == call.InPhoneNumber);

            Enums.Mode modePort = portOut.Mode;
            if (modePort == Enums.Mode.Free)
            {
                if (!ActiveConnections.ContainsKey(call.InPhoneNumber))
                {
                    GetStation().TerminalAnswered   += portIn.OutCallAnswered;
                    GetStation().TerminalNoAnswered += portIn.OutCallNoAnswered;
                    GetStation().TerminalRejected   += portIn.OutCallRejected;
                    ActiveConnections.Add(call.InPhoneNumber, call.OutPhoneNumber);
                    portOut.Mode           = Enums.Mode.Ringing;
                    portIn.Mode            = Enums.Mode.Ringing;
                    portOut.AnswerEvent   += AnsweredCall;
                    portOut.RejectEvent   += RejectedCall;
                    portOut.NoAnswerEvent += NoAnsweredCall;
                    portOut.IncomingCall(call.InPhoneNumber);
                }
            }
            if (modePort == Enums.Mode.Ringing)
            {
                return(Enums.Mode.Busy);
            }
            return(modePort);
        }
Ejemplo n.º 4
0
        public string SelectCorrectTempInF(Enums.Mode theMode, bool isOccupied)
        {
            string temp = "60";

            if (theMode == Enums.Mode.AUTOCOOL)
            {
                if (isOccupied)
                {
                    temp = this.CoolOccupiedRoomsTo;
                }
                else
                {
                    temp = this.CoolUnoccupiedRoomsTo;
                }
            }
            else
            {
                if (isOccupied)
                {
                    temp = this.HeatOccupiedRoomsTo;
                }
                else
                {
                    temp = this.HeatUnoccupiedRoomsTo;
                }
            }

            return(ToCWithCorrectLimits(theMode, temp));
        }
Ejemplo n.º 5
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     mode = Enums.Mode.Edit;
     dgvItemOptions.Visible = false;
     grpBoxBilling.Visible  = true;
     btnBack.Enabled        = true;
 }
Ejemplo n.º 6
0
        public static bool SetTemp(Enums.Mode theMode, string newTemp, int theUnitID)
        {
            string command = SETTEMPANDMODE.Replace("THENEWTEMP", newTemp);

            command = command.Replace("THENEWMODE", theMode.ToString());
            command = command.Replace("PSCUNIT", theUnitID.ToString());
            return(SendRequest(command));
        }
Ejemplo n.º 7
0
 private void Init(string schemmaName, Enums.Mode connectionMode)
 {
     _schemmaName   = schemmaName;
     ConnectionMode = connectionMode;
     insertCommands = new List <object>();
     updateCommands = new List <object>();
     deleteCommands = new List <object>();
 }
Ejemplo n.º 8
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     mode                    = Enums.Mode.Add;
     btnEdit.Enabled         = false;
     btnSave.Enabled         = true;
     btnViewAll.Enabled      = true;
     dgvStaffMembers.Visible = false;
     btnViewAll.Text         = "View All";
 }
Ejemplo n.º 9
0
        internal void Minus(Enums.Mode _Resource, int _Value)
        {
            int Index = this.FindIndex(T => T.Data == (int)_Resource);

            if (Index > -1)
            {
                this[Index].Count -= _Value;
            }
        }
Ejemplo n.º 10
0
        public static string ToCWithCorrectLimits(Enums.Mode theMode, string temp)
        {
            Double tempD;

            if (Double.TryParse(temp, out tempD))
            {
                if (tempD == 0)
                {
                    return("19"); //default on error
                }

                //convert to C
                tempD = FtoC(tempD);
                tempD = RoundWithCorrectLimit(tempD);

                if (theMode == Enums.Mode.COOL || theMode == Enums.Mode.DRY)
                {
                    if (tempD < 19)
                    {
                        return("19");
                    }
                    if (tempD > 30)
                    {
                        return("30");
                    }
                }

                if (theMode == Enums.Mode.HEAT || theMode == Enums.Mode.FAN)
                {
                    if (tempD < 17)
                    {
                        return("17");
                    }
                    if (tempD > 28)
                    {
                        return("28");
                    }
                }

                if (theMode == Enums.Mode.AUTO || theMode == Enums.Mode.AUTOHEAT || theMode == Enums.Mode.AUTOCOOL)
                {
                    if (tempD < 19)
                    {
                        return("19");
                    }
                    if (tempD > 28)
                    {
                        return("28");
                    }
                }

                return(tempD.ToString());
            }
            return("19"); //default
        }
Ejemplo n.º 11
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     ResetAfterSubmission();
     dgBillSummary.Hide();
     txtRegNo.Focus();
     mode             = Enums.Mode.Add;
     btnPrint.Enabled = false;
     isBillEdit       = false;
     btnSave.Enabled  = true;
     gbSearch.Visible = false;
 }
Ejemplo n.º 12
0
 private void btnNew_Click_1(object sender, EventArgs e)
 {
     mode                   = Enums.Mode.Add;
     txtBillItem.Text       = string.Empty;
     txtPrice.Text          = string.Empty;
     txtItemOptionId.Text   = string.Empty;
     btnEdit.Enabled        = false;
     dgvItemOptions.Visible = false;
     grpBoxBilling.Visible  = true;
     btnBack.Enabled        = true;
     GetItemCode();
 }
Ejemplo n.º 13
0
        private void txtQuantity_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) && e.KeyChar != (char)Keys.Enter && e.KeyChar != (char)Keys.Back && e.KeyChar != 46)
            {
                e.Handled = true;
            }

            if (e.KeyChar == (char)Keys.Enter)
            {
                if (!string.IsNullOrEmpty(txtQuantity.Text) && Convert.ToDouble(txtQuantity.Text) > 0)
                {
                    if (mode == Enums.Mode.Edit)
                    {
                        this.dgvItemOptions.Rows.RemoveAt(row - 1);
                        totalQuantity = totalQuantity - totalQuantityUpdate;
                        grandTotal    = grandTotal - grandTotalUpdate;

                        txtTotalQuantity.Text = totalQuantity.ToString();
                        txtGrandTotal.Text    = grandTotal.ToString();

                        mode = Enums.Mode.Add;

                        totalQuantity = totalQuantity + Convert.ToDouble(txtQuantity.Text);
                        grandTotal    = grandTotal + Convert.ToDouble(txtPriceTotal.Text);

                        this.dgvItemOptions.Rows.Add(row.ToString(), txtItemCode.Text, cmbItemName.Text, txtQuantity.Text, txtPrice.Text, txtPriceTotal.Text, Properties.Resources.DeleteRed);
                        txtTotalItems.Text    = totalItems.ToString();
                        txtTotalQuantity.Text = totalQuantity.ToString();
                        txtGrandTotal.Text    = grandTotal.ToString();
                        this.dgvItemOptions.Sort(this.dgvItemOptions.Columns["SerialNo"], ListSortDirection.Ascending);
                        ResetValues();
                    }
                    else
                    {
                        counter       = counter + 1;
                        totalItems    = totalItems + 1;
                        totalQuantity = totalQuantity + Convert.ToDouble(txtQuantity.Text);
                        grandTotal    = grandTotal + Convert.ToDouble(txtPriceTotal.Text);

                        this.dgvItemOptions.Rows.Add(counter.ToString(), txtItemCode.Text, cmbItemName.Text, txtQuantity.Text, txtPrice.Text, txtPriceTotal.Text, Properties.Resources.DeleteRed);
                        txtTotalItems.Text              = totalItems.ToString();
                        txtTotalQuantity.Text           = totalQuantity.ToString();
                        txtGrandTotal.Text              = grandTotal.ToString();
                        this.dgvItemOptions.CurrentCell = this.dgvItemOptions[0, this.dgvItemOptions.Rows.Count - 1];
                        ResetValues();
                    }
                }
            }
        }
Ejemplo n.º 14
0
        private string SetRoomTemp(Room aUnit, bool isOccupied)
        {
            Enums.Mode theMode = this.TempDefaults.WhatModeToSet();
            string     newTemp = this.TempDefaults.SelectCorrectTempInF(theMode, isOccupied);

            if (XMLConfigData.FakeC50Responses)
            {
                return(newTemp);
            }
            else
            {
                // TODO TESTING AHHHHHH!!!!!
                //C50Communication.SetTemp(theMode, newTemp, aUnit.UnitID);
            }
            return(newTemp);
        }
Ejemplo n.º 15
0
        private void dgvItemOptions_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvItemOptions.Rows[e.RowIndex].Cells["OptionText"].Value != null)
            {
                cmbItemName.Text = dgvItemOptions.Rows[e.RowIndex].Cells["OptionText"].Value.ToString();
            }

            if (dgvItemOptions.Rows[e.RowIndex].Cells["Quantity"].Value != null)
            {
                txtQuantity.Text = dgvItemOptions.Rows[e.RowIndex].Cells["Quantity"].Value.ToString();
            }

            if (dgvItemOptions.Rows[e.RowIndex].Cells["SerialNo"].Value != null)
            {
                row = Convert.ToInt32(dgvItemOptions.Rows[e.RowIndex].Cells["SerialNo"].Value.ToString());
            }

            totalQuantityUpdate = Convert.ToDouble(txtQuantity.Text);
            grandTotalUpdate    = Convert.ToDouble(txtPriceTotal.Text);
            mode = Enums.Mode.Edit;
        }
        public Entity(EntityFlag Flag, bool companion)
        {
            Statistics = new StatusStatics();
            Companion = companion;
            this.EntityFlag = Flag;
            Mode = Enums.Mode.None;
            update = new PhoenixProject.Network.GamePackets.Update(true);
            update.UID = UID;
            switch (Flag)
            {
                case EntityFlag.Player:
                   /* MyTimer = new System.Timers.Timer(200);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack);
                    MyTimer.Start();

                    MyTimer = new System.Timers.Timer(1000);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack2);
                    MyTimer.Start();

                    MyTimer = new System.Timers.Timer(1000);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack3);
                    MyTimer.Start();

                      MyTimer = new System.Timers.Timer(1000);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack4);
                    MyTimer.Start();

                    MyTimer = new System.Timers.Timer(1000);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack5);
                    MyTimer.Start();

                    MyTimer = new System.Timers.Timer(100);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack6);
                    MyTimer.Start();*/

                    MapObjType = Game.MapObjectType.Player;
                    break;
                case EntityFlag.Monster:
                   /*  MyTimer = new System.Timers.Timer(200);
                    MyTimer.AutoReset = true;
                    MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack);
                    MyTimer.Start();*/
                    MapObjType = Game.MapObjectType.Monster;
                    break;
            }
        }
Ejemplo n.º 17
0
 internal void Set(Enums.Mode Variables, int Count)
 {
     this.Set((int)Variables, Count);
 }
Ejemplo n.º 18
0
 internal int Get(Enums.Mode Variables)
 {
     return(this.Get((int)Variables));
 }
Ejemplo n.º 19
0
 private void NewRecord()
 {
     txtEmployeeName.Text = "";
     txtEmployeeNumber.Text = "";
     txtEmployeeSurname.Text = "";
     cmbRoles.SelectedIndex = -1;
     _Mode = Enums.Mode.New;
 }
Ejemplo n.º 20
0
 public OracleDB(string connectionStringName, string schemmaName, Enums.Mode connectionMode = Enums.Mode.Normal)
 {
     Init(schemmaName, connectionMode);
     _connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
 }
Ejemplo n.º 21
0
 public OracleDB(string schemmaName, Enums.Mode connectionMode = Enums.Mode.Normal)
 {
     Init(schemmaName, connectionMode);
     _connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[System.Configuration.ConfigurationManager.ConnectionStrings.Count - 1].ConnectionString;
 }
Ejemplo n.º 22
0
        /// <summary>
        /// When a selection from the search control is selected, the nexessary text boxes are populated 
        /// and the necessary combo box value is selected
        /// </summary>
        /// <param name="Employee">Record data from the selected record on the search screen</param>
        private void FillSecondaryControls(Data.Employee Employee)
        {
            if(Employee != null)
            {
                _Mode = Enums.Mode.Existing;
                _CurrentEmployeeID = Employee.EmployeeID;
                txtEmployeeName.Text = Employee.EmployeeName;
                txtEmployeeNumber.Text = Employee.EmployeeNumber;
                txtEmployeeSurname.Text = Employee.EmployeeSurname;

                foreach(Binding.BindingItem i in cmbRoles.Items)
                {
                    if (i.ID == Employee.RoleID)
                    {
                        cmbRoles.SelectedItem = i;
                    }
                }
            }
        }
Ejemplo n.º 23
0
 private void SetSpectrumMode(Enums.Mode Mode)
 {
     this.Mode = Mode;
 }
Ejemplo n.º 24
0
        public Entity(EntityFlag Flag, bool companion)
        {
            Statistics = new StatusStatics();
            Companion = companion;
            this.EntityFlag = Flag;
            Mode = Enums.Mode.None;
            update = new Conquer_Online_Server.Network.GamePackets.Update(true);
            update.UID = UID;
            switch (Flag)
            {
                case EntityFlag.Player:
                       MyTimer = new System.Timers.Timer(interval);
                        MyTimer.AutoReset = true;
                        MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCallBack);
                        MyTimer.Start();

                    MapObjType = Game.MapObjectType.Player;
                    break;
                case EntityFlag.Monster: MapObjType = Game.MapObjectType.Monster; break;
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// This method is used in order to make the correct selection from the combo box and set the text box vales
        /// </summary>
        /// <param name="Role">The Role variable is the detail of the selected record from the search control</param>
        private void FillSecondaryControls(Data.Role Role)
        {
            if (Role != null)
            {
                _Mode = Enums.Mode.Existing;
                _CurrentRoleID = Role.RoleID;
                txtRoleName.Text = Role.RoleName;

                foreach (Binding.BindingItem i in cmbRates.Items)
                {
                    if(i.ID == Role.RateID)
                    {
                        cmbRates.SelectedItem = i;
                    }
                }
            }
        }
Ejemplo n.º 26
0
        public async Task <bool> Cleanup(long[] linkIds, long[] packageIds, Enums.Action action, Enums.Mode mode,
                                         Enums.SelectionType selectionType)
        {
            var param = new object[]
            { linkIds, packageIds, action.ToString(), mode.ToString(), selectionType.ToString() };
            var response = await CallAction <object>("cleanup", param);

            return(!string.IsNullOrEmpty(response?.ToString()));
        }
Ejemplo n.º 27
0
 private void NewRecord()
 {
     txtRoleName.Text = "";
     cmbRates.SelectedIndex = -1;
     _Mode = Enums.Mode.New;
 }