public void companyAdd(company company) { createConnection(); connection.Open(); SqlCommand command = new SqlCommand(); command.Connection = connection; command.CommandText = "companyAdd"; command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@name", SqlDbType.NVarChar, 50); command.Parameters["@name"].Value = company.name; command.Parameters.Add("@statemen", SqlDbType.NVarChar, 50); command.Parameters["@statemen"].Value = company.statemen; command.Parameters.Add("@responsible", SqlDbType.NVarChar, 50); command.Parameters["@responsible"].Value = company.responsible; command.Parameters.Add("@title", SqlDbType.NVarChar, 50); command.Parameters["@title"].Value = company.title; command.Parameters.Add("@accountNumber", SqlDbType.Int, 50); command.Parameters["@accountNumber"].Value = company.accountNumber; command.Parameters.Add("@bankName", SqlDbType.NVarChar, 50); command.Parameters["@bankName"].Value = company.bankName; command.Parameters.Add("@officeName", SqlDbType.NVarChar, 50); command.Parameters["@officeName"].Value = company.officeName; command.Parameters.Add("@officeCode", SqlDbType.Int, 50); command.Parameters["@officeCode"].Value = company.officeCode; command.Parameters.Add("@taxDepartment", SqlDbType.NVarChar, 50); command.Parameters["@taxDepartment"].Value = company.taxDepartment; command.Parameters.Add("@taxNumber", SqlDbType.Int, 50); command.Parameters["@taxNumber"].Value = company.taxNumber; command.Parameters.Add("@billAdress", SqlDbType.NVarChar, 50); command.Parameters["@billAdress"].Value = company.billAdress; command.Parameters.Add("@billTitle", SqlDbType.NVarChar, 50); command.Parameters["@billTitle"].Value = company.billTitle; command.Parameters.Add("@tel1code", SqlDbType.Int, 50); command.Parameters["@tel1code"].Value = company.tel1code; command.Parameters.Add("@tel1", SqlDbType.Int, 50); command.Parameters["@tel1"].Value = company.tel1; command.Parameters.Add("@tel2code", SqlDbType.Int, 50); command.Parameters["@tel2code"].Value = company.tel2code; command.Parameters.Add("@tel2", SqlDbType.Int, 50); command.Parameters["@tel2"].Value = company.tel2; command.Parameters.Add("@tel3code", SqlDbType.Int, 50); command.Parameters["@tel3code"].Value = company.tel3code; command.Parameters.Add("@tel3", SqlDbType.Int, 50); command.Parameters["@tel3"].Value = company.tel3; command.Parameters.Add("@tel4code", SqlDbType.Int, 50); command.Parameters["@tel4code"].Value = company.tel4code; command.Parameters.Add("@tel4", SqlDbType.Int, 50); command.Parameters["@tel4"].Value = company.tel4; command.Parameters.Add("@tel5code", SqlDbType.Int, 50); command.Parameters["@tel5code"].Value = company.tel5code; command.Parameters.Add("@tel5", SqlDbType.Int, 50); command.Parameters["@tel5"].Value = company.tel5; command.Parameters.Add("@tel6code", SqlDbType.Int, 50); command.Parameters["@tel6code"].Value = company.tel6code; command.Parameters.Add("@tel6", SqlDbType.Int, 50); command.Parameters["@tel6"].Value = company.tel6; command.Parameters.Add("@addhood", SqlDbType.NVarChar, 50); command.Parameters["@addhood"].Value = company.addhood; command.Parameters.Add("@addstreet", SqlDbType.NVarChar, 50); command.Parameters["@addstreet"].Value = company.addstreet; command.Parameters.Add("@addstreeet", SqlDbType.NVarChar, 50); command.Parameters["@addstreeet"].Value = company.addstreeet; command.Parameters.Add("@addno", SqlDbType.Int, 50); command.Parameters["@addno"].Value = company.addno; command.Parameters.Add("@addbuilding", SqlDbType.NVarChar, 50); command.Parameters["@addbuilding"].Value = company.addbuilding; command.Parameters.Add("@addfloor", SqlDbType.Int, 50); command.Parameters["@addfloor"].Value = company.addfloor; command.Parameters.Add("@addnoo", SqlDbType.Int, 50); command.Parameters["@addnoo"].Value = company.addnoo; command.Parameters.Add("@addtown", SqlDbType.NVarChar, 50); command.Parameters["@addtown"].Value = company.addtown; command.Parameters.Add("@addcity", SqlDbType.NVarChar, 50); command.Parameters["@addcity"].Value = company.addcity; command.Parameters.Add("@adddescrip", SqlDbType.NVarChar, 50); command.Parameters["@adddescrip"].Value = company.adddescrip; command.ExecuteNonQuery(); connection.Close(); connection.Dispose(); }
private company formToObject() { company company = new company(); company.name = textBox7.Text.ToString(); company.statemen = textBox8.Text.ToString(); company.responsible = textBox9.Text.ToString(); company.title = textBox10.Text.ToString(); company.accountNumber = Convert.ToInt32(textBox11.Text); company.bankName = textBox12.Text.ToString(); company.officeName = textBox13.Text.ToString(); company.officeCode =Convert.ToInt32(textBox14.Text); company.billTitle = textBox15.Text.ToString(); company.taxDepartment = textBox16.Text.ToString(); company.taxNumber = Convert.ToInt32(textBox17.Text); company.billAdress = textBox18.Text.ToString(); company.tel1code = Convert.ToInt32(textBox19.Text); company.tel1 = Convert.ToInt32(textBox20.Text); company.tel2code = Convert.ToInt32(textBox21.Text); company.tel2 = Convert.ToInt32(textBox22.Text); company.tel3code = Convert.ToInt32(textBox23.Text); company.tel3 = Convert.ToInt32(textBox24.Text); company.tel4code = Convert.ToInt32(textBox25.Text); company.tel4 = Convert.ToInt32(textBox26.Text); company.tel5code = Convert.ToInt32(textBox27.Text); company.tel5 = Convert.ToInt32(textBox28.Text); company.tel6code = Convert.ToInt32(textBox29.Text); company.tel6 = Convert.ToInt32(textBox30.Text); company.addhood=textBox31.Text.ToString(); company.addstreet=textBox32.Text. ToString(); company.addstreeet=textBox33.Text.ToString(); company.addno=Convert.ToInt32(textBox34.Text); company.addbuilding= textBox35.Text.ToString(); company.addfloor=Convert.ToInt32(textBox36.Text); company.addnoo=Convert.ToInt32(textBox37.Text); company.addtown=textBox38.Text.ToString(); company.addcity=textBox39.Text.ToString(); company.adddescrip = textBox42.Text.ToString(); company.billInfoCode = billInfoCode; company.bankInfoCode = bankInfoCode; company.contactInfoCode = contactInfoCode; return company; }