Управление частной организацией

Обоснование выбора средств разработки приложения. Добавление, удаление, редактирование информации. Отражение информации из базы данных. Поиск информации по выбранной таблице. Проекты Data, Entity, Logic, Firm. Схема взаимодействия проектов программы.

Рубрика Программирование, компьютеры и кибернетика
Вид курсовая работа
Язык русский
Дата добавления 18.01.2015
Размер файла 1,8 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

table = Logic.WorkWithDB.ReadRecords("Coming");

for (int i = 1; i < table.Notes.Count; i++)

{

comboBox1.Items.Add(table.Notes[i].Records[0]);

}

table = Logic.WorkWithDB.ReadRecords("Sort");

for (int i = 1; i < table.Notes.Count; i++)

{

comboBox2.Items.Add(table.Notes[i].Records[1]);

}

label1.Text = "Product_Code"; label2.Text = "Name"; label3.Text = "Count"; label4.Text = "Sale_Price"; label5.Text = "Sort";

break;

case "Sale":

this.Height = 400;

button1.Location = new Point(112, 330);

textBox1.Visible = true; textBox3.Visible = true; textBox5.Visible = true; textBox6.Visible = true; textBox7.Visible = true; textBox9.Visible = true; textBox10.Visible = true;

TableStruct table3 = new TableStruct();

table3 = Logic.WorkWithDB.ReadRecords("Revenue");

textBox1.Text = table3.Notes[table3.Notes.Count - 1].Records[0].ToString();

textBox1.Text = (Convert.ToInt32(textBox1.Text) + 1).ToString();

textBox1.ReadOnly = true;

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 40);

comboBox2.Visible = true;

comboBox2.Location = new Point(112, 90);

comboBox3.Visible = true;

comboBox3.Location = new Point(112, 192);

comboBox4.Visible = true;

comboBox5.Visible = true;

table3 = Logic.WorkWithDB.ReadRecords("Coming");

for (int i = 1; i < table3.Notes.Count; i++)

{

comboBox1.Items.Add(table3.Notes[i].Records[0]);

}

table3 = Logic.WorkWithDB.ReadRecords("Sort");

for (int i = 1; i < table3.Notes.Count; i++)

{

comboBox2.Items.Add(table3.Notes[i].Records[1]);

}

table3 = Logic.WorkWithDB.ReadRecords("Clients");

for (int i = 1; i < table3.Notes.Count; i++)

{

comboBox3.Items.Add(table3.Notes[i].Records[1]);

}

table3 = Logic.WorkWithDB.ReadRecords("Sort_Rev_Exp");

for (int i = 1; i < table3.Notes.Count; i++)

{

comboBox4.Items.Add(table3.Notes[i].Records[1]);

}

table3 = Logic.WorkWithDB.ReadRecords("Currency");

for (int i = 1; i < table3.Notes.Count; i++)

{

comboBox5.Items.Add(table3.Notes[i].Records[1]);

}

label1.Text = "№"; label2.Text = "Product_Code"; label3.Text = "Name"; label4.Text = "Sort"; label5.Text = "Count"; label6.Text = "Price"; label7.Text = "PriceNDS"; label8.Text = "Client";label9.Text = "Date"; label10.Text = "Sum";label11.Text="Sort";label12.Text="Currency";

break;

case "Coming":

this.Height = 350;

button1.Location = new Point(112, 280);

textBox1.Visible = true; textBox2.Visible = true; textBox3.Visible = true; textBox4.Visible = true; textBox5.Visible = true; textBox6.Visible = true; textBox7.Visible = true;

TableStruct table1 = new TableStruct();

table1 = Logic.WorkWithDB.ReadRecords("Expenses");

textBox1.Text = table1.Notes[table1.Notes.Count - 1].Records[0].ToString();

textBox1.Text= (Convert.ToInt32(textBox1.Text) + 1).ToString();

textBox1.ReadOnly = true;

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 190);

comboBox2.Visible = true;

comboBox2.Location = new Point(112, 220);

comboBox3.Visible = true;

comboBox3.Location = new Point(112, 250);

table1 = Logic.WorkWithDB.ReadRecords("Suppliers");

for (int i = 1; i < table1.Notes.Count; i++)

{

comboBox1.Items.Add(table1.Notes[i].Records[1]);

}

table1 = Logic.WorkWithDB.ReadRecords("Sort_Rev_Exp");

for (int i = 1; i < table1.Notes.Count; i++)

{

comboBox2.Items.Add(table1.Notes[i].Records[1]);

}

table1 = Logic.WorkWithDB.ReadRecords("Currency");

for (int i = 1; i < table1.Notes.Count; i++)

{

comboBox3.Items.Add(table1.Notes[i].Records[1]);

}

label1.Text = "Product_Code"; label2.Text = "Name"; label3.Text = "Count"; label4.Text = "Purchase_price"; label5.Text = "Retail_price";label6.Text = "Date";label7.Text = "Sum";label8.Text = "Supplier";label9.Text = "Sort"; label10.Text = "Currency";

break;

case "Salary":

this.Height = 250;

button1.Location = new Point(112, 180);

textBox1.Visible = true; textBox2.Visible = true; textBox4.Visible = true;

TableStruct table6 = new TableStruct();

table6 = Logic.WorkWithDB.ReadRecords("Expenses");

textBox1.Text = table6.Notes[table6.Notes.Count - 1].Records[0].ToString();

textBox1.Text = (Convert.ToInt32(textBox1.Text) + 1).ToString();

textBox1.ReadOnly = true;

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 65);

comboBox2.Location = new Point(112, 120);

comboBox3.Location = new Point(112, 150);

comboBox2.Visible = true;

comboBox3.Visible = true;

table6 = Logic.WorkWithDB.ReadRecords("Personal_Data");

for (int i = 1; i < table6.Notes.Count; i++)

{

comboBox1.Items.Add(table6.Notes[i].Records[2]);

}

table1 = Logic.WorkWithDB.ReadRecords("Sort_Rev_Exp");

for (int i = 1; i < table1.Notes.Count; i++)

{

comboBox2.Items.Add(table1.Notes[i].Records[1]);

}

table1 = Logic.WorkWithDB.ReadRecords("Currency");

for (int i = 1; i < table1.Notes.Count; i++)

{

comboBox3.Items.Add(table1.Notes[i].Records[1]);

}

label1.Text = "№"; label2.Text = "Date"; label3.Text = "Employee"; label4.Text = "Sum";label5.Text = "Sort"; label6.Text = "Currency";

break;

case "Personal_Data":

this.Height = 220;

button1.Location = new Point(112, 150);

textBox1.Visible = true; textBox2.Visible = true; textBox3.Visible = true; textBox4.Visible = true; textBox5.Visible = true;

label1.Text = "№Contract"; label2.Text = "№Passport"; label3.Text = "F.I.O"; label4.Text = "Birth_Date"; label5.Text = "Contract_Date";

TableStruct table7 = new TableStruct();

table7 = Logic.WorkWithDB.ReadRecords("Personal_Data");

textBox1.Text = table7.Notes.Count.ToString();

textBox1.ReadOnly = true;

break;

case "Empl_Data":

this.Height = 220;

button1.Location = new Point(112, 150);

label1.Text = "F.I.O"; label2.Text = "Post"; label3.Text = "Department";

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 15);

comboBox2.Location = new Point(112, 45);

comboBox3.Location = new Point(112, 75);

comboBox2.Visible = true;

comboBox3.Visible = true;

TableStruct table8 = new TableStruct();

table8 = Logic.WorkWithDB.ReadRecords("Personal_Data");

for (int i = 1; i < table8.Notes.Count; i++)

{

comboBox1.Items.Add(table8.Notes[i].Records[2]);

}

table8 = Logic.WorkWithDB.ReadRecords("Posts");

for (int i = 1; i < table8.Notes.Count; i++)

{

comboBox2.Items.Add(table8.Notes[i].Records[1]);

}

table8 = Logic.WorkWithDB.ReadRecords("Departments");

for (int i = 1; i < table8.Notes.Count; i++)

{

comboBox3.Items.Add(table8.Notes[i].Records[1]);

}

break;

case "Posts":

this.Height = 220;

button1.Location = new Point(112, 150);

textBox1.Visible = true; textBox2.Visible = true; textBox3.Visible = true;

label1.Text = "№"; label2.Text = "Name";label3.Text = "Salary"; label4.Text = "Department";

TableStruct table9 = new TableStruct();

table9 = Logic.WorkWithDB.ReadRecords("Posts");

textBox1.Text = table9.Notes.Count.ToString();

textBox1.ReadOnly = true;

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 90);

table9 = Logic.WorkWithDB.ReadRecords("Departments");

for (int i = 1; i < table9.Notes.Count; i++)

{

comboBox1.Items.Add(table9.Notes[i].Records[1]);

}

break;

case "Departments":

this.Height = 220;

button1.Location = new Point(112, 150);

textBox1.Visible = true; textBox2.Visible = true;

label1.Text = "№"; label2.Text = "Name";

TableStruct table10 = new TableStruct();

table10 = Logic.WorkWithDB.ReadRecords("Departments");

textBox1.Text = table10.Notes.Count.ToString();

textBox1.ReadOnly = true;

break;

case "Services":

this.Height = 220;

button1.Location = new Point(112, 150);

textBox1.Visible = true; textBox2.Visible = true; textBox3.Visible = true;

label1.Text = "№"; label2.Text = "Service_Sort";label3.Text = "Cost";

TableStruct table11 = new TableStruct();

table11 = Logic.WorkWithDB.ReadRecords("Services");

textBox1.Text = table11.Notes.Count.ToString();

textBox1.ReadOnly = true;

break;

case "Services_Rendered":

this.Height = 320;

button1.Location = new Point(112, 250);

textBox1.Visible = true; textBox3.Visible = true; textBox4.Visible = true; textBox5.Visible = true; textBox7.Visible = true;

label1.Text = "№"; label2.Text = "Service_Sort"; label3.Text = "Date";label4.Text = "Start_Time"; label5.Text = "Finish_Time"; label6.Text = "Employee";label7.Text = "Revenue"; label8.Text = "Sort"; label9.Text = "Currency";

TableStruct table12 = new TableStruct();

table12 = Logic.WorkWithDB.ReadRecords("Revenue");

textBox1.Text = table12.Notes[table12.Notes.Count - 1].Records[0].ToString();

textBox1.Text = (Convert.ToInt32(textBox1.Text) + 1).ToString();

textBox1.ReadOnly = true;

comboBox1.Visible = true;

comboBox1.Location = new Point(112, 40);

comboBox2.Visible = true;

comboBox2.Location = new Point(112, 140);

comboBox3.Visible = true;

comboBox3.Location = new Point(112, 192);

comboBox4.Visible = true;

comboBox4.Location = new Point(112, 220);

table12 = Logic.WorkWithDB.ReadRecords("Services");

for (int i = 1; i < table12.Notes.Count; i++)

{

comboBox1.Items.Add(table12.Notes[i].Records[1]);

}

table12 = Logic.WorkWithDB.ReadRecords("Personal_Data");

for (int i = 1; i < table12.Notes.Count; i++)

{

comboBox2.Items.Add(table12.Notes[i].Records[2]);

}

table12 = Logic.WorkWithDB.ReadRecords("Sort_Rev_Exp");

for (int i = 1; i < table12.Notes.Count; i++)

{

comboBox3.Items.Add(table12.Notes[i].Records[1]);

}

table12 = Logic.WorkWithDB.ReadRecords("Currency");

for (int i = 1; i < table12.Notes.Count; i++)

{

comboBox4.Items.Add(table12.Notes[i].Records[1]);

}

break;

default: ;

break;

}

}

private void button1_Click(object sender, EventArgs e)

{

switch (tablename1)

{

case "Clients": Logic.WorkWithDB.Insert("Insert into Clients([№],[F.I.O],[Adress],[Tel],[E-mail]) Values ("+textBox1.Text+",'"+textBox2.Text+"','"+textBox3.Text+"','"+textBox4.Text+"','"+textBox5.Text+"')");

break;

case "Suppliers": Logic.WorkWithDB.Insert("Insert into Suppliers([№],[F.I.O.],[Adress],[Tel],[E-mail]) Values (" + textBox1.Text + ",'" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "')");

break;

case "Sort": Logic.WorkWithDB.Insert("Insert into Sort([№],[Title]) Values (" + textBox1.Text + ",'" + textBox2.Text + "')");

break;

case "Sort_Rev_Exp": Logic.WorkWithDB.Insert("Insert into Sort_Rev_Exp([№],[Name]) Values (" + textBox1.Text + ",'" + textBox2.Text + "')");

break;

case "Departments": Logic.WorkWithDB.Insert("Insert into Departments([№],[Name]) Values (" + textBox1.Text + ",'" + textBox2.Text + "')");

break;

case "Services": Logic.WorkWithDB.Insert("Insert into Services([№],[Service_Sort],[Cost]) Values (" + textBox1.Text + ",'" + textBox2.Text + "',"+textBox3.Text+")");

break;

case "Currency": Logic.WorkWithDB.Insert("Insert into Currency([№],[Name]) Values (" + textBox1.Text + ",'" + textBox2.Text + "')");

break;

case "Merchandise":

Logic.WorkWithDB.Insert("Insert into Merchandise([Product_Code],[Name],[Count],[Sale_Price],[Sort]) Values (" + comboBox1.Text + ",'" + textBox2.Text + "'," + textBox3.Text + "," + textBox4.Text + ","+ (comboBox2.SelectedIndex+1).ToString()+")");

break;

case "Coming":

Logic.WorkWithDB.Insert("Insert into Expenses([№],[Sort_Expenses],[Currency]) VALUES ("+textBox1.Text + ","+(comboBox2.SelectedIndex+1).ToString()+","+(comboBox3.SelectedIndex+1).ToString()+")");

Logic.WorkWithDB.Insert("Insert into Coming([Product Code],[Name],Count,Purchase_price,Retail_price,Date,Sum,Supplier) Values (" + textBox1.Text + ",'" + textBox2.Text + "'," + textBox3.Text + "," + textBox4.Text + "," + textBox5.Text+",'"+textBox6.Text+ "',"+ textBox7.Text +","+(comboBox1.SelectedIndex+1).ToString()+")");

break;

case "Salary":

Logic.WorkWithDB.Insert("Insert into Expenses([№],[Sort_Expenses],[Currency]) VALUES (" + textBox1.Text + "," + (comboBox2.SelectedIndex + 1).ToString() + "," + (comboBox3.SelectedIndex + 1).ToString() + ")");

Logic.WorkWithDB.Insert("Insert into Salary([№],[Date],[№Contract],Sum) Values (" + textBox1.Text + ",'" + textBox2.Text + "',"+ (comboBox1.SelectedIndex + 1).ToString() +","+textBox4.Text+ ")");

break;

case "Sale":

Logic.WorkWithDB.Insert("Insert into Revenue([№],[Sort_Revenue],[Currency]) VALUES (" + textBox1.Text + "," + (comboBox4.SelectedIndex + 1).ToString() + "," + (comboBox5.SelectedIndex + 1).ToString() + ")");

Logic.WorkWithDB.Insert("Insert into Sale([№],[Product_Code],[Name],[Sort],[Count],[Price],PriceNDS,Client,Date,Sum) Values (" + textBox1.Text + "," + comboBox1.Text + ",'" + textBox3.Text + "'," + (comboBox2.SelectedIndex+1).ToString() + "," + textBox5.Text + "," + textBox6.Text + "," + textBox7.Text + "," + (comboBox3.SelectedIndex + 1).ToString() +",'"+ textBox9.Text+"',"+textBox10.Text+")");

break;

case "Services_Rendered":

Logic.WorkWithDB.Insert("Insert into Revenue([№],[Sort_Revenue],[Currency]) VALUES (" + textBox1.Text + "," + (comboBox3.SelectedIndex + 1).ToString() + "," + (comboBox4.SelectedIndex + 1).ToString() + ")");

Logic.WorkWithDB.Insert("Insert into Services_Rendered([№],[Service_Sort],[Date],[Start_time],Finish_time,Employee,Revenue) Values (" + textBox1.Text + "," + (comboBox1.SelectedIndex + 1).ToString() + ",'" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "'," + (comboBox2.SelectedIndex + 1).ToString() + "," + textBox7.Text + ")");

break;

case "Personal_Data": Logic.WorkWithDB.Insert("Insert into Personal_Data([№Contract],[№Passport],[F.I.O],[Birth_Date],Contract_Date) Values (" + textBox1.Text + ",'" + textBox2.Text +"','"+textBox3.Text+"','"+textBox4.Text+"','"+textBox5.Text+"')");

break;

case "Empl_Data": Logic.WorkWithDB.Insert("Insert into Empl_Data([№Contract],[Post],[Department]) Values (" +(comboBox1.SelectedIndex+1).ToString()+ ","+(comboBox2.SelectedIndex+1).ToString()+","+(comboBox3.SelectedIndex+1).ToString()+")");

break;

case "Posts": Logic.WorkWithDB.Insert("Insert into Posts([№],[Name],[Salary],[Department]) Values (" + textBox1.Text + ",'" + textBox2.Text + "',"+textBox3.Text+","+(comboBox1.SelectedIndex + 1).ToString() + ")");

break;

default: ;

break;

}

this.Close();

}

}

}

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.