/// <summary> /// Handles the ItemCommand event of the rLocations control. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.RepeaterCommandEventArgs"/> instance containing the event data.</param> protected void rLocations_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { int?locationId = (e.CommandArgument as string).AsIntegerOrNull(); if (locationId.HasValue) { var rockContext = new RockContext(); var location = new LocationService(rockContext).Get(locationId.Value); if (location != null) { if (e.CommandName == "Open" && !location.IsActive) { location.IsActive = true; rockContext.SaveChanges(); } else if (e.CommandName == "Close" && location.IsActive) { location.IsActive = false; rockContext.SaveChanges(); } // flush the current kiosk ( the kiosk only caches groups, etc for active locations, so we need to flush anytime a location is opened/closed ) if (this.CurrentKioskId.HasValue) { KioskDevice.Flush(this.CurrentKioskId.Value); } } BindManagerLocationsGrid(); } }
protected void RptGrantGrid_ItemCommand(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName != "") { ClearHDN(); HdnProjectId.Value = e.CommandArgument.ToString(); if (e.CommandName.ToLower() == "cmddelete" | e.CommandName.ToLower() == "cmdedit" | e.CommandName.ToLower() == "cmdview" | e.CommandName.ToLower() == "cmdadd") { HdnMode.Value = e.CommandName.ToString().ConverMode(); ShowPanel("entry"); bool enabled = (e.CommandName.ToString().ConverMode().ToLower() == "delete" || e.CommandName.ToString().ConverMode().ToLower() == "view") ? false : true; if (HdnMode.Value.ToLower() == "insert") { // FillProjectDataForNewEntry(); } else { HdnGranDId.Value = e.CommandArgument.ToString(); // FillControl(); } } } } catch (Exception ex) { this.MsgBox(ex.Message.ToString()); } }
public bool ValidateData(string strLabourType, RepeaterCommandEventArgs e) { string strQuery = ""; if (strLabourType == "") { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "javascript:AlertMsg('Labour Type can not be left blank.');", true); return false; } else { if (e.CommandName.ToUpper() == "UPDATE") strQuery = "Select Count(Lbr_type_id) From tbl_Lbr_Type Where Lbr_type_id<>" + Convert.ToInt32(Keys[e.Item.ItemIndex]) + " And Lbr_Type='" + strLabourType + "'"; else if (e.CommandName.ToUpper() == "INSERT") strQuery = "Select Count(Lbr_type_id) From tbl_Lbr_Type Where Lbr_Type='" + strLabourType + "'"; int Lbr_Type_ID = (int)CrystalConnection.SqlScalartoObj(strQuery); if (Lbr_Type_ID > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "javascript:AlertMsg('Labour type already exist.');", true); return false; } } return true; }
protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e) { var cArg = e.CommandArgument.ToString(); var param = new string[3]; switch (e.CommandName.ToLower()) { case "save": Update(); param[0] = "ctrl=settings"; Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "removelogo": var settings = ModCtrl.GetByGuidKey(PortalSettings.Current.PortalId, 0, "SETTINGS", "NBrightBuySettings"); if (settings != null && settings.GetXmlProperty("genxml/hidden/hidemaillogo") != "") { settings.SetXmlProperty("genxml/hidden/hidemaillogo", ""); settings.SetXmlProperty("genxml/hidden/emaillogourl", ""); settings.SetXmlProperty("genxml/hidden/emaillogopath", ""); ModCtrl.Update(settings); } param[0] = ""; Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "cancel": param[0] = ""; Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; } }
private void grdProducts_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "Delete" && ProductHelper.RemoveProduct(e.CommandArgument.ToString()) > 0) { try { this.myNotifier.updateAction = UpdateAction.ProductUpdate; this.myNotifier.actionDesc = "单个删除商品"; this.myNotifier.RecDateUpdate = System.DateTime.Today; this.myNotifier.DataUpdated += new StatisticNotifier.DataUpdatedEventHandler(this.myEvent.Update); this.myNotifier.UpdateDB(); } catch (System.Exception) { } this.ShowMsg("删除商品成功", true); this.ReloadProductOnSales(false); } if (e.CommandName == "UnSaleProduct") { int num = ProductHelper.OffShelf(e.CommandArgument.ToString()); if (num > 0) { this.ShowMsg("成功下架了选择的商品,您可以在下架区的商品里面找到下架以后的商品", true); this.BindProducts(); return; } this.ShowMsg("下架商品失败,未知错误", false); } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { Label1.Visible = true; lbthongbao.Visible = false; idchucvu = e.CommandArgument.ToString(); cv = appcv.Single(Libs.LibConvert.ConvertToInt(idchucvu,1)); idAn.Value = idchucvu; if (e.CommandName.CompareTo("Xoa") == 0) { int i = appcv.Delete(Libs.LibConvert.ConvertToInt(idchucvu,1)); if (i == 1) Label1.Text = "Xóa thành công chức vụ"; else Label1.Text = "Không xóa được chức vụ"; LoadDS(); } else if (e.CommandName.CompareTo("Sua") == 0) { txtmota.Text = cv.MoTa; txttenchucvu.Text = cv.TenCV; btncapnhat.Visible = true; btnThem.Visible = false; } }
protected void rptShortlistedSelect_ItemCommand(object source, RepeaterCommandEventArgs e) { String vacancyNumber = e.CommandArgument.ToString(); Session["vacancyNumber"] = vacancyNumber; setFeedback("Vacancy '"+vacancyNumber+"' is now selected."); }
protected void request_layout_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "accept") { //String name = ((Label)e.Item.FindControl("username")).Text; //Response.Write("<script>console.log('" + name + "')</script>"); String email = ((Label)e.Item.FindControl("email")).Text.Substring(7); String dt = ((Label)e.Item.FindControl("date_time")).Text; cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.Text; String query = "update donation set status = 'true', ngoemail = '" + Request.Cookies["user"]["email"] + "', ngoname = '" + Request.Cookies["user"]["username"] + "',ngocontact = '" + Request.Cookies["user"]["mobile"] + "',acceptTime = '" + DateTime.Now.ToString() + "' where email like '" + email + "' and datetime like '" + dt + "'"; cmd.CommandText = query; if (cmd.ExecuteNonQuery() > 0) { Response.Write("<script>alert('Request Accepted Successfully<br>Take your delivery within 2 hrs')</script>"); Response.Redirect("ngoprofile.aspx"); } else { Response.Write("<script>console.log(" + "\"" + query + "\"" + ")</script>"); Response.Write("<script>alert('Request Failed to Submit')</script>"); } } }
private void grdProducts_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "MoveProduct") { object commandArgument = e.CommandArgument; if (!string.IsNullOrEmpty(commandArgument.ToString())) { bool flag = LimitedTimeDiscountHelper.DeleteDiscountProduct(commandArgument.ToString()); if (flag) { this.ShowMsgAndReUrl("移除成功", true, "LimitedTimeDiscountProduct.aspx?id=" + Globals.RequestQueryNum("id")); } } } if (e.CommandName == "Stop") { int num = 0; if (int.TryParse(e.CommandArgument.ToString(), out num)) { LimitedTimeDiscountProductInfo discountProductInfoById = LimitedTimeDiscountHelper.GetDiscountProductInfoById(num); int status = (discountProductInfoById.Status == 3) ? 1 : 3; if (!string.IsNullOrEmpty(num.ToString())) { bool flag2 = LimitedTimeDiscountHelper.ChangeDiscountProductStatus(num.ToString(), status); if (flag2) { this.ShowMsgAndReUrl("状态修改成功", true, "LimitedTimeDiscountProduct.aspx?id=" + Globals.RequestQueryNum("id")); } } } } }
private void Poll_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "vote" && ForumVoteAccess) { string cookie = String.Format("poll#{0}#{1}", topic["PollID"], PageUserID); if (Request.Cookies[cookie] != null) { AddLoadMessage(GetText("WARN_ALREADY_VOTED")); return; } if (((int)topic["Flags"] & (int)TopicFlags.Locked) == (int)TopicFlags.Locked) { AddLoadMessage(GetText("WARN_TOPIC_LOCKED")); return; } DB.choice_vote(e.CommandArgument); HttpCookie c = new HttpCookie(cookie, e.CommandArgument.ToString()); c.Expires = DateTime.Now.AddYears(1); Response.Cookies.Add(c); AddLoadMessage(GetText("INFO_VOTED")); BindData(); } }
private void repInspectItems_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { try { int InspectItemId; if (e.CommandName == "SetRepairStatus" || e.CommandName == "SetReplaceStatus") { SaveChangedItems(); InspectItemId = Convert.ToInt32(e.CommandArgument.ToString()); if (e.CommandName == "SetRepairStatus") { Response.Redirect("wo_updateRepair.aspx?mode=Add&repairid=0&inspectid=" + InspectId.ToString() + "&type=II&op=Repair&id=" + OrderId.ToString() + "&itemid=" + InspectItemId.ToString(), false); } else { Response.Redirect("wo_updateRepair.aspx?mode=Add&repairid=0&inspectid=" + InspectId.ToString() + "&type=II&op=Replace&id=" + OrderId.ToString() + "&itemid=" + InspectItemId.ToString(), false); } } } catch (Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = "wo_viewCompleteInspection.aspx?id=" + OrderId.ToString() + "&inspectid=" + InspectId.ToString(); Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } }
private void reDistributor_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "Frozen") { if (!DistributorsBrower.FrozenCommision(int.Parse(e.CommandArgument.ToString()), "1")) { this.ShowMsg("冻结失败", false); return; } this.ShowMsg("冻结成功", true); this.ReBind(true); } if (e.CommandName == "Thaw") { if (!DistributorsBrower.FrozenCommision(int.Parse(e.CommandArgument.ToString()), "0")) { this.ShowMsg("解冻失败", false); return; } this.ShowMsg("解冻成功", true); this.ReBind(true); } if (e.CommandName == "Forbidden") { if (DistributorsBrower.FrozenCommision(int.Parse(e.CommandArgument.ToString()), "9")) { this.ShowMsg("取消资质成功!", true); this.ReBind(true); return; } this.ShowMsg("取消资质失败", false); } }
private void repOperators_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { try { if (e.CommandName == "Select") { UserId = Convert.ToInt32(e.CommandArgument); ViewState["TempOpId"] = UserId; lblNewTempOperator.Text = ((Label)e.Item.FindControl("lblLastName")).Text + ", " + ((Label)e.Item.FindControl("lblFirstName")).Text; pnlVerifyOperator.Visible = true; pnlSelectOperator.Visible = false; } } catch (Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = "e_selectTempOperator.aspx?id=" + EquipId.ToString(); Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if (equip != null) { equip.Dispose(); } } }
public void rptLetterList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { SetLinkArgument((string)e.CommandArgument); phReport.Visible = true; ResetRepeaters(); }
protected void dataList_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "detail": { this.PageEngine.OpenWindow<string, string>("role-detail.aspx", "role-detail", "width=600,height=278,resizeable=no", e.CommandArgument.ToString(), this.Bind); break; } case "delete": { this.PageEngine.ShowConfirmBox<string>("确认删除吗", this.Delete, this.Cancel, e.CommandArgument.ToString()); break; } case "config": { this.PageEngine.OpenWindow<string, string>("role-operation.aspx", "role-operation", "width=600,height=520,resizeable=no", e.CommandArgument.ToString(), this.Bind); break; } case "mutex": { this.PageEngine.ShowMessageBox("暂不公开"); break; } } }
protected void rpWorks_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { try { if (e.CommandName == "EDT") { hdnWorkId.Value = e.CommandArgument.ToString(); db.AddParameter("@work_id", e.CommandArgument.ToString()); db.AddParameter("@blog_id", ConfigurationManager.AppSettings["BlogId"].ToString()); DataSet ds = db.ExecuteDataSet("get_works", CommandType.StoredProcedure); txtDesc.Text = ds.Tables[0].Rows[0]["work_desc"].ToString(); txtTitle.Text = ds.Tables[0].Rows[0]["work_title"].ToString(); txtUrl.Text = ds.Tables[0].Rows[0]["work_url"].ToString(); hdnFileUpload.Value = ds.Tables[0].Rows[0]["work_image_name"].ToString(); } else if (e.CommandName == "DEL") { db.AddParameter("@work_id", e.CommandArgument.ToString()); db.AddParameter("@blog_id", ConfigurationManager.AppSettings["BlogId"].ToString()); db.ExecuteNonQuery("update works set active=0 where work_id=@work_id and blog_id=@blog_id", CommandType.Text); FillRp(); lblErrorMsg.Text = "Work Deleted Successfully."; } } catch (Exception ex) { lblErrorMsg.Text = ex.Message.ToString(); } }
protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "DeleteCagetory") { int categoryId = Globals.ToNum(e.CommandArgument.ToString()); if (!CatalogHelper.IsExitProduct(categoryId.ToString())) { if (CatalogHelper.DeleteCategory(categoryId)) { HiCache.Remove("DataCache-Categories"); HiCache.Remove("DataCache-CategoryList"); this.ShowMsg("成功删除了指定的分类", true); } else { this.ShowMsg("分类删除失败,未知错误", false); } } else { this.ShowMsg("分类下有商品,请先删除商品再到商品回收站彻底删除。", false); } } this.BindData(); }
private void reFriend_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "Del") { if (ProductCommentHelper.DeleteFriendExtension(int.Parse(e.CommandArgument.ToString())) > 0) { this.BindData(); this.ShowMsg("删除成功", true); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("Literal1"); string text = literal.Text; if (!string.IsNullOrEmpty(text)) { string[] array = text.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { string str2 = array[i]; string path = str2; path = base.Server.MapPath(path); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } } } } else { this.ShowMsg("删除失败", false); } } }
public void UserList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { switch (e.CommandName) { case "edit": YAF.Classes.Utils.YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.admin_edituser, "u={0}", e.CommandArgument); break; case "delete": UserMembershipHelper.DeleteUser(Convert.ToInt32(e.CommandArgument)); BindData(); break; case "approve": UserMembershipHelper.ApproveUser(Convert.ToInt32(e.CommandArgument)); BindData(); break; case "deleteall": UserMembershipHelper.DeleteAllUnapproved(DateTime.Now.AddDays(-14)); //YAF.Classes.Data.DB.user_deleteold( PageContext.PageBoardID ); BindData(); break; case "approveall": UserMembershipHelper.ApproveAll(); //YAF.Classes.Data.DB.user_approveall( PageContext.PageBoardID ); BindData(); break; } }
private void repEquipments_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { try { if (e.CommandName == "Select") { ViewState["SelectedWorkOrderId"] = e.CommandArgument.ToString(); pnlNoneEquipment.Visible = false; pnlManyEquipment.Visible = false; pnlOneEquipment.Visible = true; lblEquipId.Text = ((LinkButton)e.Item.FindControl("lbEquipId")).Text; lblEquipType.Text = ((Label)e.Item.FindControl("lbEquipType")).Text; } } catch (Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = "ok_selectWorkOrder.aspx"; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { } }
protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e) { var cArg = e.CommandArgument.ToString(); var param = new string[3]; switch (e.CommandName.ToLower()) { case "addnew": var groupData = new GroupData(-1, EditLanguage); Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "delete": if (Utils.IsNumeric(cArg)) { ModCtrl.Delete(Convert.ToInt32(cArg)); } Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "saveall": SaveAll(); NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + "save", NotifyCode.ok); NBrightBuyUtils.RemoveModCache(-1); //clear any cache Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "move": if (Utils.IsNumeric(cArg)) { MoveRecord(Convert.ToInt32(cArg)); } Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; } }
/// <summary> /// Handles single record commands in a repeater. /// </summary> private void List_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { // what command are we serving? switch (e.CommandName) { // delete log entry case "delete": // delete just this particular log entry YAF.Classes.Data.DB.eventlog_delete(e.CommandArgument); // re-bind controls BindData(); break; // show/hide log entry details case "show": // get details control Control ctl = e.Item.FindControl("details"); // find link button control LinkButton showbutton = e.Item.FindControl("showbutton") as LinkButton; // invert visibility ctl.Visible = !ctl.Visible; // change visibility state of detail and label of linkbutton too showbutton.Text = (ctl.Visible) ? "Hide" : "Show"; break; } }
protected void rptPages_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { LinkButton btnPage = (LinkButton)e.Item.FindControl("btnPage"); PageNumber = int.Parse(btnPage.Text); BindList(); }
protected void shoppingCartPromoGiftList_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName.Equals("change")) { int num = System.Convert.ToInt32(e.CommandArgument.ToString()); if (num > 0) { ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart(); if (shoppingCart != null && shoppingCart.LineGifts != null && shoppingCart.LineGifts.Count > 0) { foreach (ShoppingCartGiftInfo current in shoppingCart.LineGifts) { if (current.GiftId == num) { this.ShowMessage("购物车中已存在该礼品,请删除购物车中已有的礼品或者下次兑换!", false); return; } } } int giftItemQuantity = ShoppingCartProcessor.GetGiftItemQuantity(PromoteType.SentGift); if (this.shoppingCartPromoGiftList.SumNum > giftItemQuantity) { ShoppingCartProcessor.AddGiftItem(num, 1, PromoteType.SentGift); this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("shoppingCart"), true); return; } this.ShowMessage("礼品兑换失败,您不能超过最多兑换数", false); } } }
protected void rpResult_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "use") { Use(Utility.GetInt(e.CommandArgument, -1)); } }
private void RepeaterProduct_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { CatalogAction action = new CatalogAction(Context); action.ShowItemsByProduct(e.CommandArgument.ToString()); this.CurrentController.NextView = action.NextViewToDisplay; }
private void RulesRepeater_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { new Filter().DeleteRule(int.Parse(e.CommandArgument.ToString())); MessageLabel.Visible = true; ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("FilterRuleDeletedMessage")); BindFields(); }
protected void RepeaterTree_ItemCommand(object source, RepeaterCommandEventArgs e) { if(string.Compare(e.CommandName, "Delete", true) == 0) { if (ProductClassManage.Delete(Convert.ToInt32(e.CommandArgument))) { this.lblErrDelete.Visible = false; } else { this.lblErrDelete.Visible = true; } this.RepeaterTree.DataBind(); } if (string.Compare(e.CommandName, "Edit", true) == 0) { ViewState["pc_id"] = Convert.ToInt32(e.CommandArgument); ProductClass myProductClass = ProductClassManage.GetItem(Convert.ToInt32(ViewState["pc_id"])); ViewState["pc_name"] = myProductClass.PC_Name; this.Panel1.Visible = true; this.tbxacname.Text = ViewState["pc_name"].ToString(); } this.lblError.Visible = false; }
private void repEquipments_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { int iEquipId; string sEquipId; try { if (e.CommandName == "Select") { iEquipId = Convert.ToInt32(e.CommandArgument); ViewState["SelectedEqiupId"] = iEquipId.ToString(); pnlFindEquipment.Visible = false; pnlManyEquipment.Visible = false; pnlOneEquipment.Visible = true; lblEquipId.Text = ((LinkButton)e.Item.FindControl("lbEquipId")).Text; lblEquipType.Text = ((Label)e.Item.FindControl("lbEquipType")).Text; lblMakeModel.Text = ((Label)e.Item.FindControl("lbMakeName")).Text + "/" + ((Label)e.Item.FindControl("lbModelName")).Text; lblYear.Text = ((Label)e.Item.FindControl("lbYear")).Text; } } catch (Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = "ok_selectEquipment.aspx?orderid=" + OrderId.ToString(); Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { } }
//This method will fire when clicking on the page no link from the pager repeater protected void rptPaging_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { PageNumber = Convert.ToInt32(e.CommandArgument) - 1; ltPage.Text = (PageNumber + 1).ToString(); BindRepeater(); //BindRepeater(0); }
/// <summary> /// Handles item command of medal list repeater. /// </summary> protected void MedalList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { switch (e.CommandName) { case "edit": // edit medal YafBuildLink.Redirect(ForumPages.admin_editmedal, "m={0}", e.CommandArgument); break; case "delete": // delete medal YAF.Classes.Data.DB.medal_delete(e.CommandArgument); // re-bind data BindData(); break; case "moveup": YAF.Classes.Data.DB.medal_resort(PageContext.PageBoardID, e.CommandArgument, -1); BindData(); break; case "movedown": YAF.Classes.Data.DB.medal_resort(PageContext.PageBoardID, e.CommandArgument, 1); BindData(); break; } }
/// <summary> /// 选择某一个微信公众帐号,并且将其保存到session里 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "toIndex": { int wid = int.Parse(e.CommandArgument.ToString()); var weixin = bll.GetAppInfo(wid); if (weixin.WStatus) { MessageBox.Show(this, "账号已被禁用,无法进入"); return; } if (weixin.EndDate != null) { if (weixin.EndDate < DateTime.Now) { MessageBox.Show(this, "账号已过期,无法进入"); return; } } Session["nowweixin"] = weixin; Utils.WriteCookie("nowweixinId", "WeiXinPF", e.CommandArgument.ToString()); Response.Write("<script>parent.location.href='../../../../index.aspx'</script>"); } break; } }
protected void Repeater_PubCourse_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandArgument.Equals("btnPub")) { Label labCid = e.Item.FindControl("labCID") as Label; int courseId = int.Parse(labCid.Text); if (bll.UpdateOffLineCourseStatus(3, courseId)) { Maticsoft.Common.MessageBox.ResponseScript(this, "alert('发布成功!')"); Response.Redirect(Request.RawUrl); } else { Maticsoft.Common.MessageBox.Show(this, "发布失败!"); } } if (e.CommandArgument.Equals("btnEditInfo")) { //对审核通过的课程进行修改----将状态改为完成待审核 Label labCid = e.Item.FindControl("labCID") as Label; int courseId = int.Parse(labCid.Text); if (courseBll.UpdataCourseStatus(courseId)) { Response.Redirect("/PublishCourse/NewPubCourse.aspx?CourseId=" + labCid.Text); } else { Session["CurrentError"] = "未知错误,请联系管理员!"; Server.Transfer("~/ErrorPage.aspx"); } } }
protected void rpMaterial_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.CommandName == "del") { if (VShopHelper.DelteLotteryTicket(System.Convert.ToInt32(e.CommandArgument))) { this.ShowMsg("删除成功", true); this.BindMaterial(); } else { this.ShowMsg("删除失败", false); } } else { if (e.CommandName == "start") { LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(System.Convert.ToInt32(e.CommandArgument)); if (lotteryTicket.OpenTime > System.DateTime.Now) { lotteryTicket.OpenTime = System.DateTime.Now; VShopHelper.UpdateLotteryTicket(lotteryTicket); base.Response.Write("<script>location.reload();</script>"); } } } }
protected void rptr_ItemCommand(object source, RepeaterCommandEventArgs e) { if(Page.IsValid && e.CommandName.Equals("save", StringComparison.OrdinalIgnoreCase)) { if(SaveAccount()) { Response.Redirect("~/Account/FamilyAccountList.aspx"); } } }
protected void dataList_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "detail": { var args = new { parentId = this.OrgTree.TreeView.SelectedValue, id = e.CommandArgument.ToString() }; this.PageEngine.OpenWindow<object, string>("org-detail.aspx", "org-detail", "width=600,height=285,resizeable=no", args, this.BindAll); break; } case "delete": { this.PageEngine.ShowConfirmBox<string>("确认删除吗", this.Delete, this.Cancel, e.CommandArgument.ToString()); break; } case "role": { var args = new { type = "organization", id = e.CommandArgument.ToString() }; this.PageEngine.OpenWindow<object, string>("role-give.aspx", "org-give", "width=600,height=500,resizeable=no", args, this.Bind); break; } } }
protected void OnFileListCommand(object source, RepeaterCommandEventArgs e) { string _CommandName = e.CommandName; if (_CommandName != null) { long longcomand = 0; long.TryParse(e.CommandArgument.ToString(), out longcomand); if (!(_CommandName == "Edit")) { if (_CommandName == "Update") { string txt = ((TextBox)e.Item.FindControl("txtDescriptionUpdate")).Text; HtzFileManager.UpdateFile(this.ViewState["ProjectName"].ToString(), longcomand, txt); this.BindFileList(); } else if (_CommandName == "Delete") { HtzFileManager.DeleteFile( this.ViewState["ProjectName"].ToString(), this._featureSource, (long)this._featureId, longcomand); this.BindFileList(); } else if (_CommandName == "Cancel") { SwitchMode(e.Item, false); } } else { SwitchMode(e.Item, true); } } }
protected void UsersListRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName.ToUpper() == "EDITAR") { ILogicaUsuario lu = FabricaLogica.getLogicaUsuario(); Docente d = new Docente { NOMBRE_USUARIO = Convert.ToString(e.CommandArgument) }; d = lu.getDocente(d); if (d != null) { if (Session["EditarUsuario"] == null) Session.Add("EditarUsuario", null); Session["EditarUsuario"] = d; Response.Redirect("~/AdminDocente/Usuarios.aspx", false); } else { lblInfo.Text = "Docente no encontrado"; } } } catch (Exception ex) { lblInfo.Text = ex.ToString(); } }
protected void Templates_ItemCommand(object source, RepeaterCommandEventArgs e) { TemplateEditControl.TemplateId = Convert.ToInt32(e.CommandArgument); TemplateEditControl.Fill(); TemplateEditControl.Visible = true; TemplateListPanel.Visible = false; }
protected void ItemCommander(object sender, RepeaterCommandEventArgs e) { if (Page.IsValid) { if (e.CommandName == "Save") { if (User.IsInRole("Employee")) { try { MembershipUser mu = Membership.GetUser(); facade.SaveJob2(mu.ProviderUserKey.ToString(), Convert.ToInt16(e.CommandArgument)); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopupScript", "<script>alert('You have successfully saved this job.');</script>"); } catch (Exception ex) { throw ex; } } else if (User.IsInRole("organization")) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopupScript", "<script>alert('Sorry, recruiter can not save this job.\\nPlease login as job seeker.');</script>"); } else { FormsAuthentication.RedirectToLoginPage("authen=false"); } } } }
protected void rptPricebf_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandArgument.Equals("btnCom")) { TextBox txtCom = e.Item.FindControl("txtCom") as TextBox; Label labOid = e.Item.FindControl("LabOid") as Label; Label labCid = e.Item.FindControl("labCid") as Label; Label labMid = e.Item.FindControl("labMid") as Label; if (txtCom == null || txtCom.Text == null || labOid == null || labMid == null) { return; } int oid = int.Parse(labOid.Text); int cid = int.Parse(labCid.Text); Model.Tao.Comment commodel = new Model.Tao.Comment(); commodel.OrderID = oid; commodel.CourseID = cid; commodel.ModuleID = int.Parse(labMid.Text); commodel.UserID = CurrentUser.UserID; commodel.Comments = txtCom.Text; commodel.CommentDate = DateTime.Now; commodel.Status = 1; BLL.Tao.Comment combll = new BLL.Tao.Comment(); if (combll.Add(commodel) > 0) { BindDatabf(); } } }
public void rptSongs_ItemCommand(object source, RepeaterCommandEventArgs e) { var setSongService = new SetSongService(Ioc.GetInstance<ISetSongRepository>()); var setSong = setSongService.GetSetSong(new Guid(e.CommandArgument.ToString())); if (e.CommandName.ToLower() == "fix") { txtSongName.Text = setSong.SongName; hdnSetSongIdToFix.Value = setSong.SetSongId.ToString(); } else if (e.CommandName.ToLower() == "delete") { ///TEST THIS SECTION var songService = new SongService(Ioc.GetInstance<ISongRepository>()); var song = songService.GetSong(setSong.SongId.Value); using (IUnitOfWork uow = UnitOfWork.Begin()) { setSongService.Delete(setSong); if (song != null) songService.Delete(song); uow.Commit(); } var setsongs = setSongService.GetAllSetSongs().Where(x => x.SongName.Contains(txtSearchSongName.Text)); rptSongs.DataSource = setsongs; rptSongs.DataBind(); } }
protected void Unnamed_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Page") { GridView1.PageIndex = Int32.Parse((string)e.CommandArgument); } }
protected void rptUser_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = a.normal.toInt(e.CommandArgument); if (e.CommandName == "delete") { string path = ad_main.admin_delete_img(id, "ad_img", "t_ad_ad"); if (path != "") { File.Delete(Server.MapPath(path)); if (ad_main.admin_delete_id(id, "t_ad_ad") > 0) { MessShowBox.show("删除成功", this); } else { MessShowBox.show("网络链接失败,删除失败", this); } } else { if (ad_main.admin_delete_id(id, "t_ad_ad") > 0) { MessShowBox.show("删除成功", this); } else { MessShowBox.show("网络链接失败,删除失败", this); } } } bind(); }
public void ShippingEdits(object s, RepeaterCommandEventArgs e) { Address address = new Address(); Guid selectedAddress = new Guid(e.CommandArgument.ToString()); _user = new WebProfile().GetProfile(ddlCustomer.SelectedValue); address = _user.AddressCollection.Find(delegate(Address addressToFind) { return addressToFind.AddressId == selectedAddress && addressToFind.AddressType == AddressType.ShippingAddress; }); if (address.AddressId != Guid.Empty) { if (e.CommandName == "Edit") { //Do the edit pnlBillingAddresses.Visible = false; pnlShippingAddresses.Visible = false; pnlEditAddress.Visible = true; LoadEditPanel(address); tcMyAccount.ActiveTab = tpAddresses; } if (e.CommandName == "Delete") { _user.AddressCollection.Remove(address); _user.Save(); LoadAddresses(); tcMyAccount.ActiveTab = tpAddresses; } } }
protected void rpMaterial_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (!(e.CommandName == "del")) { if (e.CommandName == "start") { int activityid = System.Convert.ToInt32(e.CommandArgument); LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(activityid); if (lotteryTicket.OpenTime > System.DateTime.Now) { lotteryTicket.OpenTime = System.DateTime.Now; VShopHelper.UpdateLotteryTicket(lotteryTicket); } this.ShowMsg("开启成功", true); this.BindMaterial(); } return; } int activityId = System.Convert.ToInt32(e.CommandArgument); if (VShopHelper.DelteLotteryTicket(activityId)) { this.ShowMsg("删除成功", true); this.BindMaterial(); return; } this.ShowMsg("删除失败", false); }
protected void rptAddDetails_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { con.Open(); if (e.CommandName == "Remove") { Label lblAddressID = e.Item.FindControl("lblid") as Label; string Aid = lblAddressID.Text; da = new SqlDataAdapter("delete from Address_Details where id='" + Aid + "'", con); dt = new DataTable(); da.Fill(dt); ItemBind(); } else if (e.CommandName == "Edit") { Label lblAddressID = e.Item.FindControl("lblid") as Label; Session["Aid"] = lblAddressID.Text; Response.Redirect("AddAddress.aspx?AID=AddressId"); } con.Close(); }
protected void MarkRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt16(e.CommandArgument); Eva.Model.Mark mark = new Model.Mark(); mark = bll.GetModel(id); if (e.CommandName == "yes") { mark.Score = mark.Score + mark.BonusPoint; mark.CheckStep = 2; mark.Gpa = BLL.Utils.GetGpa(Convert.ToInt16(mark.Score)); if (bll.Update(mark)) { Maticsoft.Common.MessageBox.Show(this, "已加分!"); } markBing(); } if (e.CommandName == "no") { mark.CheckStep = 3; if (bll.Update(mark)) { Maticsoft.Common.MessageBox.Show(this, "已拒绝!"); } markBing(); } }
protected void rptCart_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { try { if (e.CommandName == "LinkRemove") { string id = e.CommandArgument.ToString(); DataTable dtSessionCart = (DataTable)Session["Cart"]; for (int i = dtSessionCart.Rows.Count - 1; i >= 0; i--) { DataRow dr = dtSessionCart.Rows[i]; if (dr["ShoppingCartRecID"].ToString() == id) { dr.Delete(); } } Session["Cart"] = dtSessionCart; } BindCart(); } catch (Exception ex) { //Response.Redirect("Wishlist.aspx"); } }
protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { string commandName; if ((commandName = e.CommandName) != null) { int noticeid; if (commandName == "delete") { noticeid = Globals.ToNum(e.CommandArgument.ToString()); NoticeHelper.DelNotice(noticeid); this.ShowMsg("成功删除了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true); this.BindData(this.pageno, this.sendType); return; } if (!(commandName == "pub")) { return; } noticeid = Globals.ToNum(e.CommandArgument.ToString()); NoticeHelper.NoticePub(noticeid); this.ShowMsg("成功发布了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true); this.BindData(this.pageno, this.sendType); } }
protected void _repeater_ItemCommand( object source, RepeaterCommandEventArgs e ) { try { if( e.CommandName == "Delete" ) { using (var dc = new DCFactory<CmsDataContext>()) { int id = Convert.ToInt32( e.CommandArgument ); CatalogItem item = dc.DataContext.CatalogItems.Where( c => c.CatalogItemID == id ).SingleOrDefault(); if( item != null ) dc.DataContext.CatalogItems.DeleteOnSubmit( item ); dc.DataContext.SubmitChanges(); Response.Redirect( table.ListActionPath, true ); } } } catch( ThreadAbortException ) { throw; } catch( Exception ex ) { _errorLabel.Text = ex.Message; } }
protected void SitePackages_OnItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.Equals("AddScreenshot")) { FileUpload upload = (FileUpload)e.Item.FindControl("FileUpload"); String packageGuid = (String)e.CommandArgument; if (upload.HasFile) SitePackageManager.NewInstance.AddScreenshot(Data.Guid.New(packageGuid), upload.FileName, upload.FileBytes); } else if (e.CommandName.Equals("DeleteScreenshot")) { String temp = (String)e.CommandArgument; String[] arr = temp.Split('|'); if (arr.Length == 2) SitePackageManager.NewInstance.DeleteScreenshot(arr[0].Trim(),arr[1].Trim()); } else if (e.CommandName.Equals("DeletePackage")) { String packageGuid = (String)e.CommandArgument; SitePackageManager.NewInstance.DeletePackage(packageGuid); } DoDataBind(); }
protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e) { var cArg = e.CommandArgument.ToString(); var param = new string[3]; switch (e.CommandName.ToLower()) { case "addnew": var discountcodes = new DiscountCodesData(_ctrlkey); discountcodes.AddNewRule(); discountcodes.Save(); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "delete": if (Utils.IsNumeric(cArg)) { var discountcodes2 = new DiscountCodesData(_ctrlkey); discountcodes2.RemoveRule(Convert.ToInt32(cArg)); discountcodes2.Save(); } Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "saveall": Update(); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "cancel": Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; } }
protected void rptAssetSetupList_ItemCommand(object sender, RepeaterCommandEventArgs e) { var setupId = e.CommandArgument.ToString(); if (e.CommandName.Equals("DeleteDetail")) { if (!string.IsNullOrEmpty(setupId)) { AssetSetupinfoService.DeleteAssetsetupinfoBySetupid(setupId); UIHelper.Alert(this, "删除成功"); LoadData(pcData.CurrentIndex); return; } } if (e.CommandName.Equals("EditDetail")) { Response.Redirect(ResolveUrl(string.Format("~/Admin/NewInstall.aspx?Setupid={0}", setupId))); } else if (e.CommandName.Equals("ReplyDetail")) { Response.Redirect(ResolveUrl(string.Format("~/Admin/Install_Reply.aspx?Setupid={0}", setupId))); } else if (e.CommandName.Equals("ComfirmDetail")) { Response.Redirect(ResolveUrl(string.Format("~/Admin/Install_Confirm.aspx?Setupid={0}", setupId)));//安装结束后确认 } else { Response.Redirect(ResolveUrl(string.Format("~/Admin/Install_View.aspx?Setupid={0}", setupId))); } }
protected void TaskRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName.ToString()) { case "updateTask": string taskName = Convert.ToString(e.CommandArgument); Session["taskName"] = taskName; Response.Redirect("/Management/Tasks/UpdateTask.aspx"); break; case "deleteTask": string taskName2 = Convert.ToString(e.CommandArgument); taskService.deleteTask(taskName2); Response.Redirect(Request.RawUrl); break; case "getSubTasks": string taskName3 = Convert.ToString(e.CommandArgument); Session["taskName"] = taskName3; Response.Redirect("/Management/Tasks/SubTasks/HomeSubTask.aspx"); break; case "getAssignedUsers": string taskName4 = Convert.ToString(e.CommandArgument); Session["taskName"] = taskName4; Response.Redirect("/Management/User/AssignedUsers.aspx"); break; default: break; } }
protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo debitNoteInfo = new DebitNoteInfo(); debitNoteInfo.NoteId = Globals.GetGenerateId(); debitNoteInfo.OrderId = e.CommandArgument.ToString(); debitNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; debitNoteInfo.Remark = "后台" + debitNoteInfo.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNoteInfo); this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); return; } this.ShowMsg("确认订单收款失败", false); return; } else if (e.CommandName == "FINISH_TRADE") { orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE); } } }
protected void searchRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "SelectUser") { try { BaseUser user = SQLUsers.GetUser(e.CommandArgument.ToString()); if (user != null) { // Set the session variables CPContext.SelectedResellerCode = user.ResellerCode; CPContext.SelectedResellerName = user.ResellerName; CPContext.SelectedCompanyCode = user.CompanyCode; CPContext.SelectedCompanyName = user.CompanyName; // Redirect to company users Response.Redirect("~/company/users/edit.aspx", false); } } catch (Exception ex) { notification1.SetMessage(controls.notification.MessageType.Error, ex.Message); } } }
//删除操作 protected void rptClassList_ItemCommand(object source, RepeaterCommandEventArgs e) { HiddenField txtClassId = (HiddenField)e.Item.FindControl("txtClassId"); int id = Convert.ToInt32(txtClassId.Value); //switch (e.CommandName.ToLower()) //{ // case "btndel": // bll.Delete(Convert.ToInt32(txtClassId.Value)); // BindData(); // JscriptPrint("批量删除成功啦!", "", "Success"); // break; // case "ibtnshow": // Spread.Model.Channel model = bll.GetModel(id); // if (model.IsShow == true) // bll.UpdateField(id, "IsShow=false"); // else // bll.UpdateField(id, "IsShow=true"); // BindData(); // break; // case "ibtnlock": // Spread.Model.Channel model2 = bll.GetModel(id); // if (model2.IsLock == true) // bll.UpdateField(id, "IsLock=false"); // else // bll.UpdateField(id, "IsLock=true"); // BindData(); // break; //} }
/// <summary> /// Handles the ItemCommand event of the rLocations control. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.RepeaterCommandEventArgs"/> instance containing the event data.</param> protected void rLocations_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { int?locationId = (e.CommandArgument as string).AsIntegerOrNull(); if (locationId.HasValue) { var rockContext = new RockContext(); var location = new LocationService(rockContext).Get(locationId.Value); if (location != null) { if (e.CommandName == "Open" && !location.IsActive) { location.IsActive = true; rockContext.SaveChanges(); KioskDevice.Clear(); } else if (e.CommandName == "Close" && location.IsActive) { location.IsActive = false; rockContext.SaveChanges(); KioskDevice.Clear(); } } BindManagerLocationsGrid(); } }
protected void CartRepeater_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { // This code runs when a user has clicked a remove button (X) on a row. // We get the ProductID from the CommandArgument when the remove button is clicked. string ProductID = (e.CommandArgument).ToString(); // We declare the variable CartCookie to check if the HttpCookie "CartCookie" exits and to // be able to remove a key from it. HttpCookie CartCookie = Request.Cookies.Get("CartCookie"); // We check if the CartCookie exists and then removes the key that has the "ProductID" as its name // and then we then reload the shopping cart so that our repeater gets updated. if (CartCookie != null) { CartCookie.Values.Remove(ProductID); CartCookie.Expires = DateTime.Now.AddHours(3); Response.Cookies.Add(CartCookie); // Reload the shopping cart LoadShoppingCart(); // Update the small shopping cart by calling a public method in the Start class for the masterpage. ((Start1)this.Master).LoadSmallCart(); } }