當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.RepeaterCommandEventArgs類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.RepeaterCommandEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# RepeaterCommandEventArgs類的具體用法?C# RepeaterCommandEventArgs怎麽用?C# RepeaterCommandEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RepeaterCommandEventArgs類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了RepeaterCommandEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: rptList_ItemCommand

        /// <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;
            }
        }
開發者ID:jxiaox,項目名稱:weixinpf,代碼行數:35,代碼來源:myweixinlist.aspx.cs

示例2: CtrlItemCommand

        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;
            }
        }
開發者ID:Lewy-H,項目名稱:NBrightBuy,代碼行數:31,代碼來源:DiscountCodes.ascx.cs

示例3: ValidateData

        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;
        }
開發者ID:AAGJKPRT,項目名稱:LMT,代碼行數:27,代碼來源:LabourType.ascx.cs

示例4: ShippingEdits

        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;
            }
              }
        }
開發者ID:dashcommerce,項目名稱:dashcommerce-3,代碼行數:26,代碼來源:customerinformation.aspx.cs

示例5: _repeater_ItemCommand

 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;
     }
 }
開發者ID:dmziryanov,項目名稱:ApecAuto,代碼行數:26,代碼來源:List.aspx.cs

示例6: rptPricebf_ItemCommand

        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();
                }
            }
        }
開發者ID:bookxiao,項目名稱:orisoft,代碼行數:30,代碼來源:Userbuycourse.aspx.cs

示例7: Unnamed_ItemCommand

 protected void Unnamed_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Page")
     {
         GridView1.PageIndex = Int32.Parse((string)e.CommandArgument);
     }
 }
開發者ID:davidfowl,項目名稱:ReviewR,代碼行數:7,代碼來源:List.aspx.cs

示例8: MarkRepeater_ItemCommand

        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();

            }
        }
開發者ID:huihao,項目名稱:evaluation,代碼行數:29,代碼來源:ApplyList.aspx.cs

示例9: SitePackages_OnItemCommand

        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();
        }
開發者ID:beachead,項目名稱:gooey-cms-v2,代碼行數:25,代碼來源:Default.aspx.cs

示例10: rptSongs_ItemCommand

        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();
            }
        }
開發者ID:coredweller,項目名稱:PhishMarket,代碼行數:33,代碼來源:EditSongNames.aspx.cs

示例11: rptUser_ItemCommand

 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();
 }
開發者ID:kuangzhongwei,項目名稱:ad,代碼行數:32,代碼來源:ad_ad.aspx.cs

示例12: ItemCommander

 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");
             }
         }
     }
 }
開發者ID:chutinhha,項目名稱:teachinvietnam,代碼行數:30,代碼來源:JobAlert.aspx.cs

示例13: UsersListRepeater_ItemCommand

        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();
            }
        }
開發者ID:thefumigator,項目名稱:BiosWebMailLab2,代碼行數:30,代碼來源:ListarDocentes.aspx.cs

示例14: dataList_ItemCommand

 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;
             }
     }
 }
開發者ID:yhhno,項目名稱:Membership,代碼行數:31,代碼來源:org-list.aspx.cs

示例15: Templates_ItemCommand

 protected void Templates_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     TemplateEditControl.TemplateId = Convert.ToInt32(e.CommandArgument);
     TemplateEditControl.Fill();
     TemplateEditControl.Visible = true;
     TemplateListPanel.Visible = false;
 }
開發者ID:bigWebApps,項目名稱:Substitute,代碼行數:7,代碼來源:EditTemplates.aspx.cs


注:本文中的System.Web.UI.WebControls.RepeaterCommandEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。