protected void Page_Load(object sender, EventArgs e) { this.channel_id = TWRequest.GetQueryInt("channel_id", 1); this.category_id = TWRequest.GetQueryInt("category_id"); this.keywords = TWRequest.GetQueryString("keywords"); this.property = TWRequest.GetQueryString("property"); this.status = TWRequest.GetQueryString("status"); if (channel_id == 0) { JscriptMsg("頻道參數不正確!", "back"); return; } statusSelect.Visible = true; this.channel_name = new BLL.channel().GetChannelName(this.channel_id); //取得頻道名稱 this.pageSize = GetPageSize(50); //每頁數量 this.prolistview = Utils.GetCookie("vip_list_view"); //顯示方式 if (!Page.IsPostBack) { //ChkAdminLevel("channel_" + this.channel_name + "_list", TWEnums.ActionEnum.View.ToString()); //檢查權限 TreeBind(this.channel_id); //綁定類別 RptBind(this.channel_id, this.category_id, "id>0" + CombSqlTxt(this.keywords, this.property, this.status), "sort_id,add_time desc,id desc"); } }
private void RptBind(string _strWhere, string _orderby) { this.page = TWRequest.GetQueryInt("page", 1); if (this.status > 0) { this.ddlStatus.SelectedValue = this.status.ToString(); } if (this.payment_status > 0) { this.ddlPaymentStatus.SelectedValue = this.payment_status.ToString(); } if (this.express_status > 0) { this.ddlExpressStatus.SelectedValue = this.express_status.ToString(); } txtKeywords.Text = this.keywords; txtdate.SelectedValue = data; txtbegin.Text = begin; txtend.Text = end; Tea.Web.UI.ShopPage bll = new UI.ShopPage(); this.rptList.DataSource = bll.GetViewList("shop_orders", "", this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //綁定頁碼 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}&page={4}&cid={5}&data={6}&begin={7}&end={8}", this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords, "__id__", cid.ToString(), data, begin, end); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void Page_Load(object sender, EventArgs e) { string _action = TWRequest.GetQueryString("action"); if (!string.IsNullOrEmpty(_action) && _action == TWEnums.ActionEnum.Edit.ToString()) { this.action = TWEnums.ActionEnum.Edit.ToString();//修改類型 this.id = TWRequest.GetQueryInt("id"); if (this.id == 0) { JscriptMsg("傳輸參數不正確!", "back"); return; } if (!new BLL.basic().Exists(this.id)) { JscriptMsg("資料不存在或已被刪除!", "back"); return; } } if (!Page.IsPostBack) { //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.View.ToString()); //檢查權限 if (action == TWEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
protected void Page_Load(object sender, EventArgs e) { string _action = TWRequest.GetQueryString("action"); if (!string.IsNullOrEmpty(_action) && _action == TWEnums.ActionEnum.Edit.ToString()) { this.action = TWEnums.ActionEnum.Edit.ToString();//修改類型 this.id = TWRequest.GetQueryInt("id"); if (this.id == 0) { JscriptMsg("傳輸參數不正確!", "back"); return; } if (!new BLL.basic().Exists(this.id)) { JscriptMsg("資料不存在或已被刪除!", "back"); return; } } if (!Page.IsPostBack) { txtbasic_type.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_basic where basic_where='qu' order by basic_sort"); txtbasic_type.DataTextField = "basic_label"; txtbasic_type.DataValueField = "basic_value"; txtbasic_type.DataBind(); //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.View.ToString()); //檢查權限 if (action == TWEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
protected void Page_Load(object sender, EventArgs e) { this.id = TWRequest.GetQueryInt("id"); if (this.id == 0) { JscriptMsg("傳輸參數不正確!", "back"); return; } if (!new BLL.orders().Exists(this.id)) { JscriptMsg("記錄不存在或已被刪除!", "back"); return; } if (!Page.IsPostBack) { BLL.express bll2 = new BLL.express(); DataTable dt = bll2.GetList("").Tables[0]; ddlExpressId.Items.Clear(); ddlExpressId.Items.Add(new ListItem("請選擇配送方式", "")); foreach (DataRow dr in dt.Rows) { ddlExpressId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString())); } //ChkAdminLevel("order_list", TWEnums.ActionEnum.View.ToString()); //檢查許可權 ShowInfo(this.id); } }
protected void Page_Load(object sender, EventArgs e) { string _action = TWRequest.GetQueryString("action"); if (!string.IsNullOrEmpty(_action) && _action == TWEnums.ActionEnum.Edit.ToString()) { this.action = TWEnums.ActionEnum.Edit.ToString();//修改類型 if (!int.TryParse(Request.QueryString["id"] as string, out this.id)) { JscriptMsg("傳輸參數不正確!", "back"); return; } if (!new BLL.manager().Exists(this.id)) { JscriptMsg("記錄不存在或已被刪除!", "back"); return; } } if (!Page.IsPostBack) { //ChkAdminLevel("manager_list", TWEnums.ActionEnum.View.ToString()); //檢查許可權 Model.manager model = GetAdminInfo(); //取得管理員資料 RoleBind(ddlRoleId, model.role_type); if (action == TWEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
protected void Page_Load(object sender, EventArgs e) { this.channel_id = TWRequest.GetQueryInt("channel_id"); this.category_id = TWRequest.GetQueryInt("category_id"); this.keywords = TWRequest.GetQueryString("keywords"); this.property = TWRequest.GetQueryString("property"); this.goods_ids = TWRequest.GetQueryString("goods_ids"); if (channel_id == 0) { JscriptMsg("頻道參數不正確!", "back", "Error"); return; } this.channel_name = new BLL.channel().GetChannelName(this.channel_id); //取得頻道名稱 this.pageSize = GetPageSize(50); //每頁數量 if (!Page.IsPostBack) { ////ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.View.ToString()); //檢查權限 TreeBind(this.channel_id); //綁定類別 if (!string.IsNullOrEmpty(goods_ids)) { RptBind(this.channel_id, this.category_id, "id not in(" + goods_ids + ") and brand_id in(1,2,3,5) and yu_lock<1" + CombSqlTxt(this.keywords, this.property), "id desc"); } else { RptBind(this.channel_id, this.category_id, "brand_id in(1,2,3,5) and yu_lock<1" + CombSqlTxt(this.keywords, this.property), "id desc"); } } }
protected void Page_Load(object sender, EventArgs e) { tid = TWRequest.GetQueryInt("tid"); id = TWRequest.GetQueryInt("id"); DataSet ds = Tea.DBUtility.DbHelperSQL.Query("select * from shop_basic where basic_where='help' order by basic_sort"); data_type.DataSource = ds; data_type.DataBind(); if (tid == 0) { if (ds.Tables[0].Rows.Count > 0) { tid = Utils.StrToInt(ds.Tables[0].Rows[0]["basic_value"].ToString(), 0); } } if (tid > 0) { sql = "channel_id=1 and category_id=" + tid + " and status=0 and datediff(minute,add_time,getdate())>=0"; } if (id > 0) { sql = "id=" + id + ""; } data_list.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_about where " + sql + " order by sort_id desc,id desc"); data_list.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ChkAdminLevelEdit("user_list", "Edit"); this.channel_id = TWRequest.GetQueryInt("channel_id"); this.category_id = TWRequest.GetQueryInt("category_id"); this.keywords = TWRequest.GetQueryString("keywords"); this.property = TWRequest.GetQueryString("property"); this.goods_ids = TWRequest.GetQueryString("goods_ids"); if (channel_id == 0) { JscriptMsg("頻道參數不正確!", "back", "Error"); return; } this.channel_name = new Tea.BLL.channel().GetChannelName(this.channel_id); //取得頻道名稱 this.pageSize = GetPageSize(50); //每頁數量 if (!Page.IsPostBack) { TreeBind(this.channel_id); //綁定類別 if (!string.IsNullOrEmpty(goods_ids)) { RptBind(this.channel_id, this.category_id, "wheresql='tuan' and brand_id=1" + CombSqlTxt(this.keywords, this.property), "id desc"); } else { RptBind(this.channel_id, this.category_id, "wheresql='tuan' and brand_id=1" + CombSqlTxt(this.keywords, this.property), "id desc"); } } }
protected void Page_Load(object sender, EventArgs e) { id = TWRequest.GetQueryInt("id"); Tea.BLL.orders bll = new Tea.BLL.orders(); model = bll.GetModel(id); if (model.user_id != userModel.id) { Response.Redirect("order.aspx"); } try { area = model.area.Split(',')[1].ToString(); city = model.area.Split(',')[2].ToString(); } catch (Exception eee) { } payModel = new Tea.BLL.payment().GetModel(model.payment_id); if (payModel == null) { payModel = new Tea.Model.payment(); } data_cart.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_order_goods where order_id=" + id + ""); data_cart.DataBind(); data_gift.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from view_order_gift where order_id=" + id + ""); data_gift.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string _action = TWRequest.GetQueryString("action"); this.id = TWRequest.GetQueryInt("id"); if (!string.IsNullOrEmpty(_action) && _action == TWEnums.ActionEnum.Edit.ToString()) { this.action = TWEnums.ActionEnum.Edit.ToString();//修改類型 if (this.id == 0) { JscriptMsg("傳輸參數不正確!", "back"); return; } if (!new BLL.manager_role().Exists(this.id)) { JscriptMsg("角色不存在或已被刪除!", "back"); return; } } if (!Page.IsPostBack) { //ChkAdminLevel("manager_role", TWEnums.ActionEnum.View.ToString()); //檢查許可權 RoleTypeBind(); //綁定角色類型 NavBind(); //綁定導航 if (action == TWEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
protected void Page_Load(object sender, EventArgs e) { act = TWRequest.GetFormString("act"); if (act == "add") { string remember = TWRequest.GetFormString("txt_code"); if (Session[TWKeys.SESSION_CODE] == null) { Response.Write(ljd.function.LocalHint("系統找不到驗證碼", "")); return; } if (remember.ToLower() != Session[TWKeys.SESSION_CODE].ToString().ToLower()) { Response.Write(ljd.function.LocalHint("驗證碼輸入不正確", "")); return; } Tea.Model.feedback model = new Tea.Model.feedback(); model.title = TWRequest.GetFormString("txt_title"); model.user_tel = TWRequest.GetFormString("txt_tel"); model.user_name = TWRequest.GetFormString("txt_name"); model.user_email = TWRequest.GetFormString("txt_email"); model.content = TWRequest.GetFormString("txt_content"); model.company = 1; bll.Add(model); Response.Write(ljd.function.LocalHint("成功送出", "contact.aspx")); return; } }
protected void Page_Load(object sender, EventArgs e) { msg = Utils.ToHtml(TWRequest.GetQueryString("msg")); if (string.IsNullOrEmpty(msg)) { msg = "參數錯誤請返回!"; } }
protected void Page_Load(object sender, EventArgs e) { id = TWRequest.GetQueryInt("id", 1); if (id != 0) { model = bll.GetModel(id); } }
protected void Page_Load(object sender, EventArgs e) { id = TWRequest.GetQueryInt("id"); if (id != 0) { weburl = config.weburl; model = bll.GetModel(id); } }
protected void Page_Load(object sender, EventArgs e) { _users = new Tea.Web.UI.ShopPage().GetUserInfo(); data_type.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_article_category where channel_id=7 and call_index='1' order by sort_id desc"); data_type.DataBind(); key = TWRequest.GetQueryString("key"); this.page = TWRequest.GetQueryInt("page", 1); this.tid = TWRequest.GetQueryInt("tid", 0); this.hid = TWRequest.GetQueryInt("hid", 0); this.sort = TWRequest.GetQueryInt("sort", 0); if (sort == 1) { _orderby = "add_time desc,id desc"; } if (sort == 2) { _orderby = "click desc"; } if (sort == 3) { _orderby = "market_price,id"; } if (sort == 4) { _orderby = "market_price desc,id"; } if (tid != 0) { _sql = _sql + " and (category_id=" + tid + " or more_type like'%," + tid + ",%')"; tname = new Tea.BLL.article_category().GetTitle(tid); try { Tea.Model.article_category model = new Tea.BLL.article_category().GetModel(tid); title = model.seo_title; keyword = model.seo_keywords; describe = model.seo_description; } catch (Exception eee) { } } if (!string.IsNullOrEmpty(key)) { _sql = _sql + " and title like'%" + key + "%'"; tname = key; } Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage(); data_list.DataSource = bll_view.GetViewList("view_article_product", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount); data_list.DataBind(); string pageUrl = Utils.CombUrlTxt("index.aspx", "tid={0}&key={1}&sort={2}&page={3}", tid.ToString(), key.ToString(), sort.ToString(), "__id__"); PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoEdit(int _id) { bool result = false; BLL.users bll = new BLL.users(); Model.users model = bll.GetModel(_id); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.status = int.Parse(rblStatus.SelectedValue); //判斷密碼是否更改 if (txtPassword.Text.Trim() != defaultpassword) { //獲取用戶已生成的salt作為金鑰加密 model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt); } model.email = Utils.DropHTML(txtEmail.Text); model.nick_name = Utils.DropHTML(txtNickName.Text); model.avatar = Utils.DropHTML(txtAvatar.Text); model.sex = rblSex.SelectedValue; DateTime _birthday; if (DateTime.TryParse(txtBirthday.Text.Trim(), out _birthday)) { model.birthday = _birthday; } model.telphone = Utils.DropHTML(txtTelphone.Text.Trim()); model.mobile = Utils.DropHTML(txtMobile.Text.Trim()); model.address = Utils.DropHTML(txtAddress.Text.Trim()); model.amount = Utils.StrToDecimal(txtAmount.Text.Trim(), 0); model.point = Utils.StrToInt(txtPoint.Text.Trim(), 0); model.exp = Utils.StrToInt(txtExp.Text.Trim(), 0); if (TWRequest.GetFormString("txt_guo") == "台灣") { model.area = TWRequest.GetFormString("txt_guo") + "," + TWRequest.GetFormString("txt_state") + "," + TWRequest.GetFormString("txt_city"); } else { model.area = TWRequest.GetFormString("txt_guo") + "," + TWRequest.GetFormString("txt_state1") + "," + TWRequest.GetFormString("txt_city1"); } model.qq = TWRequest.GetFormString("txt_zip"); if (cbExp.Checked) { model.exp = 1; } else { model.exp = 0; } if (bll.Update(model)) { AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改使用者資料:" + model.user_name); //記錄日誌 result = true; } return(result); }
/// <summary> /// 增加管理日志 /// </summary> /// <param name="用户id"></param> /// <param name="用户名"></param> /// <param name="操作类型"></param> /// <param name="备注"></param> /// <returns></returns> public int Add(int user_id, string user_name, string action_type, string remark) { Model.manager_log manager_log_model = new Model.manager_log(); manager_log_model.user_id = user_id; manager_log_model.user_name = user_name; manager_log_model.action_type = action_type; manager_log_model.remark = remark; manager_log_model.user_ip = TWRequest.GetIP(); return(dal.Add(manager_log_model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(int user_id, string user_name, string remark) { Model.user_login_log model = new Model.user_login_log(); model.user_id = user_id; model.user_name = user_name; model.remark = remark; model.login_ip = TWRequest.GetIP(); model.login_time = DateTime.Now; return(dal.Add(model)); }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); if (!Page.IsPostBack) { //ChkAdminLevel("manager_role", TWEnums.ActionEnum.View.ToString()); //檢查許可權 Model.manager model = GetAdminInfo(); //取得當前管理員資訊 RptBind("role_type>=" + model.role_type + CombSqlTxt(this.keywords)); } }
private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby) { this.page = TWRequest.GetQueryInt("page", 1); if (this.category_id > 0) { this.ddlCategoryId.SelectedValue = _category_id.ToString(); } this.ddlProperty.SelectedValue = this.property; this.txtKeywords.Text = this.keywords; if (this.brand_id > 0) { this.ddlBrandId.SelectedValue = this.brand_id.ToString(); } if (sort > 0) { this.ddlSort.SelectedValue = this.sort.ToString(); if (sort == 1) { _orderby = "begin_time"; } if (sort == 2) { _orderby = "add_time"; } if (sort == 3) { _orderby = "id"; } } //圖表或清單顯示 Tea.Web.UI.ShopPage bll = new UI.ShopPage(); switch (this.prolistview) { case "Txt": this.rptList2.Visible = false; this.rptList1.DataSource = bll.GetViewList("view_article_product", "", this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList1.DataBind(); break; default: this.rptList1.Visible = false; this.rptList2.DataSource = bll.GetViewList("view_article_product", "", this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList2.DataBind(); break; } //綁定頁碼 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("tuan_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&brand_id={4}&page={5}&status={6}", _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, this.brand_id.ToString(), "__id__", status.ToString()); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); this.pageSize = GetPageSize(10); //每頁數量 if (!Page.IsPostBack) { //ChkAdminLevel("goods_gift", TWEnums.ActionEnum.View.ToString()); //檢查權限 RptBind("id>0" + CombSqlTxt(keywords), "sort_id desc,id desc"); } }
protected void Page_Load(object sender, EventArgs e) { id = TWRequest.GetQueryString("id"); string uploadPath = "/users/orders.xls"; string filePath = Server.MapPath(uploadPath); string fileExt = System.IO.Path.GetExtension(filePath); string conn = "", conn1 = ""; DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); if (fileExt == ".xls") { conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;IMEX=1'"; } OleDbConnection excelCon = new OleDbConnection(conn); OleDbDataAdapter odda = new OleDbDataAdapter("SELECT * FROM [orders$] where OrderNumber='" + id + "'", excelCon); OleDbConnection excelCon1 = new OleDbConnection(conn); OleDbDataAdapter odda1 = new OleDbDataAdapter("SELECT * FROM [orderslist$] where OrderNumber='" + id + "' and Num>0", excelCon1); try { odda.Fill(dt); data_list.DataSource = dt; data_list.DataBind(); data_list1.DataSource = dt; data_list1.DataBind(); } catch (Exception ex) { } finally { excelCon.Close(); excelCon.Dispose(); } try { odda1.Fill(dt1); data_cart.DataSource = dt1; data_cart.DataBind(); } catch (Exception ex) { } finally { excelCon.Close(); excelCon.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); this.begin = TWRequest.GetQueryString("begin"); this.end = TWRequest.GetQueryString("end"); if (!Page.IsPostBack) { RptBind(); } }
protected void bu_no_Click(object sender, EventArgs e) { id = TWRequest.GetQueryInt("id"); ChkAdminLevelEdit("order_list", "Edit"); string order_bao = chang.Text.Trim() + "|" + kuan.Text.Trim() + "|" + gao.Text.Trim() + "|" + txtzhong.Text.Trim(); new Tea.BLL.orders().UpdateField(id, "express_no='" + express_no.Text.Trim() + "',order_bao='" + order_bao + "',express_id=" + ddlExpressId.SelectedValue + ""); Response.Write(ljd.function.LocalHint("成功送出", "order_edit.aspx?action=Edit&id=" + id)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); this.pageSize = GetPageSize(10); //每頁數量 if (!Page.IsPostBack) { //ChkAdminLevel("manager_log", TWEnums.ActionEnum.View.ToString()); //檢查許可權 model = GetAdminInfo(); //取得當前管理員資訊 RptBind("id>0" + CombSqlTxt(keywords), "add_time desc,id desc"); } }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); this.pageSize = GetPageSize(50); //每頁數量 if (!Page.IsPostBack) { //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.View.ToString()); //檢查權限 RptBind("basic_where='help'" + CombSqlTxt(this.keywords), "basic_id asc"); } }
protected void Page_Load(object sender, EventArgs e) { this.keywords = TWRequest.GetQueryString("keywords"); this.begin = TWRequest.GetQueryString("begin"); this.end = TWRequest.GetQueryString("end"); this.pageSize = GetPageSize(50); //每頁數量 if (!Page.IsPostBack) { //ChkAdminLevel("order_list", TWEnums.ActionEnum.View.ToString()); //檢查權限 RptBind("id>0" + CombSqlTxt(this.status, this.payment_status, this.express_status, this.keywords, data, begin, end, peisong), "id desc"); } }
protected void Page_Load(object sender, EventArgs e) { id = TWRequest.GetQueryInt("id"); if (id != 0) { weburl = config.weburl; weburl = Utils.DelLastChar(weburl, "/"); model = bll.GetModel(id); data_cart.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_order_goods where order_id=" + id + ""); data_cart.DataBind(); } }
private void RptBind(string _strWhere, string _orderby) { this.page = TWRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.basic bll = new BLL.basic(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //綁定頁碼 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void Initialize() { Style = UITableViewStyle.Plain; string url = "https://api.twitter.com/1/statuses/public_timeline.xml"; TWRequest request = new TWRequest(new NSUrl("https://api.twitter.com/1/statuses/friends_timeline.xml"), null, TWRequestMethod.Get); request.Account = TwitterAccount.twitterAccount; request.PerformRequest((responseData, urlResponse, error) => { Root = new RootElement("Timeline"); XmlDocument doc = new XmlDocument(); doc.LoadXml(responseData.ToString()); Section timeline = new Section("Timeline"); foreach (XmlNode node in doc.DocumentElement.ChildNodes) timeline.Add (new TweetElement(new Tweet(node))); Root.Add (timeline); this.ReloadData(); }); }
public TwitterRequest (string method, Uri url, IDictionary<string, string> paramters, Account account) : base (method, url, paramters, account) { var ps = new NSMutableDictionary (); if (paramters != null) { foreach (var p in paramters) { ps.SetValueForKey (new NSString (p.Value), new NSString (p.Key)); } } var m = TWRequestMethod.Get; switch (method.ToLowerInvariant()) { case "get": m = TWRequestMethod.Get; break; case "post": m = TWRequestMethod.Post; break; case "delete": m = TWRequestMethod.Delete; break; default: throw new NotSupportedException ("Twitter does not support the HTTP method '" + method + "'"); } request = new TWRequest (new NSUrl (url.AbsoluteUri), ps, m); Account = account; }