private void DoAction(ws.YogoAction action) { try { object empty = System.Reflection.Missing.Value; axWebBrowser1.Navigate("about:blank", ref empty, ref empty, ref empty, ref empty); } catch { } pnlScreen.Controls.Clear(); if (action == null) { return; } if (action.ActionType == ws.ActionType.Text) { ShowText(action); } else if (action.ActionType == ws.ActionType.Image) { ShowImage(action); } else if (action.ActionType == ws.ActionType.Browser) { ShowBrowser(action); } }
/// <summary> /// 提交 /// </summary> /// <param name="tran"></param> public static void commit(ws.data.jsonDal.OperateDataJsonHelper tran,ref string msg) { try { string pstda = tran.GenOperateJson(); string rtn = SendHttpRequest.SendRequestByJson(pstda); if (rtn.Substring(0, 6) == "<error") { msg = rtn; } } catch (Exception ex) { msg = ex.Message; } }
/// <summary> /// 删除 /// </summary> /// <param name="tablename">表名,例如:sys_employee</param> /// <param name="strJson">["10","11"]或{"key1":"201201010001","key2":"201201010001"}或者{"where_1":"input_dt>='20120101'"}</param> /// <param name="tran"></param> /// <param name="msg"></param> public static void tranDelete(string tablename, string strJson, ws.data.jsonDal.OperateDataJsonHelper tran, ref string msg) { try { string database = str_dbDefault; if (database == "") database = "db_drsyn"; tablename = database + "." + tablename; tran.Gen_Delete(tablename, strJson, ref msg); } catch (Exception ex) { msg = ex.Message; } }
private void ShowBrowser(ws.YogoAction action) { object empty = System.Reflection.Missing.Value; axWebBrowser1.Navigate(action.UrlToNavigateTo, ref empty, ref empty, ref empty, ref empty); pnlScreen.Controls.Add(axWebBrowser1); }
private void ShowText(ws.YogoAction action) { Label lbl = new Label(); lbl.Text = action.TextToDisplay; lbl.Size = pnlScreen.Size; pnlScreen.Controls.Add(lbl); }
private void ShowImage(ws.YogoAction action) { Bitmap image = Phone.GetImageFromUrl(action.ImageUrl); PictureBox pic = new PictureBox(); pic.Image = image; pic.Size = pnlScreen.Size; pic.SizeMode = PictureBoxSizeMode.Zoom; pnlScreen.Controls.Add(pic); }