-
Notifications
You must be signed in to change notification settings - Fork 0
/
BajaEnlace.cs
57 lines (50 loc) · 1.71 KB
/
BajaEnlace.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAOLibrary.DTO;
using DAOLibrary.DAO;
namespace CargadeSLA
{
public partial class BajaEnlace : Form
{
public BajaEnlace()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DAOKpi daok = new DAOKpi();
DAOSociedad daos = new DAOSociedad();
int cod_unico = daok.ObtenerKPICodxUnicode(txtcd2.Text);
if (cod_unico == -1)
{
MessageBox.Show("No existe el CD: " + txtcd2.Text);
}
else
{
DataTable dt = daok.ObtenerKPI(cod_unico);
txtcodigo.Text = cod_unico.ToString() ;
txtnombre2.Text = dt.Rows[0]["Ind_KPIDivision"].ToString();
txtabrev2.Text = dt.Rows[0]["Ind_KPIDivisionAbrev"].ToString();
txtprioridad2.Text = dt.Rows[0]["Ind_KPITipoData"].ToString();
txtempresa2.Text = daos.encontrarSociedad((int)Int32.Parse(dt.Rows[0]["cod_sociedad"].ToString())).Rows[0]["IndCod_Sociedad"].ToString();
}
}
private void button2_Click(object sender, EventArgs e)
{
DAOKpi daok = new DAOKpi();
Kpi kpi = new Kpi();
kpi.IndCod_KPIDivision = (int)Int32.Parse(txtcodigo.Text);
kpi.Ind_KPIDivisionEstado = "Baja";
daok.updateKPI(kpi);
MessageBox.Show("Se ha dado de baja el enlace!");
this.Close();
}
}
}