Data Services
public static void AddNewMaterial(int material_id, string material, string UTP, string Use_Type,string Salt, string Salt_Type)
{
OracleDatabase db =(OracleDatabase)DatabaseFactory.CreateDatabase("PHTS");
using (System.Data.Common.DbCommand cmd = db.GetStoredProcCommand("AddNewMaterial"))
{
db.AddInParameter(cmd, "I_Material_ID", DbType.Int32, material_id);
db.AddInParameter(cmd, "I_Material", DbType.String, material);
db.AddInParameter(cmd, "I_UTP", DbType.String, UTP);
db.AddInParameter(cmd, "I_Use_Type", DbType.String, Use_Type);
db.AddInParameter(cmd, "I_Salt", DbType.String, Salt);
db.AddInParameter(cmd, "I_Salt_Type", DbType.String, Salt_Type);
db.ExecuteNonQuery(cmd);
}
}
UserInterface
private void Savebutton_Click(object sender, EventArgs e)
{
int material_id = Convert.ToInt32(this.MIDtextBox.Text);
string material = this.MaterialtextBox.Text;
string UTP = this.UTPcheckBox.Text;
string Use_Type = this.UseTypecomboBox.Text;
string Salt = this.SaltCheckbox.Text;
string Salt_Type = this.SaltComboBox.Text;
PHTS.DataServices.cslMaterial.AddNewMaterial(material_id, material, UTP, Use_Type,Salt, Salt_Type);
MessageBox.Show("Record Saved");
}
How can I save the Checkbox.checked Item to database as “Y” and if is not checked then I have to save as "N"
Thanks