コード例 #1
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (EmriTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                EmriTextBox.Focus();
                return;
            }
            else if (MbiemriTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                MbiemriTextBox.Focus();
                return;
            }
            else if (NumriTelefonitTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                NumriTelefonitTextBox.Focus();
                return;
            }
            else if (NumriTelefonitTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                NumriTelefonitTextBox.Focus();
                return;
            }
            else
            {
                int           ID = Convert.ToInt32(ViewState["SelectedID"].ToString());
                Klienti       ex = new Klienti();
                KlientiMapper em = new KlientiMapper(ex);
                em.SelectedID(ID);


                ex.Emri           = EmriTextBox.Text;
                ex.Mbiemri        = MbiemriTextBox.Text;
                ex.NumriTelefonit = int.Parse(NumriTelefonitTextBox.Text);
                ex.Email          = EmailTextBox.Text;

                em.Update();
                Response.Redirect("Index.aspx");
            }
        }
コード例 #2
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (EmriTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                EmriTextBox.Focus();
                return;
            }
            else if (MbiemriTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                MbiemriTextBox.Focus();
                return;
            }
            else if (NumriTelefonitTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                NumriTelefonitTextBox.Focus();
                return;
            }
            else if (EmailTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                EmailTextBox.Focus();
                return;
            }

            else
            {
                Klienti obj = new Klienti();
                obj.Emri           = EmriTextBox.Text;
                obj.Mbiemri        = MbiemriTextBox.Text;
                obj.NumriTelefonit = int.Parse(NumriTelefonitTextBox.Text);
                obj.Email          = EmailTextBox.Text;


                KlientiMapper objm = new KlientiMapper(obj);
                objm.Insert();
                Response.Redirect("Index.aspx");
            }
        }