Ejemplo n.º 1
0
 protected void btnAddGuest_Click(object sender, EventArgs e)
 {
     if (txtName.Text != "" && txtLname.Text != "" && txtSalary.Text != "" && txtAff.SelectedValue != "")
     {
         string sql      = "INSERT INTO tbl_guest_list ( guest_id, guest_list_profix, guest_list_name, guest_list_lname, guest_list_pos, guest_list_salary, guest_list_cpoint, guest_list_status, guest_list_idcard ) VALUES ('" + txtGuest_id.Value.ToString() + "', '" + txtProfix.SelectedValue + "', '" + txtName.Text.Trim() + "', '" + txtLname.Text.Trim() + "', '" + txtPos.Text + "', '" + double.Parse(txtSalary.Text) + "', '" + txtCpoint.Text + "', '0', '')";
         string guest_pk = dBScript.InsertQueryPK(sql);
         if (guest_pk != "")
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('บันทึกสำเร็จ')", true);
             BindData();
             clearDataGreat();
         }
         else
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('Error : ล้มเหลว')", true);
         }
     }
     else
     {
         ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('กรุณากรอกข้อมูลให้ครบถ้วน')", true);
     }
 }