Example #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");
            }
        }
Example #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");
            }
        }
Example #3
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 (GjiniaTextBox.Text.Length == 0)
            {
                lblError.Visible = true;

                GjiniaTextBox.Focus();
                return;
            }
            else
            {
                int            ID   = Convert.ToInt32(ViewState["SelectedID"].ToString());
                Punetori       obj  = new Punetori();
                PunetoriMapper objm = new PunetoriMapper(obj);
                objm.SelectedID(ID);



                obj.Emri    = EmriTextBox.Text;
                obj.Mbiemri = MbiemriTextBox.Text;
                obj.Gjinia  = GjiniaTextBox.Text;
                obj.RoliID  = Int32.Parse(RoliDropDownList.SelectedItem.Value);

                objm.Update();
                Response.Redirect("Index.aspx");
            }
        }