protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindTerminalGroup(this.ddlGroups); } }
protected void ddlGroups_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddlGroups.SelectedIndex != 0) { GobalTools.BindTerminalByGroup(this.ddlTerminals, this.ddlGroups.SelectedValue.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindCity(this.ddlCity); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sql = "select id,name,ip,mac,'' as status from terminals"; DataTable dt = GobalTools.Select(sql); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string ip = dt.Rows[i]["ip"].ToString(); if (FT.Commons.Tools.WindowExHelper.CanConnectionTo(ip)) { dt.Rows[i]["status"] = "在线"; } else { dt.Rows[i]["status"] = "下线"; } } this.GridView1.DataSource = dt; this.GridView1.DataBind(); } } }
protected void btnSend_Click(object sender, EventArgs e) { string mobile = this.txtMobile.Text.Trim(); string content = this.txtContent.Text.Trim(); if (mobile.Length != 11) { this.lbSend.Text = "手机号码长度不为11位,无法发送,请重新输入!"; return; } if (content.Length == 0) { this.lbSend.Text = "发送内容不能为空,无法发送,请重新输入!"; return; } bool result = GobalTools.SendSmsByWebService(mobile, content); if (result) { this.lbSend.Text = "发送成功!"; return; } else { this.lbSend.Text = "发送失败,请检查网络和短信服务器是否能联通!"; return; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindProduct(this.ddlProducts); } }
public string GetPrintHeaders() { TerminalStatus terminal = GobalTools.GetTerminal(); string result = string.Empty; result += GobalTools.GetTerminalOrderId(terminal.StorePrefix); result += ";" + terminal.StoreNo + ";" + terminal.StoreName + ";" + terminal.StorePhone; return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindTerminalGroup(this.ddlGroups); GobalTools.InitDDl(this.ddlTerminals); this.txtBeginDate.Value = DateTimeHelper.DtToLongString(System.DateTime.Now); this.txtEndDate.Value = DateTimeHelper.DtToLongString(System.DateTime.Now); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //this.txtMobile.Attributes["onclick"] = "javascript:showKeyboard(this);"; this.txtValidCode.Attributes["onclick"] = "javascript:showKeyboard(this);"; this.txtValidCode.Style.Add("line-height", "73px"); string productid = Session["seeproductid"].ToString(); Session["orderid"] = GobalTools.GetTerminalOrderId(); string num = Request.Params["ordernum"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindCity(this.cbCityCodeValue); if (Request.Params["id"] != null) { TrafficLimitInfoEntity entity = SimpleOrmOperator.Query <TrafficLimitInfoEntity>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); } else { } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindProduct(this.cbProductIdValue); if (Request.Params["id"] != null) { ProductDiscountInfo entity = SimpleOrmOperator.Query <ProductDiscountInfo>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); this.txtBeginDate.Value = DateTimeHelper.DtToLongString(entity.StartDate); this.txtEndDate.Value = DateTimeHelper.DtToLongString(entity.EndDate); } else { this.txtBeginDate.Value = DateTimeHelper.DtToLongString(System.DateTime.Now); this.txtEndDate.Value = DateTimeHelper.DtToLongString(System.DateTime.Now); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindCity(this.cbCityCodeValue); if (Request.Params["id"] != null) { TrafficLimitExtendInfoEntity entity = SimpleOrmOperator.Query<TrafficLimitExtendInfoEntity>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); this.txtStartDateShow.Value = DateTimeHelper.DtToShortString(entity.StartDate); this.txtEndDateShow.Value = DateTimeHelper.DtToShortString(entity.EndDate); } else { this.txtStartDateShow.Value = DateTimeHelper.DtToShortString(System.DateTime.Now); this.txtEndDateShow.Value = DateTimeHelper.DtToShortString(System.DateTime.Now); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GobalTools.BindCity(this.cbCityCodeValue); GobalTools.BindTerminalGroup(this.cbMachineGroupIdValue); if (Request.Params["id"] != null) { TerminalEntity entity = SimpleOrmOperator.Query <TerminalEntity>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); this.lbLastOnlineTime.Text = DateTimeHelper.DtToLongString(entity.LastOnlineTime); this.lbLastOutlineTime.Text = DateTimeHelper.DtToLongString(entity.LastOutlineTime); this.lbCurrentStatus.ForeColor = Color.Red; this.lbCurrentStatus.Text = string.Format("({0})", FT.Commons.Tools.WindowExHelper.CanConnectionTo(entity.MachineIp)?"在线":"不在线"); } else { } } }
protected void Page_Load(object sender, EventArgs e) { object mobile = Request.Params["mobile"]; //object valid=Request.Params["valid"]; Response.Expires = -1; Response.Clear(); Response.ContentEncoding = Encoding.UTF8; Response.ContentType = "application/json"; if (mobile != null) { // Session["orderid"] //System.Threading.Thread.Sleep(1000); //GobalTools.SendValidSms(mobile.ToString()); if (GobalTools.SendValidSms(mobile.ToString(), Session["orderid"].ToString())) { Response.Write("{\"result\":\"Success\"}"); } else { // Response.Write("{\"result\":\"Success\"}"); Response.Write("{\"result\":\"Fail\"}"); } /* * Response.Write("{\"result\":\"Success\"}"); * * */ } else { Response.Write("{\"result\":\"Fail\"}"); } Response.Flush(); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.Label1.Text = string.Empty; this.Label2.Text = string.Empty; GobalTools.BindProductType(this.cbProductTypeIdValue); if (Request.Params["id"] != null) { ProductInfo entity = SimpleOrmOperator.Query <ProductInfo>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); this.CKEditorControl1.Text = System.Web.HttpUtility.HtmlDecode(entity.Production); ViewState["imgstr"] = entity.Imgs; ViewState["imgmain"] = entity.ImgMain; } else { ViewState["imgstr"] = ";"; ViewState["imgmain"] = string.Empty; } } this.RefreshImgs(); }
protected void repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "buyAndPrint") { } else if (e.CommandName == "addToStore") { DataTable dt = GobalTools.Select("select * from yuantuo_product_info where id=" + Request.Params["id"] + ""); object obj = Session["Store"]; if (obj == null) { Session["Store"] = dt; } else { DataTable dt2 = Session["Store"] as DataTable; dt.Merge(dt2); Session["Store"] = dt; } Label lb = e.Item.FindControl("lbMsg") as Label; // lb.Text = "加入购物车成功,共"+dt.Rows.Count+"件商品"; } }
protected void Button1_Click(object sender, EventArgs e) { string mm = GobalTools.GetTerminalOrderId("AE"); string ttt = string.Empty; }
protected void btnSure_Click(object sender, EventArgs e) { if (this.txtValidCode.Text.Trim().Length == 4) { bool result = GobalTools.IsRight(this.txtValidCode.Text.Trim()); if (result) { string ordersqlFormat = @" INSERT INTO yuantuo_terminal_orders (orderid ,productid ,product ,num ,singleprice ,terminalid ,totalprice ,isadd ,mobile,orderdate) VALUES ('{0}',{1},'{2}',{3},{4},{5},{6},{7},'{8}','{9}') "; FT.DAL.IDataAccess access = FT.DAL.DataAccessFactory.GetDataAccess(); int fontsize = 9; int lineheight = 15; // int left = 15; int left = 1; string script = string.Empty; string domain = Request.Url.ToString(); // nowUrl.in // domain = domain.Substring(domain.IndexOf(":") + 3);//http://之后的 domain = domain.Substring(0, domain.IndexOf("/YuanTuo")); //string urlPrefix = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.IndexOf('/', 0, 3)); // string logo = Page.ResolveUrl("~/YuanTuo/images/yijielogo.bmp"); string logo = domain + "/YuanTuo/images/yijielogo.bmp"; // string logo="http://127.0.0.1:12345/BuyWebSiteDemo/YuanTuo/images/yijielogo.bmp"; string orderid = Session["orderid"].ToString(); TerminalStatus terminal = GobalTools.GetTerminal(); string mobile = this.txtMobile.Value; StringBuilder productcontent = new StringBuilder(); string productid = Session["seeproductid"].ToString(); ProductInfo entity = SimpleOrmOperator.Query <ProductInfo>(Convert.ToInt32(productid)); int num = Convert.ToInt32(Request.Params["ordernum"].ToString()); double price = Convert.ToDouble(Request.Params["price"].ToString()); string sendSql = "select top 1 productid,b.name as productname,b.no,sendproductid,num from yuantuo_product_send a left join yuantuo_product_info b on b.id=a.sendproductid where getdate() between startdate and enddate and productid=" + entity.Id.ToString() + " order by enddate desc"; DataTable dt = access.SelectDataTable(sendSql, "tmp"); string sendPrintContent = string.Empty; string orderdate = DateTimeHelper.DtToLongString(System.DateTime.Now); if (dt != null && dt.Rows.Count == 1) { int sendproductid = Convert.ToInt32(dt.Rows[0]["sendproductid"].ToString()); int sendnumpre = Convert.ToInt32(dt.Rows[0]["num"].ToString()); string sendno = dt.Rows[0]["no"].ToString(); string sendname = dt.Rows[0]["productname"].ToString(); if (num > sendnumpre) { int sendnum = num / sendnumpre; access.ExecuteSql(string.Format(ordersqlFormat , orderid, sendproductid, sendname, sendnum, 0, terminal.Id, 0, 1, mobile, orderdate ).Replace("\r\n", "")); // " obj.AddContent('04012 78 77','宋体',font,left,height);"; sendPrintContent = "height+=lineHeight;obj.AddContent('" + sendname + "(赠品)','宋体'," + fontsize.ToString() + ",left,height);height+=lineHeight;obj.AddContent('" + sendno + " " + sendnum + " " + "0" + "','宋体'," + fontsize.ToString() + ",left,height);"; } } access.ExecuteSql(string.Format(ordersqlFormat , orderid, entity.Id, entity.Name, num, price, terminal.Id, price * num, 0, mobile, orderdate ).Replace("\r\n", "")); /* * height+=lineHeight; * obj.AddContent('汽车台座专用香氛50(ml)','宋体',10,left,height); * height+=lineHeight; * obj.AddContent('04011 856 78','宋体',10,left,height); * height+=lineHeight; * obj.AddContent('金额合计:66,768.00','宋体',10,left,height); */ productcontent.Append("height+=lineHeight;"); productcontent.Append("obj.AddContent('" + entity.Name + "','宋体'," + fontsize.ToString() + ",left,height);"); productcontent.Append("height+=lineHeight;"); productcontent.Append("obj.AddContent('" + entity.No + " " + num + " " + price + "','宋体'," + fontsize.ToString() + ",left,height);"); productcontent.Append(sendPrintContent); productcontent.Append("height+=lineHeight;"); productcontent.Append("obj.AddContent('金额合计:" + string.Format("{0:N2}", price * num) + "','黑体'," + 10.ToString() + ",left,height);"); //80mm /* script = string.Format(printScriptFormatter * ,logo,orderid,terminal.StoreNo,terminal.StoreName,terminal.StorePhone * , mobile, productcontent.ToString(), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") * ,Page.ResolveUrl("~/YuanTuo/Index.aspx") * ,entity.GetProductDays.ToString() * , fontsize, left,lineheight,fontsize+2,entity.GetProductDays+4 * ); * */ script = string.Format(printScriptFormatter58 , logo, orderid, terminal.StoreNo, terminal.StoreName, terminal.StorePhone , mobile, productcontent.ToString(), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") , Page.ResolveUrl("~/YuanTuo/Index.aspx") , entity.GetProductDays.ToString() , fontsize, left, lineheight, fontsize + 2, entity.GetProductDays + 4 ); ClientScript.RegisterStartupScript(this.GetType(), "tmp", script); } else { ClientScript.RegisterStartupScript(this.GetType(), "tmp", "<script type='text/javascript'>setValidError();</script>"); } } }
protected void Button1_Click(object sender, EventArgs e) { GobalTools.SendValidSms("15814584509", "123021321AE"); }