Beispiel #1
0
 partial void newSessionBtn_Click(Foundation.NSObject sender)
 {
     YACRSSession.Instance.newSession();
     state = formState.unsaved;
     updateSessionEditFields();
     enableAppropriateComponents();
 }
Beispiel #2
0
 partial void settingChanged(Foundation.NSObject sender)
 {
     if (!updatingSettings)
     {
         if (state == formState.unchanged)
         {
             state = formState.changed;
             enableAppropriateComponents();
         }
     }
 }
Beispiel #3
0
        partial void OnSelectSession(Foundation.NSObject sender)
        {
            int idx = (int)sessionListSel.SelectedIndex;

            //Console.WriteLine("Session "+idx.ToString()+" - "+sessions[idx].M_title);
            if ((idx >= 0) && (idx < sessions.Count))
            {
                YACRSSession.Instance.getSessionDetail(sessions[idx].M_id);
                state = formState.unchanged;
                updateSessionEditFields();
                enableAppropriateComponents();
            }
        }
Beispiel #4
0
 static public void Clear()
 {
     if (session != null)
     {
         session.Dispose();
         session = null;
     }
     if (le != null)
     {
         le.Dispose();
         le = null;
     }
     session  = new storageInfo();
     le       = new LE();
     state    = formState.NONE;
     modified = formModState.UNMODIFIED;
 }
Beispiel #5
0
 partial void onCancel(Foundation.NSObject sender)
 {
     if (state == formState.unsaved)
     {
         if (sessionListSel.SelectedIndex == -1)
         {
             state = formState.nodata;
             enableAppropriateComponents();
         }
         else
         {
             OnSelectSession(sender);
         }
     }
     else
     {
         updateSessionEditFields();
         state = formState.unchanged;
         enableAppropriateComponents();
     }
 }
        private void clearForm()
        {
            dataGridView1.DataSource = null;
            dataGridView1.Columns.Clear();

            this.txtImporteFacturado.Text   = "0";
            this.txtImporteTasador.Text     = "0";
            this.txtTotalFacturado.Text     = "0";
            this.txtViaticosFacturados.Text = "0";
            this.txtNumeroFactura.Text      = "0";
            importeFacturado = 0;
            importeTasador   = 0;
            totalFacturado   = 0;

            gridBinded      = false;
            estado          = formState.clear;
            clienteSelected = string.Empty;

            syncButtons();
            lblNombreTasador.Text = "";
        }
Beispiel #7
0
        partial void onOK(Foundation.NSObject sender)
        {
            int tmpint;

            YACRSSession.Instance.Detail.M_title        = titleEdt.StringValue;
            YACRSSession.Instance.Detail.M_allowGuests  = allowGuestsChk.State == NSCellStateValue.On ? true : false;
            YACRSSession.Instance.Detail.M_visible      = visibleChk.State == NSCellStateValue.On ? true : false;
            YACRSSession.Instance.Detail.M_questionMode = (cls_sessionDetail.qmode)(int) questionModeSel.SelectedIndex;
            if (int.TryParse(defaultQuActiveSecs.StringValue, out tmpint))
            {
                YACRSSession.Instance.Detail.M_defaultQuActiveSecs = tmpint;
            }
            else
            {
                YACRSSession.Instance.Detail.M_defaultQuActiveSecs = 0;
            }
            YACRSSession.Instance.Detail.M_allowQuReview = allowQuReviewChk.State == NSCellStateValue.On ? true : false;
            YACRSSession.Instance.Detail.M_ublogRoom     = (cls_sessionDetail.ublogmode)(int) ublogRoomSel.SelectedIndex;
            if (int.TryParse(maxMessageLenghtEdt.StringValue, out tmpint))
            {
                YACRSSession.Instance.Detail.M_maxMessagelength = tmpint;
            }
            else
            {
                YACRSSession.Instance.Detail.M_maxMessagelength = 160;
            }
            YACRSSession.Instance.Detail.M_allowTeacherQu   = allowTeacherQuChk.State == NSCellStateValue.On ? true : false;
            YACRSSession.Instance.Detail.M_courseIdentifier = courseIdentifierEdt.StringValue;
            if (YACRSSession.Instance.updateSession() > 0)
            {
                state = formState.unchanged;
            }
            else
            {
                state = formState.nodata;
            }
            RefreshList();
            enableAppropriateComponents();
        }
Beispiel #8
0
        private void clearForm()
        {
            dataGridView1.DataSource = null;
            dataGridView1.Columns.Clear();

            this.txtImporteFacturado.Text   = "0";
            this.txtImporteTasador.Text     = "0";
            this.txtTotalFacturado.Text     = "0";
            this.txtViaticosFacturados.Text = "0";
            this.txtNumeroRecibo.Text       = "0";
            importeFacturado      = 0;
            importeTasador        = 0;
            totalFacturado        = 0;
            lblTasaciones.Text    = "Tasaciones: 0";
            lblSeleccionadas.Text = "Seleccionadas: 0";

            gridBinded = false;
            estado     = formState.clear;

            syncButtons();
            //lblNombreTasador.Text = "";
            idTasador = -1;
        }
Beispiel #9
0
    void formBtnClicked(int formID)
    {
        if (state != formState.move)
        {
            blockMovement1Frame = true;
            //Debug.Log("UI BUTTON CLICKED");
            if (gamemaster.curTurn == GameMaster.turns.player)
            {
                state = formState.idle;

                if (spawnedForms.Length > formID && spawnedForms[formID] != null)
                {
                    curForm = formID;
                    curAgent = spawnedForms[curForm].GetComponent<NavMeshAgent>();
                    curAnimator = spawnedForms[curForm].GetComponent<Animator>();
                    pointerLine.SetPosition(0, spawnedForms[curForm].transform.position);

                    AudioManager.PlayClip(AudioManager.Instance.mouseclick);
                    if (formID == 0)
                    {
                        pointerLine.GetComponent<LineRenderer>().material.color = physLineColor;
                        camFocus.GoTo("PhysicalForm");
                        //Debug.Log("show real world*******************************************************");
                        gamemaster.ui.Flash.FlashIt(Color.white);
                        //textureHiderManager.ShowPhysicalWorld();
                        Camera.main.GetComponent<CameraShaderManager>().RemoveDigital();
                    }

                    if (formID == 1)
                    {
                        pointerLine.GetComponent<LineRenderer>().material.color = digiLineColor;
                        camFocus.GoTo("DigitalForm(Clone)");
                        //Debug.Log("show internet world*****************************************************");
                        gamemaster.ui.Flash.FlashIt(Color.blue);
                        Camera.main.GetComponent<CameraShaderManager>().SetDigital();

                        //textureHiderManager.HidePhysicalWorld();
                    }

                }
                else if (!isSplitted)
                {
                    if (formID == 1)
                    {
                        TryToSpawnDigital();
                    }
                }
            }
            AudioManager.HandleBackgroundMusic();
        }
    }
Beispiel #10
0
        private void btnPago_Click(object sender, EventArgs e)
        {
            string errMsg = validatePago();

            if (!string.IsNullOrEmpty(errMsg))
            {
                MessageBox.Show(errMsg, "Atención");
            }
            else
            {
                String connectionString = ConfigurationManager.ConnectionStrings["FaverauConnectionString"].ConnectionString;
                bool   isOk             = true;

                using (SqlConnection con = new SqlConnection(connectionString))
                {
                    List <DataGridViewRow> lst = dataGridView1.Rows
                                                 .Cast <DataGridViewRow>()
                                                 .Where(r => (r.Cells[0] as DataGridViewCheckBoxCell).Value.Equals(CheckState.Checked))
                                                 .ToList();

                    con.Open();

                    // Start a local transaction.
                    SqlTransaction sqlTran = con.BeginTransaction();

                    // Enlist a command in the current transaction.
                    SqlCommand command = con.CreateCommand();
                    command.Transaction = sqlTran;

                    try
                    {
                        foreach (DataGridViewRow row in lst)
                        {
                            // Inserto registro con FechaPagoTasador y Nro. de Recibo
                            string cmd = "update SDMREFERENCEFORM ";
                            cmd += "set multivalcode = '" + txtNumeroRecibo.Text + "', view_value = '" + dateTimePicker1.Text + "' ";
                            cmd += "where id = " + row.Cells[20].Value.ToString();

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Actualizo ImporteTasador
                            cmd  = "Update SDMREFERENCEFORM set view_value = " + row.Cells[7].Value.ToString();
                            cmd += " where id in ( ";
                            cmd += "select rf_ita.id ";
                            cmd += "from sdmform fo ";
                            cmd += "inner join SDMWORKAREACONCRETE wa3 on fo.id_numeration = wa3.id_form ";
                            cmd += "inner join SDMREFERENCEFORM rf_ita on wa3.id = rf_ita.id_workarea and rf_ita.id_refformtype = 76 ";
                            cmd += " where fo.id = " + row.Cells[1].Value.ToString() + " )";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Actualizo ImporteFacturado
                            cmd  = "Update SDMREFERENCEFORM set view_value = " + row.Cells[8].Value.ToString();
                            cmd += " where id in ( ";
                            cmd += "select rf_ifa.id ";
                            cmd += "from sdmform fo ";
                            cmd += "inner join SDMWORKAREACONCRETE wa3 on fo.id_numeration = wa3.id_form ";
                            cmd += "inner join SDMREFERENCEFORM rf_ifa on wa3.id = rf_ifa.id_workarea and rf_ifa.id_refformtype = 74 ";
                            cmd += " where fo.id = " + row.Cells[1].Value.ToString() + " )";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Actualizo Identificacion Credito (es lo mismo que nombre)
                            cmd  = "Update SDMFORM set title = '" + row.Cells[2].Value.ToString() + "' ";
                            cmd += " where id =" + row.Cells[1].Value.ToString();

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Actualizo Localidad
                            cmd  = "Update SDMREFERENCEFORM set view_value = '" + row.Cells[10].Value.ToString() + "'";
                            cmd += " where id in ( ";
                            cmd += "select rf_loc.id ";
                            cmd += "from sdmform fo ";
                            cmd += "inner join SDMWORKAREACONCRETE wa on fo.id = wa.id_form ";
                            cmd += "inner join SDMREFERENCEFORM rf_loc on wa.id = rf_loc.id_workarea and rf_loc.id_refformtype = 236 ";
                            cmd += "where fo.id = " + row.Cells[1].Value.ToString() + " )";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            estado = formState.final;
                            syncButtons();
                        }

                        sqlTran.Commit();
                    }
                    catch (Exception ex)
                    {
                        isOk = false;

                        try
                        {
                            // Attempt to roll back the transaction.
                            sqlTran.Rollback();
                        }
                        catch (Exception exRollback)
                        {
                        }
                    }
                    finally
                    {
                        con.Close();
                    }

                    if (isOk)
                    {
                        MessageBox.Show("El pago se registro exitosamente.", "Mensaje del Sistema");
                    }
                    else
                    {
                        MessageBox.Show("No es posible registrar el pago.", "Se produjo un error");
                    }
                }
            }
        }
Beispiel #11
0
        private void fillGrid(int idTasador)
        {
            String connectionString = ConfigurationManager.ConnectionStrings["FaverauConnectionString"].ConnectionString;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                string Query = "EXEC dbo.PagoTasadores " + idTasador.ToString();

                connection.Open();
                DataTable dt = new DataTable();
                dt.Clear();

                dt.Columns.Add("id");
                dt.Columns.Add("Identificación Crédito");
                dt.Columns.Add("Nombre Deudor");
                dt.Columns.Add("Tipo Tasación");
                dt.Columns.Add("Numero Tasación");
                dt.Columns.Add("Estado");
                dt.Columns.Add("Importe Tasador");
                dt.Columns.Add("Importe Facturado");
                dt.Columns.Add("Domicilio");
                dt.Columns.Add("Localidad");
                dt.Columns.Add("Provincia");
                dt.Columns.Add("Fecha Borrador");
                dt.Columns.Add("Fecha Pedida");
                dt.Columns.Add("Fecha Asignada");
                dt.Columns.Add("Fecha Realizada");
                dt.Columns.Add("Fecha a Supervisar");
                dt.Columns.Add("Fecha Supervisada");
                dt.Columns.Add("Fecha Entregada");
                dt.Columns.Add("Fecha Procesada");
                dt.Columns.Add("idFormFPT");

                try
                {
                    SqlCommand    cmd         = new SqlCommand(Query, connection);
                    SqlDataReader reader      = cmd.ExecuteReader();
                    DataTable     dtTasadores = new DataTable();
                    dtTasadores.Clear();
                    dtTasadores.Load(reader);

                    DataRow dr;
                    lblTasaciones.Text = "Tasaciones: " + dtTasadores.Rows.Count.ToString();

                    if (dtTasadores.Rows.Count > 0)
                    {
                        foreach (DataRow row in dtTasadores.Rows)
                        {
                            // chequeo que tenga referenceform de FechaPagoTasador
                            if (!string.IsNullOrEmpty(row[47].ToString().Trim()))
                            {
                                dr     = dt.NewRow();
                                dr[0]  = row[0].ToString();
                                dr[1]  = row[1].ToString();
                                dr[2]  = row[2].ToString();
                                dr[3]  = row[3].ToString();
                                dr[4]  = row[4].ToString();
                                dr[5]  = row[5].ToString();
                                dr[6]  = string.IsNullOrEmpty(row[12].ToString().Trim()) ? "0" : row[12].ToString().Trim();
                                dr[7]  = string.IsNullOrEmpty(row[13].ToString().Trim()) ? "0" : row[13].ToString().Trim();
                                dr[8]  = row[6].ToString();
                                dr[9]  = row[7].ToString();
                                dr[10] = row[8].ToString();
                                dr[11] = row[15].ToString();
                                dr[12] = row[19].ToString();
                                dr[13] = row[23].ToString();
                                dr[14] = row[27].ToString();
                                dr[15] = row[31].ToString();
                                dr[16] = row[35].ToString();
                                dr[17] = row[39].ToString();
                                dr[18] = row[43].ToString();
                                dr[19] = row[47].ToString();

                                dt.Rows.Add(dr);
                            }
                        }

                        dataGridView1.DataSource = null;
                        dataGridView1.Columns.Clear();

                        DataGridViewCheckBoxColumn checkBox = new DataGridViewCheckBoxColumn(false);
                        checkBox.HeaderText = "Selec";
                        dataGridView1.Columns.Add(checkBox);

                        dataGridView1.DataSource = dt;

                        dataGridView1.Columns[7].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                        dataGridView1.Columns[8].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;

                        dataGridView1.Columns[2].HeaderCell.Style.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[3].HeaderCell.Style.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[7].HeaderCell.Style.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[8].HeaderCell.Style.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[10].HeaderCell.Style.BackColor = Color.Aquamarine;

                        dataGridView1.EnableHeadersVisualStyles = false;
                        dataGridView1.Columns[0].Width          = 43;
                        dataGridView1.Columns[1].Visible        = false;

                        dataGridView1.Columns[2].DefaultCellStyle.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[3].DefaultCellStyle.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[7].DefaultCellStyle.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[8].DefaultCellStyle.BackColor  = Color.Aquamarine;
                        dataGridView1.Columns[10].DefaultCellStyle.BackColor = Color.Aquamarine;

                        dataGridView1.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                        dataGridView1.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                        dataGridView1.Columns[4].ReadOnly  = true;
                        dataGridView1.Columns[5].ReadOnly  = true;
                        dataGridView1.Columns[6].ReadOnly  = true;
                        dataGridView1.Columns[9].ReadOnly  = true;
                        dataGridView1.Columns[11].ReadOnly = true;
                        dataGridView1.Columns[12].ReadOnly = true;
                        dataGridView1.Columns[13].ReadOnly = true;
                        dataGridView1.Columns[14].ReadOnly = true;
                        dataGridView1.Columns[15].ReadOnly = true;
                        dataGridView1.Columns[16].ReadOnly = true;
                        dataGridView1.Columns[17].ReadOnly = true;
                        dataGridView1.Columns[18].ReadOnly = true;
                        dataGridView1.Columns[19].ReadOnly = true;

                        gridBinded = true;

                        foreach (DataGridViewRow row in dataGridView1.Rows)
                        {
                            DataGridViewCheckBoxCell chk = row.Cells[0] as DataGridViewCheckBoxCell;
                            chk.Value = false;
                        }

                        estado = formState.editing;
                        syncButtons();
                    }
                    else
                    {
                        clearForm();
                        MessageBox.Show("No registra tasaciones", "Atención");
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("Se produjo un error al cargar los datos.", "Error");
                }
            }
        }
        private void btnFacturar_Click(object sender, EventArgs e)
        {
            string errMsg = validateFactura();

            if (!string.IsNullOrEmpty(errMsg))
            {
                MessageBox.Show(errMsg, "Atención");
            }
            else
            {
                String connectionString = ConfigurationManager.ConnectionStrings["FaverauConnectionString"].ConnectionString;
                bool   isOk             = true;

                using (SqlConnection con = new SqlConnection(connectionString))
                {
                    List <DataGridViewRow> lst = dataGridView1.Rows
                                                 .Cast <DataGridViewRow>()
                                                 .Where(r => (r.Cells[0] as DataGridViewCheckBoxCell).Value.Equals(CheckState.Checked))
                                                 .ToList();

                    con.Open();

                    // Start a local transaction.
                    SqlTransaction sqlTran = con.BeginTransaction();

                    // Enlist a command in the current transaction.
                    SqlCommand command = con.CreateCommand();
                    command.Transaction = sqlTran;

                    try
                    {
                        foreach (DataGridViewRow row in lst)
                        {
                            // Inserto Nro. de Factura
                            string cmd = "update SDMREFERENCEFORM ";
                            cmd += "set view_value = '" + txtNumeroFactura.Text + "' ";
                            cmd += "where id_workarea = " + row.Cells[20].Value.ToString() + " and id_refformtype = 10137 ";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Inserto Fecha de Factura
                            cmd  = "update SDMREFERENCEFORM ";
                            cmd += "set view_value = '" + dateTimePicker1.Text + "' ";
                            cmd += "where id_workarea = " + row.Cells[20].Value.ToString() + " and id_refformtype = 10136 ";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            // Inserto Nro. de Factura en tabla StringValues
                            cmd  = "insert into SDMEDITREFSTRINGVALUES ";
                            cmd += "(value, id_reference) ";
                            cmd += "values(" + txtNumeroFactura.Text + ",(select id from SDMREFERENCEFORM where id_workarea = " + row.Cells[20].Value.ToString() + " and id_refformtype = 10137))";

                            command.CommandText = cmd;
                            command.ExecuteNonQuery();

                            estado = formState.final;
                            syncButtons();
                        }

                        sqlTran.Commit();
                    }
                    catch (Exception ex)
                    {
                        isOk = false;

                        try
                        {
                            // Attempt to roll back the transaction.
                            sqlTran.Rollback();
                        }
                        catch (Exception exRollback)
                        {
                        }
                    }
                    finally
                    {
                        con.Close();
                    }

                    if (isOk)
                    {
                        MessageBox.Show("El pago se registro exitosamente.", "Mensaje del Sistema");
                    }
                    else
                    {
                        MessageBox.Show("No es posible registrar el pago.", "Se produjo un error");
                    }
                }
            }
        }
Beispiel #13
0
 // Shared initialization code
 void Initialize(NSCoder coder)
 {
     theWindow = new MainWindow(coder);
     state     = formState.nodata;
 }
Beispiel #14
0
 // Shared initialization code
 void Initialize()
 {
     state = formState.nodata;
 }
Beispiel #15
0
    void idle()
    {
        if (CONTROLS_IS_ON && (curForm == 1 || actionPointsLeft + 1 > 0))
        {
            resetPointer();

            RaycastHit hit;
            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100, layerMask))
            {
                Vector3 hitPoint = hit.point;

                //the direction of the destination according to the player(used for showing the pointer)
                Vector3 heading = hitPoint - spawnedForms[curForm].transform.position;
                float distance = heading.magnitude;
                Vector3 direction = heading / distance;

                RaycastHit hitt;
                if (Physics.Raycast(spawnedForms[curForm].transform.position, heading, out hitt, distance))
                {
                    if (hitt.transform.gameObject.layer != LayerMask.NameToLayer("Walkable"))
                    {
                        //hitPoint = hitt.point;
                        //Debug.Log("hitpoint changed!!");
                    }
                }

                //end point of line shown (also destination of the player movement)
                lineEndPos = hitPoint;

                //distance from point to player

                pointerDistance = Mathf.FloorToInt(Vector3.Distance(spawnedForms[curForm].transform.position, hitPoint) / moveSpeed);

                if (curForm != 1)
                {
                    if (pointerDistance > actionPointsLeft) //don't move more than action points left
                    {
                        pointerDistance = actionPointsLeft;
                        lineEndPos = spawnedForms[curForm].transform.position + (direction * ((pointerDistance + 1) * moveSpeed));
                    }
                }
                //show actionpoints used if desiding to move
                //pointerAPIndic.text = "" + (pointerDistance + 1);

                //Debug.Log("yyy:" + ((pointerDistance + 1) / (float)(maxActionPoints + 1)));
                pointerAPLeftIndic.fillAmount = ((actionPointsLeft + 1) / (float)(maxActionPoints + 1));

                pointerAPIndic.fillAmount = ((pointerDistance + 1) / (float)(maxActionPoints + 1));

                //pointerAPIndic.fillAmount = (((actionPointsLeft + 1) / (float)(maxActionPoints + 1)) - ((pointerDistance-1) / (float)(actionPointsLeft + 1)));
                //pointerText.transform.LookAt(Camera.main.transform.position);
                //

                //added by pablo

                elapsed += Time.deltaTime;
                if (elapsed > 0.01f)
                {
                    elapsed = 0f ;
                    NavMesh.CalculatePath(spawnedForms[curForm].transform.position, lineEndPos, NavMesh.AllAreas, path);

                    //resize line renderer
                    pointerLine.SetVertexCount(path.corners.Length);

                    for (int i = 0; i < path.corners.Length ; i++)
                    {

                        pointerLine.SetPosition(i , path.corners[i]);

                    }

                }

                    //Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.red);

                //set pointer line end pos
                //Debug.Log(path.corners.Length);
                //if (path.corners.Length > 1)
                //{
                //    //pointerLine.SetPosition(path.corners.Length - 1, lineEndPos);
                //}

                //set position of "pointer"

                //fix bug of super trip

                pointerDistance = Mathf.FloorToInt( PathLength(path) / moveSpeed);

                if (curForm != 1)
                {
                    if (pointerDistance > actionPointsLeft) //don't move more than action points left
                    {
                        pointerAPIndic.fillAmount = 0;
                        //pointerText.text = "";
                        pointerLine.SetVertexCount(0);
                        pointerDistance = 0;
                        lineEndPos = spawnedForms[curForm].transform.position;
                    }
                }

                pointer.position = spawnedForms[curForm].transform.position + (direction * (pointerDistance * moveSpeed));

                //pointer.rotation = hit.transform.rotation;

                if (path.corners.Length - 1 > 0)
                {
                    pointer.position = path.corners[path.corners.Length - 1];

                    if (!pointerRenderer.enabled)
                    {
                        pointerRenderer.enabled = true;
                    }
                    if (!pointerAPIndic.enabled)
                    {
                        pointerAPIndic.enabled = true;

                    }
                    if (!pointerAPLeftIndic.enabled)
                    {
                        pointerAPLeftIndic.enabled = true;

                    }
                }
                else
                {
                    if (pointerRenderer.enabled)
                    {
                        pointerRenderer.enabled = false;
                    }
                    if (pointerAPIndic.enabled)
                    {
                        pointerAPIndic.enabled = false;
                    }
                    if (pointerAPLeftIndic.enabled)
                    {
                        pointerAPLeftIndic.enabled = false;

                    }
                }

            }
            if(blockMovement1Frame){

                blockMovement1Frame = false;

            }

            else if (Input.GetMouseButtonUp(0) && Vector3.Distance(spawnedForms[curForm].transform.position, lineEndPos) > 2 && path.corners.Length > 0)
            {
                //Debug.Log("click to move");
                AudioManager.PlayClip(playerWalkSound);
                curAgent.Resume();
                curAgent.SetDestination(lineEndPos);
                curAnimator.SetBool("move", true);
                pointerLine.gameObject.SetActive(false);
                pointerAPIndic.gameObject.SetActive(false);
                pointerAPLeftIndic.gameObject.SetActive(false);
                pointer.gameObject.SetActive(false);

                if (curForm != 1)
                {
                    actionPointsLeft -= pointerDistance + 1;
                }

                pointerDistance = 0;
                state = formState.move;

                camFocus.TargetToFollow = spawnedForms[curForm].transform;
            }
        }
        else {
            if (CONTROLS_IS_ON)
            {
                //Debug.Log("no more points left");
                gamemaster.endTurnBtnClicked();
            }
            else
            {
                resetPointer();
            }
        }
    }
Beispiel #16
0
    void move()
    {
        if (!CONTROLS_IS_ON)
        {
            actionPointsLeft += (Mathf.FloorToInt(curAgent.remainingDistance) / moveSpeed) + 1;

            curAgent.SetDestination(curAgent.transform.position);
            curAgent.Stop();
            curAnimator.SetBool("move", false);
            camFocus.TargetToFollow = null;
            resetPointer();
            state = formState.idle;
        }
        else
        {
            if (curAgent.remainingDistance < 0.1F)
            {
                curAgent.SetDestination(curAgent.transform.position);
                curAgent.Stop();
                curAnimator.SetBool("move", false);
                camFocus.TargetToFollow = null;
                resetPointer();
                state = formState.idle;
            }

            if (Vector3.Distance(curFormLoc, spawnedForms[curForm].transform.position) < 1)
            {
                if (curUnstuckWait <= 0)
                {
                    curUnstuckWait = unstuckWait;
                    curAgent.SetDestination(curAgent.transform.position);
                    curAgent.Stop();
                    curAnimator.SetBool("move", false);
                    camFocus.TargetToFollow = null;
                    resetPointer();
                    state = formState.idle;
                }
                else
                {
                    curUnstuckWait--;
                }
            }
            else
            {
                if (curUnstuckWait != unstuckWait)
                {
                    curUnstuckWait = unstuckWait;
                }
                curFormLoc = spawnedForms[curForm].transform.position;
            }
        }
    }
        public frm_listProductsAboutToFinish(int iFormState)
        {
            InitializeComponent();

            /*
             * form states
             *	1 ==> products about to finished from the stock (the list include the out of stock products)
             *	2 ==> list ot out of stock products
             *	3 ==> in stock products
             */

            if (iFormState == 1)
            {
                fState = formState.productsAboutToFinish;
            }
            else if (iFormState == 2)
            {
                fState = formState.outOfStockProducts;
            }
            else if (iFormState == 3)
            {
                fState = formState.inStockProducts;
            }

            SqlDataAdapter daForGridView = new SqlDataAdapter();            // dataAdapter used to fill the dataset
            DataTable      dt            = new DataTable();

            if (fState == formState.productsAboutToFinish)
            {
                daForGridView = _reportsAndInfo.getLstProductsAboutToFinish();
            }
            else if (fState == formState.outOfStockProducts)
            {
                daForGridView = _reportsAndInfo.getLstOutOfStockProducts();
                label1.Text   = "عدد المنتجات المنتهية من المخزن :";              // edit the label1 text
                this.Text     = "قائمة المنتجات المنتهية من المخزن";
            }
            else if (fState == formState.inStockProducts)
            {
                daForGridView = _reportsAndInfo.getLstInOfStockProducts();
                label1.Text   = "عدد المنتجات الموجودة في المخزن";              // edit the label1 text
                this.Text     = "قائمة المنتجات الموجودة في المخزن";
            }


            daForGridView.Fill(dt);
            dataGridView1.DataSource = dt;
            lblListRowsCount.Text    = dt.Rows.Count.ToString();          // count the list rows and bind it to the label that shows the nummber

            // in case of the form is used to show  "v_get_products_with_details" from the dataset
            // so make some modifications
            if (fState == formState.outOfStockProducts || fState == formState.productsAboutToFinish || fState == formState.inStockProducts)
            {
                dataGridView1.Columns[0].Visible = false;                 // hide the first column (id of the product)
                //dataGridView1.Columns[dt.Columns.Count - 1].Visible = false; // hide the last column (id of category)
                dt.Columns.RemoveAt(dt.Columns.Count - 1);                // hide the last column (id of category)

                // edit the columns captions, bcz it comes from the dataset in engish heasers
                dt.Columns[1].ColumnName = "اسم المنتج - الدواء";
                dt.Columns[2].ColumnName = "الكمية الموجودة";
                dt.Columns[3].ColumnName = "تحذير الانتهاء";
                dt.Columns[4].ColumnName = "وحدة القياس";
                dt.Columns[5].ColumnName = "وصف المنتج";
                dt.Columns[6].ColumnName = "اسم المورد";
                dt.Columns[7].ColumnName = "التصنيف";
                //dt.Columns[7].Caption = "التصنيف";
            }
        }