Advertisement
bit

Untitled

bit
Apr 16th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. using Android.App;
  7. using Android.Content;
  8. using Android.OS;
  9. using Android.Runtime;
  10. using Android.Views;
  11. using Android.Widget;
  12. using Android.Graphics;
  13. using Newtonsoft.Json.Linq;
  14. using Android.Content.PM;
  15. using System.Threading;
  16. using System.Collections.Specialized;
  17. using StaticHelper;
  18. using iSuiteMobile;
  19. using Android.Webkit;
  20. using Android.Graphics.Drawables;
  21. using System.Xml;
  22. using System.Xml.Linq;
  23.  
  24.  
  25. namespace PMGMobile
  26. {
  27. [Activity (Label = "Service", Icon="@drawable/pmgmark", WindowSoftInputMode = SoftInput.AdjustPan,
  28. ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation, Theme = "@style/ApplicationTheme")]
  29. public class ActivityServiceView : Activity
  30. {
  31. private String breadcrumb;
  32. String itemId;
  33. LinearLayout formLLO;
  34. Context context;
  35. static Dictionary<object, object> viewsToFormItem; // Holds the reference between the screen questions and the underlying form questions
  36. View activeView = null; // reference to view, the custom LLO for the current selected question during the dialog process
  37. List<SelectItem> selectListValuesHolder = null; // Holds selected items for active select list
  38. static Form form;
  39. Button submitButton;
  40. Dictionary<Object, Object> emptyRequiredFields;
  41. ScrollView formScrollView;
  42.  
  43. private IValueCallback mUploadMessage;
  44. private static int FILECHOOSER_RESULTCODE=1;
  45.  
  46. protected override void OnCreate(Bundle bundle)
  47. {
  48. base.OnCreate(bundle);
  49. context = this;
  50.  
  51. //TODO: Fix display for long default text on selects. Getting truncated. Test for long texts on all types.
  52. //TODO: don't default input to first text input. it's forcing scroll past service description
  53.  
  54. viewsToFormItem = new Dictionary<object,object>(); // make sure initialized, since static
  55.  
  56.  
  57. itemId = Intent.GetStringExtra("itemId"); // get passed in category to load
  58. String itemName = Intent.GetStringExtra("itemName"); // get passed in category to load
  59. breadcrumb = Intent.GetStringExtra("breadcrumb");
  60. SetContentView(Resource.Layout.activity_service_view);
  61.  
  62. View topView = this.FindViewById(Resource.Id.serviceLLO);
  63. var itemImageIV = this.FindViewById(Resource.Id.badgeImage) as ImageView;
  64. TextView itemNameTV = this.FindViewById(Resource.Id.itemName2) as TextView;
  65. itemNameTV.Text = itemName;
  66.  
  67. formScrollView = (ScrollView) this.FindViewById(Resource.Id.formScrollView);
  68.  
  69. //Load Service Data, layout base service view layout, and render the form.
  70. JArray itemData = DataUtility.GetProductData(itemId, false);
  71.  
  72. formLLO = (LinearLayout)this.FindViewById(Resource.Id.formLLO);
  73. WebView descriptionWV = (WebView)this.FindViewById(Resource.Id.description);
  74. descriptionWV.LoadData(itemData [2].ToString(), "text/html", "utf-8");
  75.  
  76. String itemImageUrl = null;
  77. try
  78. {
  79. itemImageUrl = GetFullImageUrl(itemData [3].ToString());
  80. } catch
  81. {
  82. // no image present
  83. }
  84.  
  85. PMGUtilityAndroid.SetImageViewFromURL(this, itemImageIV, itemImageUrl);
  86.  
  87. submitButton = (Button) this.FindViewById(Resource.Id.submitButton);
  88. submitButton.Click+=(sender, e) => {SubmitForm();};
  89. form = new Form((JArray)itemData [4]);
  90. form.ShowHideRulesAsXml = (string) itemData[5]; //
  91. RenderForm(form);
  92.  
  93. ProcessShowHide();
  94.  
  95. }
  96.  
  97. public static void ProcessShowHide()
  98. {
  99. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  100. {
  101.  
  102. View view = (View)pair.Key;
  103.  
  104. FormItem formItem = (FormItem)pair.Value;
  105.  
  106. if (formItem.visibilityControlled)
  107. {
  108. view.Visibility = ViewStates.Gone;
  109. formItem.visibility = Visibility.Invisible;
  110. }
  111. }
  112.  
  113. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  114. {
  115.  
  116. View view = (View)pair.Key;
  117. FormItem formItem = (FormItem)pair.Value;
  118.  
  119. if (formItem.visibility == Visibility.Visible)
  120. {
  121. if (formItem.type == "radio_set" || formItem.type == "select")
  122. {
  123. string selectValue = formItem.SingleSelectValue();
  124. if (selectValue != null)
  125. {
  126. if (formItem.displayRules.ContainsKey(selectValue))
  127. {
  128. Dictionary<string, bool> rules = formItem.displayRules[selectValue];
  129. foreach (KeyValuePair<string, bool> rule in rules)
  130. {
  131. form.SetFormItemVisibility(rule.Key, rule.Value);
  132. }
  133. }
  134. }
  135. }
  136. }
  137.  
  138. }
  139. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  140. {
  141.  
  142. View view = (View)pair.Key;
  143. FormItem formItem = (FormItem)pair.Value;
  144. if (formItem.visibility == Visibility.Visible)
  145. view.Visibility = ViewStates.Visible;
  146. else
  147. view.Visibility = ViewStates.Gone;
  148. }
  149.  
  150.  
  151. }
  152.  
  153.  
  154. void RenderForm(Form form)
  155. {
  156.  
  157. View section=null;
  158.  
  159. TextView labelTV = null;
  160. TextView requiredTV = null;
  161.  
  162.  
  163. if (true)
  164. {
  165.  
  166. // Experimental code to render webview vs. native form
  167. section = LayoutInflater.Inflate(Resource.Layout.form_instructionaltext, null);
  168. WebView wv2 = (WebView)section.FindViewById(Resource.Id.webView);
  169. //wv2.LoadData("Hi", "text/html", "utf-8");
  170. wv2.SetWebViewClient(new WebViewClient());
  171. wv2.SetWebChromeClient(new WebChromeClient(){
  172. // For Android 3.0+
  173. public void openFileChooser( Android.Webkit.IValueCallback uploadMsg, String acceptType ) {
  174. mUploadMessage = uploadMsg;
  175. Intent i = new Intent(Intent.ActionGetContent);
  176. i.AddCategory(Intent.CategoryOpenable);
  177. i.SetType("*/*");
  178. StartActivityForResult(Intent.CreateChooser(i, "File Browser"),
  179. FILECHOOSER_RESULTCODE);
  180. }
  181.  
  182. //For Android 4.1
  183. public void openFileChooser(IValueCallback uploadMsg, String acceptType, String capture){
  184. mUploadMessage = uploadMsg;
  185. Intent i = new Intent(Intent.ActionGetContent);
  186. i.AddCategory(Intent.CategoryOpenable);
  187. i.SetType("image/*");
  188. StartActivityForResult( Intent.CreateChooser( i, "File Chooser" ), FILECHOOSER_RESULTCODE );
  189.  
  190. }
  191.  
  192. });
  193. wv2.Settings.JavaScriptEnabled = true;
  194. wv2.LoadUrl("http://hascdev7.pmg.net/sc/catalog.product.aspx?product_id=" + itemId + "&showminimal=true");
  195.  
  196. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  197. labelTV.Text = "Another Hi";
  198.  
  199. formLLO.AddView(section);
  200. // viewsToFormItem.Add(section, "Last Hi");
  201.  
  202. }
  203.  
  204. if (false)
  205. {
  206. foreach (FormItem formItem in form.Questions)
  207. {
  208. // TODO: pricerule, service price
  209. // TODO: File
  210.  
  211. labelTV = null;
  212. requiredTV = null;
  213.  
  214. if (formItem.type == "instr_text")
  215. {
  216. section = LayoutInflater.Inflate(Resource.Layout.form_instructionaltext, null);
  217. WebView wv = (WebView)section.FindViewById(Resource.Id.webView);
  218. wv.LoadData(formItem.defaultValue, "text/html", "utf-8");
  219.  
  220. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  221. labelTV.Text = formItem.label;
  222.  
  223. formLLO.AddView(section);
  224. viewsToFormItem.Add(section, formItem);
  225.  
  226. }
  227. if (formItem.type == "text" || formItem.type == "textarea")
  228. {
  229. if (formItem.type == "text")
  230. section = LayoutInflater.Inflate(Resource.Layout.form_shorttext, null);
  231. else
  232. section = LayoutInflater.Inflate(Resource.Layout.form_textarea, null);
  233. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  234. labelTV.Text = formItem.label;
  235. formLLO.AddView(section);
  236. viewsToFormItem.Add(section, formItem);
  237.  
  238. }
  239. if (formItem.type == "section_head")
  240. {
  241. section = LayoutInflater.Inflate(Resource.Layout.form_section, null);
  242.  
  243. TextView sectionLabel = (TextView)section.FindViewById(Resource.Id.label);
  244. sectionLabel.Text = formItem.label;
  245. formLLO.AddView(section);
  246. viewsToFormItem.Add(section, formItem);
  247. }
  248. if (formItem.type == "checkbox")
  249. {
  250.  
  251. section = LayoutInflater.Inflate(Resource.Layout.form_checkbox, null);
  252. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  253. labelTV.Text = formItem.label;
  254. formLLO.AddView(section);
  255. viewsToFormItem.Add(section, formItem);
  256. }
  257. if (formItem.type == "datepicker")
  258. {
  259. section = LayoutInflater.Inflate(Resource.Layout.form_date, null);
  260. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  261. labelTV.Text = formItem.label;
  262. //View topParent = GetTopParent(dateButton); // Get the layout that holds this button so its properties can be set later. PMG: RWC built this because I couldn't find another way. Well, turns out this wasn't needed. 'section' can be passed to the click event below.
  263.  
  264. section.Click += (sender, e) =>
  265. {
  266. ShowDatePicker(sender, e);
  267. };
  268.  
  269. formLLO.AddView(section);
  270. viewsToFormItem.Add(section, formItem);
  271.  
  272. }
  273.  
  274. if (formItem.type == "multiselect" || formItem.type == "multicheckbox" || formItem.type == "radio_set" || formItem.type == "select")
  275. {
  276.  
  277. section = LayoutInflater.Inflate(Resource.Layout.form_select, null);
  278. labelTV = (TextView)section.FindViewById(Resource.Id.label);
  279. labelTV.Text = formItem.label;
  280. TextView selectedText = (TextView)section.FindViewById(Resource.Id.selectedText);
  281. bool hasSelected = false;
  282. for (int i = 0; i < formItem.selectItems.Count; i++)
  283. {
  284. if (formItem.selectItems[i].selected)
  285. hasSelected = true;
  286. }
  287. if (!hasSelected)
  288. selectedText.Text = "Select...";
  289.  
  290. section.Click += (sender, e) =>
  291. {
  292. SelectClickLocal(sender);
  293. };
  294.  
  295. // Button selectB = (Button)section.FindViewById(Resource.Id.select_colours);
  296. // selectB.Click+= (sender,e)=> {selectClick(sender);};
  297.  
  298. formLLO.AddView(section);
  299. viewsToFormItem.Add(section, formItem);
  300.  
  301. }
  302. if (formItem.type != "hidden")
  303. {
  304. requiredTV = (TextView)section.FindViewById(Resource.Id.required);
  305. if (requiredTV != null)
  306. {
  307. if (formItem.required)
  308. requiredTV.Visibility = ViewStates.Visible;
  309. else
  310. requiredTV.Visibility = ViewStates.Gone;
  311.  
  312.  
  313.  
  314. }
  315. }
  316.  
  317. }
  318. ShowHide();
  319. } // end if false
  320.  
  321. }
  322.  
  323. public void ShowHide()
  324. {
  325. LoadRules();
  326. }
  327.  
  328. public void LoadRules()
  329. {
  330. try
  331. {
  332. XDocument rulesXD = XDocument.Parse(form.ShowHideRulesAsXml);
  333.  
  334. foreach (XElement q in rulesXD.Descendants("q"))
  335. {
  336. // This turns an xml rules document for an entire form into individual dictionary entries for each respective question/FormItem.
  337. // Each formItem has a dictionary of "values/answers" which each contain a dictionary of show/hide rules and the target question
  338. Console.WriteLine(q.Document.ToString());
  339. XAttribute qIDXA = q.Attribute("id");
  340. string qID = qIDXA.Value.Remove(0, 8); // remove ____dnp_ prefex
  341.  
  342. FormItem fi = form.GetFormItemByMP(qID);
  343.  
  344. foreach (XElement a in q.Descendants("a"))
  345. {
  346. XAttribute vXA = a.Attribute("v");
  347. string aValue = vXA.Value;
  348.  
  349. foreach (XElement qr in a.Descendants("qr"))
  350. {
  351. XAttribute idXA = qr.Attribute("id");
  352. string controlledId = idXA.Value.Remove(0, 8); // remove ____dnp_ prefex;
  353. XAttribute showXA = qr.Attribute("show");
  354. string show = showXA.Value;
  355. bool showRule = (show == "1"); // convert 0 and 1 to false and true;
  356.  
  357. if (!fi.displayRules.ContainsKey(aValue))
  358. fi.displayRules.Add(aValue, new Dictionary<string, bool>()); // if the value entry doesn't exist yet, add a new one
  359.  
  360. fi.displayRules[aValue].Add(controlledId, showRule); // append the target question id,rule to the value entry
  361.  
  362. form.SetFIVisibilityControlled(controlledId, true);
  363.  
  364. Console.WriteLine("qID: " + qID + " aValue: " + aValue + " controlledId: " + controlledId + " show: " + show);
  365.  
  366.  
  367. }
  368. }
  369. }
  370. }
  371. catch (Exception e)
  372. {
  373. Console.WriteLine(e.Message);
  374.  
  375. // Nothing to do yet. if this errors out, most likely insignificant.
  376. }
  377.  
  378.  
  379. }
  380.  
  381. public bool CheckRequired()
  382. {
  383. NameValueCollection parameters = new NameValueCollection();
  384.  
  385. List<string> typesToSend = new List<string>() {"text", "textarea", "checkbox", "datepicker", "multiselect", "multicheckbox", "radio_set", "select"};
  386.  
  387. emptyRequiredFields = new Dictionary<Object,Object>();
  388.  
  389. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  390. {
  391.  
  392. View view = (View)pair.Key;
  393.  
  394. FormItem formItem = (FormItem)pair.Value;
  395.  
  396. if (typesToSend.Contains(formItem.type) && formItem.required && (formItem.visibility != Visibility.Invisible))
  397. {
  398.  
  399. if (formItem.type == "text" || formItem.type == "textarea")
  400. {
  401. EditText input = (EditText)view.FindViewById(Resource.Id.input);
  402. if (input.Text.Length == 0)
  403. {
  404. emptyRequiredFields.Add(view, formItem);
  405. }
  406. }
  407. if (formItem.type == "checkbox")
  408. {
  409. CheckBox cb = (CheckBox)view.FindViewById(Resource.Id.input);
  410. if (!cb.Checked)
  411. emptyRequiredFields.Add(view, formItem);
  412. }
  413. if (formItem.type == "datepicker")
  414. {
  415. if (formItem.date == null)
  416. emptyRequiredFields.Add(view, formItem);
  417. }
  418.  
  419. if (formItem.type == "multiselect" || formItem.type == "multicheckbox" || formItem.type == "radio_set" || formItem.type == "select")
  420. {
  421.  
  422. bool hasSelected = false;
  423. List<string> selectedTexts = new List<string>();
  424.  
  425. for (int i = 0; i < formItem.selectItems.Count; i++)
  426. {
  427. if (formItem.selectItems[i].selected)
  428. {
  429. hasSelected = true;
  430. break;
  431. }
  432. }
  433. if (!hasSelected)
  434. emptyRequiredFields.Add(view, formItem);
  435.  
  436. }
  437. }
  438.  
  439. }
  440. if (emptyRequiredFields.Count == 0)
  441. return true;
  442. return false;
  443. }
  444.  
  445.  
  446. public override bool OnCreateOptionsMenu(IMenu menu)
  447. {
  448. return PMGDialogAndroid.StandardOptionsMenu(menu);
  449. }
  450.  
  451. public override bool OnOptionsItemSelected(IMenuItem item)
  452. {
  453. return PMGDialogAndroid.StandardOptionsItemSelected(this, item);
  454.  
  455. }
  456.  
  457.  
  458. private void SelectClickLocal(object o)
  459. {
  460. PMGDialogAndroid dialogHelper = new PMGDialogAndroid();
  461. dialogHelper.context = context;
  462. dialogHelper.viewsToFormItem = viewsToFormItem;
  463. dialogHelper.selectListValuesHolder = selectListValuesHolder;
  464. dialogHelper.selectClick(o);
  465. }
  466.  
  467. public View GetTopParent(View v) // Find the highest level holding view for a view. Typically this is for getting the Layout that holds something like a button.
  468. {
  469. View parent = v;
  470. while (parent.Parent!=null)
  471. {
  472. parent = (View)parent.Parent;
  473. }
  474. return parent;
  475. }
  476.  
  477. private void ShowDatePicker(object sender, EventArgs e)
  478. {
  479. activeView = (View)sender; // set activeView so the callback can find the form item.
  480. FormItem formItem = (FormItem)viewsToFormItem [activeView];
  481. DateTime dateToShow;
  482.  
  483. if (formItem.date == DateTime.MinValue)
  484. dateToShow = DateTime.Today;
  485. else
  486. dateToShow = formItem.date;
  487.  
  488. DatePickerDialog datePickerDialog = new DatePickerDialog(this, OnDateSet, dateToShow.Year, dateToShow.Month, dateToShow.Day);
  489. datePickerDialog.Show();
  490.  
  491. }
  492.  
  493. private void OnDateSet(object view, DatePickerDialog.DateSetEventArgs e)
  494. {
  495. FormItem formItem = (FormItem)viewsToFormItem [activeView];
  496. TextView dateDisplay = (TextView)activeView.FindViewById(Resource.Id.dateDisplay);
  497. DateTime setDate = new DateTime(e.Year, e.MonthOfYear, e.DayOfMonth);
  498. formItem.date = setDate;
  499. dateDisplay.Text = setDate.ToString("d");
  500. }
  501.  
  502.  
  503. // private void showSelectDialog()
  504. // {
  505. // DialogInterface.
  506. // AlertDialog.Builder builder = new AlertDialog.Builder(context);
  507. // builder.SetTitle("Select");
  508. // string[] choices = {"Red","Green","Blue"};
  509. // bool[] selected = {false, false, true};
  510. // builder.SetMultiChoiceItems(choices, selected, selectDialogListener);
  511. // AlertDialog dialog = builder.Create();
  512. // dialog.Show();
  513. // }
  514.  
  515. void SubmitForm()
  516. {
  517. View backgroundLLO = null;
  518.  
  519. //reset any prior required field indicators
  520. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  521. {
  522. View view = (View)pair.Key;
  523. backgroundLLO = view.FindViewById(Resource.Id.backgroundLLO);
  524. if (backgroundLLO != null)
  525. backgroundLLO.SetBackgroundColor(Color.ParseColor("#00000000"));
  526. }
  527.  
  528.  
  529. if (!CheckRequired())
  530. {
  531. //submitButton.Enabled = false;
  532. List<string> missingfields = new List<string>();
  533. foreach (KeyValuePair<object, object> pair in emptyRequiredFields)
  534. {
  535. View view = (View)pair.Key;
  536.  
  537. FormItem formItem = (FormItem)pair.Value;
  538.  
  539. missingfields.Add(formItem.label);
  540.  
  541. backgroundLLO = view.FindViewById(Resource.Id.backgroundLLO);
  542. if (backgroundLLO != null)
  543. backgroundLLO.SetBackgroundColor(Color.ParseColor("#99FF0000"));
  544.  
  545. }
  546. Toast.MakeText(this, "Empty Required Fields Found: " + string.Join<string>(", ", missingfields), ToastLength.Long).Show();
  547.  
  548. int yScrollPos = 0;
  549. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  550. {
  551. if (!emptyRequiredFields.Contains(pair))
  552. {
  553. View tempView = (View)pair.Key;
  554. yScrollPos += tempView.Height;
  555. }
  556. else
  557. break;
  558.  
  559. }
  560.  
  561. formScrollView.ScrollTo(0, yScrollPos);
  562.  
  563. return;
  564. }
  565.  
  566. Toast.MakeText(this, "Please wait...", ToastLength.Short).Show();
  567. NameValueCollection parameters = new NameValueCollection();
  568.  
  569.  
  570. List<string> typesToSend = new List<string>() {"text", "textarea", "checkbox", "datepicker", "multiselect", "multicheckbox", "radio_set", "select"};
  571.  
  572. foreach (KeyValuePair<object, object> pair in viewsToFormItem)
  573. {
  574.  
  575. View view = (View)pair.Key;
  576.  
  577. FormItem formItem = (FormItem)pair.Value;
  578.  
  579. if (!emptyRequiredFields.ContainsKey(view))
  580. view.SetBackgroundColor(Color.ParseColor("#00000000")); // reset any non-required field background colors
  581.  
  582. if (typesToSend.Contains(formItem.type))
  583. {
  584.  
  585. string key = "__dnp_" + formItem.mappingPath;
  586. string value = "";
  587.  
  588. if (formItem.type == "text" || formItem.type == "textarea")
  589. {
  590. EditText input = (EditText)view.FindViewById(Resource.Id.input);
  591. value = input.Text;
  592.  
  593. }
  594. if (formItem.type == "checkbox")
  595. {
  596. CheckBox cb = (CheckBox)view.FindViewById(Resource.Id.input);
  597. value = cb.Checked.ToString();
  598. }
  599. if (formItem.type == "datepicker")
  600. {
  601. value = formItem.date.ToString();
  602. }
  603.  
  604. if (formItem.type == "multiselect" || formItem.type == "multicheckbox" || formItem.type == "radio_set" || formItem.type == "select")
  605. {
  606. value = "";
  607.  
  608. bool hasSelected = false;
  609. List<string> selectedTexts = new List<string>();
  610.  
  611. for (int i=0; i<formItem.selectItems.Count; i++)
  612. {
  613. if (formItem.selectItems [i].selected)
  614. {
  615. selectedTexts.Add(formItem.selectItems [i].display);
  616. hasSelected = true;
  617. }
  618. if (hasSelected)
  619. {
  620. value = String.Join(", ", selectedTexts);
  621. }
  622.  
  623. }
  624. }
  625.  
  626. parameters.Add(key, value);
  627. }
  628.  
  629. }
  630. new Thread(new ThreadStart(() =>
  631. {
  632. string orderNumber = SubmitRequest(itemId, parameters);
  633. RunOnUiThread(() => onOrderSubmitted(orderNumber));
  634. }
  635. )
  636. ).Start();
  637.  
  638.  
  639.  
  640. }
  641.  
  642. // void SubmitForm ()
  643. // {
  644. // Toast.MakeText (this, "Please wait...", ToastLength.Short).Show ();
  645. // NameValueCollection parameters = new NameValueCollection();
  646. // foreach (var element in from section in root from element in section where element.Tag != null && element.Tag is string select element) {
  647. // string key = "__dnp_" + element.Tag.ToString();
  648. // string value = element.Summary();
  649. // parameters.Add(key, value);
  650. // }
  651. //
  652. // new Thread (new ThreadStart (() =>
  653. // {
  654. // string orderNumber = SubmitRequest(itemId, parameters);
  655. // RunOnUiThread (() => onOrderSubmitted (orderNumber));
  656. // }
  657. // )
  658. // ).Start ();
  659. //
  660. //
  661. //
  662. // }
  663. //
  664.  
  665. string SubmitRequest(string itemId, NameValueCollection form)
  666. {
  667. string orderId = DataUtility.SubmitOrder(itemId, form);
  668. return orderId;
  669. }
  670.  
  671. void onOrderSubmitted(string orderNumber)
  672. {
  673. Toast.MakeText(this, "Order number " + orderNumber, ToastLength.Short).Show();
  674. }
  675.  
  676. string GetFullImageUrl(string sPartialPath)
  677. {
  678. if (sPartialPath.StartsWith("catalog_resources/"))
  679. {
  680. return Config.ServerBaseUrl + "/sc/" + sPartialPath;
  681. } else
  682. {
  683. return Config.ServerBaseUrl + sPartialPath;
  684. }
  685.  
  686.  
  687.  
  688. }
  689.  
  690.  
  691.  
  692. public delegate void itemClick();
  693.  
  694.  
  695. }
  696. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement