Exemplo n.º 1
0
    public static Guid? StatusId(string status)
    {
        TicketsBLL bll = new TicketsBLL();

          StatusesTableAdapter ta = new StatusesTableAdapter();
          Guid? id = ta.GetId(status);
          return id;
    }
Exemplo n.º 2
0
        private void EliminarButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TicketIdTextBox.Text))
            {
                MessageBox.Show("LLena el campo con el numero de Ticket");
            }
            else
            {
                var ticket = TicketsBLL.Buscar(Convert.ToInt32(TicketIdTextBox.Text));
                if (ticket != null)
                {
                    IdLoteriatextBox.Text                = (ticket.IdLoteria).ToString();
                    NombreLoteriatextBox.Text            = (ticket.NombreLoteria).ToString();
                    FechadateTimePicker.Text             = (ticket.Fecha).ToString();
                    Usuariolabel.Text                    = ticket.Usuario.ToString();
                    TotaltextBox.Text                    = ticket.Total.ToString();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.DataSource         = ticket.detalles;
                    DatosdataGridView.Columns[0].Visible = false;
                    DatosdataGridView.Columns[1].Visible = false;
                    DatosdataGridView.Columns[2].Visible = false;
                    DialogResult dialogo = MessageBox.Show("Desea Borrar el Ticket", "Borrarando Ticket", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (dialogo == DialogResult.Yes)
                    {
                        int TicketId = Utilidades.ToInt(TicketIdTextBox.Text);
                        TicketsBLL.Eliminar(TicketId);
                        MontotextBox.Clear();
                        JugadatextBox.Clear();
                        IdLoteriatextBox.Clear();
                        NombreLoteriatextBox.Clear();
                        TotaltextBox.Clear();
                        TicketIdTextBox.Clear();
                        DatosdataGridView.DataSource         = null;
                        DatosdataGridView.Columns[0].Visible = true;
                        DatosdataGridView.Columns[2].Visible = true;
                        DatosdataGridView.Columns[1].Visible = true;
                        TicketIdTextBox.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Este Ticket no Existe");

                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;
                    TicketIdTextBox.Focus();
                }
            }
        }
Exemplo n.º 3
0
 protected void Yes_Click(object sender, EventArgs e)
 {
     TicketsBLL bll = new TicketsBLL();
     try { bll.implementationDate = Convert.ToDateTime(ImplemenatationDate.Text); }
     catch { }
     bll.statusId = (Guid)Utility.StatusId("Complete");
     bll.Id = m_ticketId;
     bll.Update();
     GoBack();
 }
Exemplo n.º 4
0
 protected void Yes_Click(object sender, EventArgs e)
 {
     TicketsBLL bll = new TicketsBLL();
     bll.canceledBy = (Guid)Membership.GetUser().ProviderUserKey;
     bll.cancelComment = CancelComment.Text;
     bll.canceledOn = DateTime.Now;
     bll.Id = m_ticketId;
     bll.Update();
     GoBack();
 }
Exemplo n.º 5
0
        private void GuardarButton_Click_1(object sender, EventArgs e)
        {
            if (Utilidades.ToInt(TotaltextBox.Text) > 0)
            {
                int Id;
                int.TryParse(TicketIdTextBox.Text, out Id);
                ticket.IdLoteria     = Utilidades.ToInt(IdLoteriatextBox.Text);
                ticket.Fecha         = FechadateTimePicker.Value;
                ticket.Usuario       = "Juan peres";
                ticket.Nulo          = false;
                ticket.Total         = Utilidades.ToInt(TotaltextBox.Text);
                ticket.IdDetalle     = 1;
                ticket.IdTicket      = Id;
                ticket.NombreLoteria = NombreLoteriatextBox.Text;

                if (TicketsBLL.Guardar(ticket))
                {
                    MessageBox.Show("Guardado");
                    DatosdataGridView.DataSource = null;
                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    Usuariolabel.Text                    = "";
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;

                    IdLoteriatextBox.Focus();
                }
                else
                {
                    MessageBox.Show("Error hay Guardar el ticket");
                    IdLoteriatextBox.Focus();
                }
            }
            else
            {
                MessageBox.Show("Tienes que insertar al menos una jugada...");
                IdLoteriatextBox.Focus();
            }
        }
Exemplo n.º 6
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Assign_Click(object sender, EventArgs e)
    {
        int count = Resources.Rows.Count;
        TicketsUsersTableAdapter trta = new TicketsUsersTableAdapter();

        MembershipUser myObject = Membership.GetUser();
        string UserID = myObject.ProviderUserKey.ToString();
        bool atLeastOneChecked = false;

        foreach (GridViewRow row in Resources.Rows)
        {
          object name = row.FindControl("Username") as object;
          CheckBox cb = row.FindControl("SelectUser") as CheckBox;

          Label txt = row.FindControl("Id") as Label;
          Guid id = new Guid(txt.Text);
          int nRecords = (int)trta.DoesRecordExist(m_ticketId, id);

          if ((nRecords == 0) && cb.Checked)
          {
        // store data in database...
        trta.Insert(id, m_ticketId, DateTime.Now, new Guid(UserID));
        atLeastOneChecked = true;
          }
          else if ((nRecords > 0) && !cb.Checked)
          {
        // delete record...
        trta.DeleteTicketByUserId(id, m_ticketId);
          }
        }

        Context.Items.Add("TicketId", m_ticketId);

        TicketsBLL bll = new TicketsBLL();
        bll.statusId = (Guid)Utility.StatusId(atLeastOneChecked ? "In Progress" : "Pending");
        bll.Id = new Guid(Request.QueryString["Id"]);

        bll.Update();

        GoBack();
    }
Exemplo n.º 7
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TicketIdTextBox.Text))
            {
                MessageBox.Show("LLena el campo con el numero de Ticket");
            }
            else
            {
                var ticket = TicketsBLL.Buscar(Convert.ToInt32(TicketIdTextBox.Text));
                if (ticket != null)
                {
                    IdLoteriatextBox.Text                = (ticket.IdLoteria).ToString();
                    NombreLoteriatextBox.Text            = (ticket.NombreLoteria).ToString();
                    FechadateTimePicker.Text             = (ticket.Fecha).ToString();
                    Usuariolabel.Text                    = ticket.Usuario.ToString();
                    TotaltextBox.Text                    = ticket.Total.ToString();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.DataSource         = ticket.detalles;
                    DatosdataGridView.Columns[0].Visible = false;
                    DatosdataGridView.Columns[1].Visible = false;
                    DatosdataGridView.Columns[2].Visible = false;
                }
                else
                {
                    MessageBox.Show("Este Ticket no Existe");

                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;
                    TicketIdTextBox.Focus();
                }
            }
        }
Exemplo n.º 8
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Create_Click(object sender, EventArgs e)
    {
        if (PageValid())
        {
          DropDownList dept = Panel1.FindControl("dept") as DropDownList;
          DropDownList group = Panel1.FindControl("Group") as DropDownList;
          DropDownList team = ((DropDownList)Panel1.FindControl("team")) as DropDownList;

          TicketsBLL bll = new TicketsBLL();
          bll.deptId = GetId("Dept");
          bll.groupId = GetId("Group");
          bll.teamId = GetId("Team");
          bll.projectId = GetId("Product");
          bll.statusId = GetId("Status");
          bll.priorityId = GetId("Priority");
          bll.createdBy = GetId("Created_By");
          bll.requestedBy = GetId("Requested_By");
          bll.businessUnitRep = GetId("Business_Unit_Rep");

          bll.summary = Summary.Text;
          bll.description = Description.Text;
          bll.actualCost = ToInt(Actual_Cost.Text);
          bll.actualHours = ToInt(Actual_Hours.Text);

          try { bll.receivedOn = Convert.ToDateTime(ReceivedDate.Text); }
          catch { }
          try { bll.qaStartDate = Convert.ToDateTime(DueToQADate.Text); }
          catch { }
          try { bll.qaCompleteDate = Convert.ToDateTime(QACompleteDate.Text); }
          catch { }
          try { bll.userTestDate = Convert.ToDateTime(UserTestDueDate.Text); }
          catch { }
          try { bll.userTestCompleteDate = Convert.ToDateTime(UserCompleteDate.Text); }   catch { }
          try { bll.plannedImplementationDate = Convert.ToDateTime(ImplementationDate.Text); }   catch { }

          switch (((Button)sender).Text)
          {
        case "Update":
          bll.Id = new Guid(TicketId.Text);
          bll.Update();
          break;

        case "Create and Assign":
          bll.AddTicket();
          goto case "Assign";

        case "Create":
          bll.AddTicket();
          break;

        case "Assign":
          Session.Add("TicketId", (Request.QueryString["Id"] == null) ? bll.Id.ToString() : Request.QueryString["Id"]);
          Redirect("Assign.aspx?Id=" + ((Request.QueryString["Id"] == null) ? bll.Id.ToString() : Request.QueryString["Id"]));
          break;
          }

          Redirect("Tickets.aspx");
        }
    }