protected void gvSelectedStudents_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Details")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row = gvSelectedStudents.Rows[index];

                //Response.Redirect("http://*****:*****@"<script type='text/javascript'>");
                    sb.Append("$('#modalShowDetails').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "ModalScript", sb.ToString(), false);
                }
            }
            if (e.CommandName == "Delet")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow      row = gvSelectedStudents.Rows[index];
                string           id  = row.Cells[0].Text;
                OzviatRepository rep = new OzviatRepository();

                rep.DeleteOzviat(id.ToInt());
                LoadSelectedStudents();
                LoadStudents();
            }
        }
Exemplo n.º 2
0
        public void load()
        {
            string id = Request.QueryString["userid"];

            if (id != "" || id != null)
            {
                Student lo = rep.FindByStudentCode(id);
                tbxFirstName.Value = lo.FirstName;
                tbxLastName.Value  = lo.LastName;

                tbxBirthYear.Value = lo.BirthDate.Substring(0, 4);
                tbxIDNumber.Value  = lo.NationalCode.ToString();
                tbxFixTel.Value    = lo.PhoneNumber;
                tbxMobile.Value    = lo.MobileNumber;
                tbxZipCode.Value   = lo.ZipCode;
                tbxEmail.Value     = lo.Email;
            }
        }
Exemplo n.º 3
0
        public void load()
        {
            if (Session["UserIDForEditStudent"] != null)
            {
                string  id = Session["UserIDForEditStudent"].ToString();
                Student lo = rep.FindByStudentCode(id);
                tbxFirstName.Value = lo.FirstName;
                tbxLastName.Value  = lo.LastName;

                tbxBirthYear.Value = lo.BirthDate.Substring(0, 4);
                tbxIDNumber.Value  = lo.NationalCode.ToString();
                tbxFixTel.Value    = lo.PhoneNumber;
                tbxMobile.Value    = lo.MobileNumber;
                tbxZipCode.Value   = lo.ZipCode;
                tbxEmail.Value     = lo.Email;
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('شما با آدرس اشتباه وارد شده اید ! ');window.location ='http://localhost:4911/Dashboard/Admin/News.aspx'", true);
            }
        }