01.
private
void
MainPage_Loaded(
object
sender, System.Windows.RoutedEventArgs e)
02.
{
03.
MessageBoxResult result = MessageBox.Show(
"Are you sure want to delete?"
,
"Delete Message"
, MessageBoxButton.OKCancel);
04.
if
(result == MessageBoxResult.OK)
05.
{
06.
08.
Uri uri =
new
Uri(url, UriKind.Absolute);
09.
NavigationContext.QueryString.TryGetValue(
"sproductid"
,
out
sproductID);
10.
StringBuilder postData =
new
StringBuilder();
11.
postData.AppendFormat(
"{0}={1}"
,
"product_id"
, HttpUtility.UrlEncode(InputList.sproductID));
12.
postData.AppendFormat(
"&{0}={1}"
,
"customer_id"
, HttpUtility.UrlEncode(LoginPage.strcustomer_id_k));
13.
14.
WebClient client =
default
(WebClient);
15.
client =
new
WebClient();
16.
client.Headers[HttpRequestHeader.ContentType] =
"application/x-www-form-urlencoded"
;
17.
client.Headers[HttpRequestHeader.ContentLength] = postData.Length.ToString();
18.
19.
client.UploadStringCompleted += client_UploadStringComplete;
20.
client.UploadProgressChanged += client_UploadProgressChangedes;
21.
22.
client.UploadStringAsync(uri,
"POST"
, postData.ToString());
23.
24.
prog =
new
ProgressIndicator();
25.
prog.IsIndeterminate =
true
;
26.
prog.IsVisible =
true
;
27.
prog.Text =
"Loading...."
;
28.
SystemTray.SetProgressIndicator(
this
, prog);
29.
}
30.
else
31.
{
32.
NavigationService.Navigate(
new
Uri(
"/InputList.xaml?selectedItem="
, UriKind.Relative));
33.
}