Главная Случайная страница


Полезное:

Как сделать разговор полезным и приятным Как сделать объемную звезду своими руками Как сделать то, что делать не хочется? Как сделать погремушку Как сделать так чтобы женщины сами знакомились с вами Как сделать идею коммерческой Как сделать хорошую растяжку ног? Как сделать наш разум здоровым? Как сделать, чтобы люди обманывали меньше Вопрос 4. Как сделать так, чтобы вас уважали и ценили? Как сделать лучше себе и другим людям Как сделать свидание интересным?


Категории:

АрхитектураАстрономияБиологияГеографияГеологияИнформатикаИскусствоИсторияКулинарияКультураМаркетингМатематикаМедицинаМенеджментОхрана трудаПравоПроизводствоПсихологияРелигияСоциологияСпортТехникаФизикаФилософияХимияЭкологияЭкономикаЭлектроника






Файл fArrivalList.cs





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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fArrivalList: Form

{

public int id_child;

public fArrivalList()

{

InitializeComponent();

}

 

private void fArrivalList_Load(object sender, EventArgs e)

{

 

}

 

private void button1_Click(object sender, EventArgs e)

{

fListChild fLC = new fListChild();

 

fLC.FormBorderStyle = FormBorderStyle.FixedDialog;

fLC.ShowDialog(this);

if (fLC.DialogResult == DialogResult.OK)

{

id_child = fLC.id_chld;

txChild.Text = fLC.chldName;

}

}

 

private void bShow_Click(object sender, EventArgs e)

{

bsArrival.DataSource = null;

 

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "getListArrival";

 

comDB.Parameters.AddWithValue("@id_ch", id_child);

 

DataSet ds = new DataSet();

ds.Clear();

SqlDataAdapter da = new SqlDataAdapter(comDB);

da.Fill(ds);

 

bsArrival.DataSource = ds.Tables[0];

 

conDB.Close();

}

}

}

}

Файл fArrivalReg.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fArrivalReg: Form

{

public int id_ch;

 

public fArrivalReg()

{

InitializeComponent();

}

 

private void button1_Click(object sender, EventArgs e)

{

fListChild fLC = new fListChild();

 

fLC.FormBorderStyle = FormBorderStyle.FixedDialog;

fLC.ShowDialog(this);

if(fLC.DialogResult == DialogResult.OK)

{

id_ch = fLC.id_chld;

txChild.Text = fLC.chldName;

}

}

 

private void button2_Click(object sender, EventArgs e)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "arrival_ui";

 

comDB.Parameters.AddWithValue("@id_ch", id_ch);

comDB.Parameters.AddWithValue("@grNo", Convert.ToInt16(txGrNo.Text));

comDB.Parameters.AddWithValue("@arBegin", dtBegin.Value.Date);

comDB.Parameters.AddWithValue("@arEnd", dtEnd.Value.Date);

 

conDB.Open();

comDB.ExecuteNonQuery();

conDB.Close();

}

}

}

}

Файл fChild_Reg.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fChild_Reg: Form

{

public int id_ch;

public string chName;

public DateTime chBirth;

public string chSvid;

public string chPolis;

public string chSnils;

public int chSex;

public string chAdrReg;

public string chArrLive;

public string chBirthPl;

public string chDisea;

public string chAllergy;

public string chPsyxo;

public string chDefect;

public string chDoctor;

public int chInvalid = 0;

 

public DataGridViewRowCollection dsFamily;

 

public fChild_Reg()

{

InitializeComponent();

}

 

private void label3_Click(object sender, EventArgs e)

{

 

}

 

private void label9_Click(object sender, EventArgs e)

{

 

}

 

private void bDel_Click(object sender, EventArgs e)

{

if (grFamily.CurrentRow == null) return;

 

grFamily.Rows.Remove(grFamily.CurrentRow);

}

 

private void fChild_Reg_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.sex". При необходимости она может быть перемещена или удалена.

this.sexTableAdapter.Fill(this.socialteDataSet.sex);

 

}

 

private void button1_Click(object sender, EventArgs e)

{

dsFamily = grFamily.Rows;

 

chName = txFIO.Text.Trim();

chBirth = dtBirth.Value;

chSvid = txInd.Text.Trim();

chPolis = txPolis.Text.Trim();

chSnils = txSnils.Text.Trim();

chSex = (int)cbSex.SelectedValue;

chAdrReg = txAdrReg.Text.Trim();

chArrLive = txAdrLive.Text.Trim();

chBirthPl = txBirthPl.Text.Trim();

chDisea = txDisea.Text.Trim();

chAllergy = txAllergy.Text.Trim();

chPsyxo = txPsyx.Text.Trim();

chDefect = txDefect.Text.Trim();

chDoctor = txDoctor.Text.Trim();

if(chInv.Checked) chInvalid = 1;

 

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

{

using (SqlCommand cmdDB = new SqlCommand())

{

cmdDB.Connection = conDB;

cmdDB.CommandType = CommandType.StoredProcedure;

cmdDB.CommandText = "child_ui";

 

cmdDB.Parameters.AddWithValue("@chName", chName);

cmdDB.Parameters.AddWithValue("@chBirth", chBirth);

cmdDB.Parameters.AddWithValue("@chSvid", chSvid);

cmdDB.Parameters.AddWithValue("@chPolis", chPolis);

cmdDB.Parameters.AddWithValue("@chSnils", chSnils);

cmdDB.Parameters.AddWithValue("@id_sx", chSex);

cmdDB.Parameters.AddWithValue("@chAdrReg", chAdrReg);

cmdDB.Parameters.AddWithValue("@chAdrLive", chArrLive);

cmdDB.Parameters.AddWithValue("@chBirthPl", chBirthPl);

cmdDB.Parameters.AddWithValue("@chDisea", chDisea);

cmdDB.Parameters.AddWithValue("@chAllergy", chAllergy);

cmdDB.Parameters.AddWithValue("@chPsyxo", chPsyxo);

cmdDB.Parameters.AddWithValue("@chDefect", chDefect);

cmdDB.Parameters.AddWithValue("@chDoctor", chDoctor);

cmdDB.Parameters.AddWithValue("@chInvalid", chInvalid);

cmdDB.Parameters.Add("@retVal", SqlDbType.Int).Direction = ParameterDirection.Output;

 

conDB.Open();

cmdDB.ExecuteNonQuery();

id_ch = (int)cmdDB.Parameters["@retVal"].Value;

conDB.Close();

 

DataGridViewRow rw;

for (int i=0; i<grFamily.Rows.Count; i++)

{

rw = grFamily.Rows[i];

 

cmdDB.Parameters.Clear();

cmdDB.CommandText = "family_ui";

cmdDB.Parameters.AddWithValue("@id_rl", (int)rw.Cells["id_rl"].Value);

cmdDB.Parameters.AddWithValue("@id_ed", (int)rw.Cells["id_ed"].Value);

cmdDB.Parameters.AddWithValue("@id_ch", id_ch);

cmdDB.Parameters.AddWithValue("@fmName", rw.Cells["fmName"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmBirth", rw.Cells["fmBirth"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmPasp", rw.Cells["fmPasp"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmBusy", rw.Cells["fmBusy"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmDisea", rw.Cells["fmDisea"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmAlc", (int)rw.Cells["fmAlc"].Value);

cmdDB.Parameters.AddWithValue("@fmNark", (int)rw.Cells["fmNark"].Value);

cmdDB.Parameters.AddWithValue("@fmPregant", rw.Cells["fmPregant"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmAfterPreg", rw.Cells["fmAfterPreg"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmOth", rw.Cells["fmOth"].Value.ToString());

cmdDB.Parameters.AddWithValue("@fmInvalid", (int)rw.Cells["fmInvalid"].Value);

 

conDB.Open();

cmdDB.ExecuteNonQuery();

conDB.Close();

}

}

}

 

}

 

private void bAdd_Click(object sender, EventArgs e)

{

fFamily_Add fFam = new fFamily_Add();

 

fFam.ShowDialog(this);

if(fFam.DialogResult == DialogResult.OK)

{

grFamily.Rows.Add(fFam.id_rl, fFam.rlName, fFam.fmName, fFam.id_ed, fFam.edName, fFam.fmBirth, fFam.fmBusy, fFam.fmPasp, fFam.fmDisea, fFam.fmAlc,

fFam.fmNark, fFam.fmPregant, fFam.fmAfterPreg, fFam.fmOth, fFam.fmInvalid);

}

}

}

}

Файл fChildView.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

 

namespace socialte

{

public partial class fChildView: Form

{

public int id_ch;

public fChildView()

{

InitializeComponent();

}

 

private void fChildView_Load(object sender, EventArgs e)

{

 

}

 

private void fChildView_Shown(object sender, EventArgs e)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "child_view";

 

comDB.Parameters.AddWithValue("@id_ch", id_ch);

 

DataSet ds = new DataSet();

ds.Clear();

SqlDataAdapter da = new SqlDataAdapter(comDB);

da.Fill(ds, "tblChild");

 

txFIO.DataBindings.Add("Text", ds, "tblChild.chName");

txBirth.DataBindings.Add("Text", ds, "tblChild.chBirth");

txSex.DataBindings.Add("Text", ds, "tblChild.sxName");

chInv.DataBindings.Add("Checked", ds, "tblChild.chInvalid");

txInd.DataBindings.Add("Text", ds, "tblChild.chSvid");

txPolis.DataBindings.Add("Text", ds, "tblChild.chPolis");

txSnils.DataBindings.Add("Text", ds, "tblChild.chSnils");

txAdrReg.DataBindings.Add("Text", ds, "tblChild.chAdrReg");

txAdrLive.DataBindings.Add("Text", ds, "tblChild.chAdrLive");

txBirthPl.DataBindings.Add("Text", ds, "tblChild.chBirthPl");

txDisea.DataBindings.Add("Text", ds, "tblChild.chDisea");

txAllergy.DataBindings.Add("Text", ds, "tblChild.chAllergy");

txPsyx.DataBindings.Add("Text", ds, "tblChild.chPsyxo");

txDefect.DataBindings.Add("Text", ds, "tblChild.chDefect");

txDoctor.DataBindings.Add("Text", ds, "tblChild.chDoctor");

 

conDB.Close();

}

 

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "getListFamily";

 

comDB.Parameters.AddWithValue("@id_ch", id_ch);

 

DataSet dst = new DataSet();

dst.Clear();

SqlDataAdapter dat = new SqlDataAdapter(comDB);

dat.Fill(dst);

 

bsFamily.DataSource = dst.Tables[0];

 

conDB.Close();

}

}

}

}

Файл fEducation.cs

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;

 

namespace socialte

{

public partial class fEducation: Form

{

public fEducation()

{

InitializeComponent();

}

 

private void fEducation_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.education". При необходимости она может быть перемещена или удалена.

this.educationTableAdapter.Fill(this.socialteDataSet.education);

 

}

 

private void toolStripButton1_Click(object sender, EventArgs e)

{

educationTableAdapter.Update(socialteDataSet);

}

}

}

Файл fFamily_Add.cs

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;

 

namespace socialte

{

public partial class fFamily_Add: Form

{

 

public int id_rl;

public string rlName;

public int id_ed;

public string edName;

public string fmName;

public DateTime fmBirth;

public string fmPasp;

public string fmBusy;

public string fmDisea;

public int fmAlc = 0;

public int fmNark = 0;

public string fmPregant;

public string fmAfterPreg;

public string fmOth;

public int fmInvalid = 0;

 

public fFamily_Add()

{

InitializeComponent();

}

 

private void fFamily_Add_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.education". При необходимости она может быть перемещена или удалена.

this.educationTableAdapter.Fill(this.socialteDataSet.education);

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.relate". При необходимости она может быть перемещена или удалена.

this.relateTableAdapter.Fill(this.socialteDataSet.relate);

 

}

 

private void button1_Click(object sender, EventArgs e)

{

id_rl = (int)cbRelate.SelectedValue;

rlName = cbRelate.Text;

id_ed = (int)cbEducate.SelectedValue;

edName = cbEducate.Text;

fmName = txName.Text.Trim();

fmBirth = dtBirth.Value.Date;

fmPasp = txPasp.Text.Trim();

fmBusy = txBusy.Text.Trim();

fmDisea = txDisea.Text.Trim();

if (chAlc.Checked) fmAlc = 1;

if (chNark.Checked) fmNark = 1;

fmPregant = txPregant.Text.Trim();

fmAfterPreg = txAfterPreg.Text.Trim();

fmOth = txOth.Text.Trim();

if (chInv.Checked) fmInvalid = 1;

}

}

}

Файл fListChild.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fListChild: Form

{

public bool showSel=true;

public int id_chld = 0;

public string chldName;

 

public fListChild()

{

InitializeComponent();

}

 

private void button1_Click(object sender, EventArgs e)

{

bsChild.DataSource = null;

 

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "getListChild";

 

comDB.Parameters.AddWithValue("@chName", txFind.Text.Trim());

 

DataSet ds = new DataSet();

ds.Clear();

SqlDataAdapter da = new SqlDataAdapter(comDB);

da.Fill(ds);

 

bsChild.DataSource = ds.Tables[0];

 

conDB.Close();

}

}

 

private void fListChild_Load(object sender, EventArgs e)

{

bSel.Visible = showSel;

}

 

private void bSel_Click(object sender, EventArgs e)

{

if (dataGridView1.CurrentRow == null) return;

 

id_chld = (int)dataGridView1.CurrentRow.Cells["id_ch"].Value;

chldName = dataGridView1.CurrentRow.Cells["chName"].Value.ToString();

}

 

private void toolStripButton2_Click(object sender, EventArgs e)

{

if (dataGridView1.CurrentRow == null) return;

 

if(MessageBox.Show("Удалить выбранную запись?", this.Text,

MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2) == DialogResult.Yes)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "child_del";

 

comDB.Parameters.AddWithValue("@id_ch", (int)dataGridView1.CurrentRow.Cells["id_ch"].Value);

 

conDB.Open();

comDB.ExecuteNonQuery();

conDB.Close();

}

}

}

 

private void toolStripButton1_Click(object sender, EventArgs e)

{

if (dataGridView1.CurrentRow == null) return;

 

fChildView fCV = new fChildView();

fCV.id_ch = (int)dataGridView1.CurrentRow.Cells["id_ch"].Value;

fCV.ShowDialog(this);

}

}

}

Файл fMain.cs

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;

 

namespace socialte

{

public partial class fMain: Form

{

public fMain()

{

InitializeComponent();

}

 

private void нахождениеToolStripMenuItem_Click(object sender, EventArgs e)

{

fArrivalReg fAR = new fArrivalReg();

 

fAR.ShowDialog(this);

}

 

private void выходToolStripMenuItem_Click(object sender, EventArgs e)

{

Application.Exit();

}

 

private void оПрограммеToolStripMenuItem_Click(object sender, EventArgs e)

{

fAbout fAB;

 

fAB = new fAbout();

fAB.ShowDialog();

}

 

private void образованиеToolStripMenuItem_Click(object sender, EventArgs e)

{

fEducation fED;

 

fED = new fEducation();

fED.MdiParent = this;

fED.Show();

}

 

private void родственыеСвязиToolStripMenuItem_Click(object sender, EventArgs e)

{

fRelate fRL;

 

fRL = new fRelate();

fRL.MdiParent = this;

fRL.Show();

}

 

private void приемДетейToolStripMenuItem_Click(object sender, EventArgs e)

{

fChild_Reg fChr = new fChild_Reg();

 

fChr.ShowDialog(this);

}

 

private void списокДетейToolStripMenuItem_Click(object sender, EventArgs e)

{

fListChild fLC = new fListChild();

 

fLC.MdiParent = this;

fLC.showSel = false;

fLC.Show();

}

 

private void регистрацияПосещенияToolStripMenuItem_Click(object sender, EventArgs e)

{

fRegVisit fRV = new fRegVisit();

 

fRV.ShowDialog(this);

}

 

private void пребываниеToolStripMenuItem_Click(object sender, EventArgs e)

{

fArrivalList fAL = new fArrivalList();

 

fAL.MdiParent = this;

fAL.Show();

}

 

private void gjctotybzToolStripMenuItem_Click(object sender, EventArgs e)

{

fVisitList fVL = new fVisitList();

 

fVL.MdiParent = this;

fVL.Show();

}

}

}

Файл fRegVisit.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fRegVisit: Form

{

public int id_ch = 0;

 

public fRegVisit()

{

InitializeComponent();

}

 

private void fRegVisit_Load(object sender, EventArgs e)

{

 

}

 

private void button1_Click(object sender, EventArgs e)

{

fListChild fLC = new fListChild();

 

fLC.FormBorderStyle = FormBorderStyle.FixedDialog;

fLC.ShowDialog(this);

if (fLC.DialogResult == DialogResult.OK)

{

id_ch = fLC.id_chld;

txChild.Text = fLC.chldName;

}

}

 

private void button2_Click(object sender, EventArgs e)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "visitors_ui";

 

comDB.Parameters.AddWithValue("@id_ch", id_ch);

comDB.Parameters.AddWithValue("@whovisit", txVisitor.Text.Trim());

comDB.Parameters.AddWithValue("@dtVisit", dtVisit.Value.Date);

 

conDB.Open();

comDB.ExecuteNonQuery();

conDB.Close();

}

}

}

}

Файл fRelate.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fRelate: Form

{

public fRelate()

{

InitializeComponent();

}

 

private void fRelate_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.v_relate". При необходимости она может быть перемещена или удалена.

this.v_relateTableAdapter.Fill(this.socialteDataSet.v_relate);

 

}

 

private void toolStripButton1_Click(object sender, EventArgs e)

{

fRelate_Add fRL_Add;

 

fRL_Add = new fRelate_Add();

fRL_Add.Text = "Новая связь";

fRL_Add.ShowDialog(this);

if(fRL_Add.DialogResult == DialogResult.OK)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

{

using (SqlCommand cmdDB = new SqlCommand())

{

cmdDB.Connection = conDB;

cmdDB.CommandType = CommandType.StoredProcedure;

cmdDB.CommandText = "relate_ui";

 

cmdDB.Parameters.AddWithValue("@whohave", fRL_Add.whohave);

cmdDB.Parameters.AddWithValue("@id_sx", fRL_Add.id_sx);

 

conDB.Open();

cmdDB.ExecuteNonQuery();

conDB.Close();

}

}

v_relateTableAdapter.Fill(socialteDataSet.v_relate);

}

}

 

private void toolStripButton2_Click(object sender, EventArgs e)

{

if (dataGridView1.CurrentRow == null) return;

 

fRelate_Add fRL_Add;

DataGridViewRow rw = dataGridView1.CurrentRow;

 

fRL_Add = new fRelate_Add();

fRL_Add.Text = "Изменить связь";

fRL_Add.whohave = rw.Cells["whohave"].Value.ToString();

fRL_Add.id_sx = (int)rw.Cells["id_sx"].Value;

fRL_Add.ShowDialog(this);

if (fRL_Add.DialogResult == DialogResult.OK)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

{

using (SqlCommand cmdDB = new SqlCommand())

{

cmdDB.Connection = conDB;

cmdDB.CommandType = CommandType.StoredProcedure;

cmdDB.CommandText = "relate_ui";

 

cmdDB.Parameters.AddWithValue("@whohave", fRL_Add.whohave);

cmdDB.Parameters.AddWithValue("@id_sx", fRL_Add.id_sx);

cmdDB.Parameters.AddWithValue("@id_rl", (int)rw.Cells["id_rl"].Value);

 

conDB.Open();

cmdDB.ExecuteNonQuery();

conDB.Close();

}

}

v_relateTableAdapter.Fill(socialteDataSet.v_relate);

}

}

 

private void toolStripButton3_Click(object sender, EventArgs e)

{

if (dataGridView1.CurrentRow == null) return;

 

if(MessageBox.Show("Удалить выбранную запись?", "Удаление", MessageBoxButtons.YesNo,

MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)== DialogResult.Yes)

{

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

{

using (SqlCommand cmdDB = new SqlCommand())

{

cmdDB.Connection = conDB;

cmdDB.CommandType = CommandType.StoredProcedure;

cmdDB.CommandText = "relate_del";

 

cmdDB.Parameters.AddWithValue("@id_rl", (int)dataGridView1.CurrentRow.Cells["id_rl"].Value);

 

conDB.Open();

cmdDB.ExecuteNonQuery();

conDB.Close();

}

}

v_relateTableAdapter.Fill(socialteDataSet.v_relate);

}

}

}

}

Файл fRelate_Add.cs

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;

 

namespace socialte

{

public partial class fRelate_Add: Form

{

public String whohave;

public int id_sx;

 

public fRelate_Add()

{

InitializeComponent();

}

 

private void fRelate_Load(object sender, EventArgs e)

{

// TODO: данная строка кода позволяет загрузить данные в таблицу "socialteDataSet.sex". При необходимости она может быть перемещена или удалена.

this.sexTableAdapter.Fill(this.socialteDataSet.sex);

 

textBox1.Text = whohave;

comboBox1.SelectedValue = id_sx;

}

 

private void button1_Click(object sender, EventArgs e)

{

whohave = textBox1.Text.Trim();

id_sx = (int)comboBox1.SelectedValue;

}

}

}

Файл fSplash.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

 

namespace socialte

{

public partial class fSplash: Form

{

public fSplash()

{

InitializeComponent();

}

 

private void fSplash_Shown(object sender, EventArgs e)

{

timer1.Enabled = true;

}

 

private void timer1_Tick(object sender, EventArgs e)

{

this.Close();

}

}

}

Файл fVisitList.cs

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 System.Data.SqlClient;

 

namespace socialte

{

public partial class fVisitList: Form

{

public int id_ch;

public fVisitList()

{

InitializeComponent();

}

 

private void bShow_Click(object sender, EventArgs e)

{

bsVisit.DataSource = null;

 

using (SqlConnection conDB = new SqlConnection(Properties.Settings.Default.socialteConnectionString))

using (SqlCommand comDB = new SqlCommand())

{

comDB.Connection = conDB;

comDB.CommandType = CommandType.StoredProcedure;

comDB.CommandText = "getVisitList";

 

comDB.Parameters.AddWithValue("@id_ch", id_ch);

 

DataSet ds = new DataSet();

ds.Clear();

SqlDataAdapter da = new SqlDataAdapter(comDB);

da.Fill(ds);

 

bsVisit.DataSource = ds.Tables[0];

 

conDB.Close();

}

}

 

private void button1_Click(object sender, EventArgs e)

{

fListChild fLC = new fListChild();

 

fLC.FormBorderStyle = FormBorderStyle.FixedDialog;

fLC.ShowDialog(this);

if (fLC.DialogResult == DialogResult.OK)

{

id_ch = fLC.id_chld;

txChild.Text = fLC.chldName;

}

}

}

}

Файл Program.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Threading.Tasks;

using System.Windows.Forms;

 

namespace socialte

{

static class Program

{

/// <summary>

/// Главная точка входа для приложения.

/// </summary>

[STAThread]

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new fSplash());

Application.Run(new fMain());

}

}

}

 

 

Date: 2016-07-22; view: 243; Нарушение авторских прав; Помощь в написании работы --> СЮДА...



mydocx.ru - 2015-2024 year. (0.007 sec.) Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав - Пожаловаться на публикацию