private void MyBind() { if (Mid > 0) { apiMod = apiBll.SelReturnModel(Mid); Alias_T.Text = apiMod.Alias; APPKey_T.Text = apiMod.APPKey; APPSecret_T.Text = apiMod.APPSecret; } }
protected void Push_Btn_Click(object sender, EventArgs e) { M_Mobile_PushAPI apiMod = apiBll.SelReturnModel(Convert.ToInt32(APPList_DP.SelectedValue)); C_JPush jpush = new C_JPush(apiMod); M_Mobile_PushMsg msgMod = new M_Mobile_PushMsg(); msgMod.MsgContent = MsgContent_T.Text.Trim(); msgMod.MsgType = "手动发送"; msgMod.PushPlat = 1; msgMod.PushType = Request.Form["pushtype_rad"]; msgMod.Result = jpush.SendPush(msgMod).ToString(); msgBll.Insert(msgMod); function.WriteSuccessMsg("发送完成", "Default.aspx"); }
protected void Save_Btn_Click(object sender, EventArgs e) { if (Mid > 0) { apiMod = apiBll.SelReturnModel(Mid); } apiMod.Alias = Alias_T.Text; apiMod.APPKey = APPKey_T.Text.Replace(" ", ""); apiMod.APPSecret = APPSecret_T.Text.Replace(" ", ""); apiMod.Plat = 1; if (Mid > 0) { apiBll.UpdateByID(apiMod); } else { apiBll.Insert(apiMod); } function.WriteSuccessMsg("操作成功", "APIList.aspx"); }
//public static List<M_Mobile_PushAPI> APIList = new List<M_Mobile_PushAPI>(); //public static M_Mobile_PushAPI GetAPI(int id) //{ //} public C_JPush(M_Mobile_PushAPI apiMod) { app_key = apiMod.APPKey; master_secret = apiMod.APPSecret; client = new JPushClient(app_key, master_secret); }