Hi
I have 3 Checkbox in my page and insertbutton
1-ChkPeyment
2-ChkFilter
3-ChkLaw
and below is table in database
Id
|
Name
|
Date
|
Behcode
|
resason
|
1
|
Sara
|
2012
|
1111
|
peyment
|
2
|
Jack
|
2013
|
2222
|
Filter
|
I want if users checked ChFilter it insert "Filter" in reason column if they checked ChkLaw it insert "Law" in database and if they checked ChkLaw AND ChkLaw (both) it insert "Other" it insert "Other" in reason column
below is .cs
string other = ChOther.Checked ? "1" : "";
string Filter = ChFilter.Checked ? "1" : "";
string data = Request.QueryString["id"];
if (string.IsNullOrEmpty(data))
{
data = Server.UrlDecode(Request.QueryString["BehCode"]);
}
SqlCommand _cmd = new SqlCommand("Edit_BlackList", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@id", data);
_cmd.Parameters.AddWithValue("@Behcode", data);
_cmd.Parameters.AddWithValue("@Other", other);
_cmd.Parameters.AddWithValue("@Filter", Filter);
_cmd.ExecuteNonQuery();
_cn.Close();
HOw I can do it ?
Best Regards
Neda