Пример #1
0
        protected void grdTipM_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("detail"))
            {
                int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());
                using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri ayarlar = new AyarIslemleri(dc);
                    DetailsViewTipM.DataSource = ayarlar.masrafListesiTekliR(code2);
                    DetailsViewTipM.DataBind();
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append("$('#detailModalTipM').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "DetailModalScriptTip", sb.ToString(), false);
                }
            }
            else if (e.CommandName.Equals("del"))
            {
                string confirmValue = Request.Form["confirm_value"];
                if (confirmValue == "Yes")
                {
                    int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());

                    using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                    {
                        AyarIslemleri ayarlar = new AyarIslemleri(dc);
                        ayarlar.masrafSilR(code2);;

                        masrafGoster(ayarlar);

                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append(" alertify.success('Kayıt silindi!');");

                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTipM", sb.ToString(), false);
                    }
                }
            }
            else if (e.CommandName.Equals("editRecord"))
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvrow = grdTipM.Rows[index];

                LinkButton link = gvrow.Cells[2].Controls[1] as LinkButton;

                hdnTipIDM.Value       = HttpUtility.HtmlDecode(gvrow.Cells[1].Text);
                txtTipAdM.Text        = HttpUtility.HtmlDecode(link.Text);
                txtTipAciklamaM.Text  = HttpUtility.HtmlDecode(gvrow.Cells[3].Text);
                txtCssGuncelleM.Value = HttpUtility.HtmlDecode(gvrow.Cells[4].Text);

                Label2.Visible = false;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#editModalTipM').modal('show');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditModalScriptTip2M", sb.ToString(), false);
            }
        }
Пример #2
0
        protected void btnDelTipM_Click(object sender, EventArgs e)
        {
            int code2 = Int32.Parse(hdnTipIDM.Value);

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                ayarlar.masrafSilR(code2);;

                masrafGoster(ayarlar);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append(" alertify.success('Kayıt silindi!');");
                sb.Append("$('#editModalTipM').modal('hide');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTipM", sb.ToString(), false);
            }
        }