コード例 #1
0
ファイル: WebForm1.aspx.cs プロジェクト: RatnasreeP/Updates
        protected void btnsave_Click(object sender, EventArgs e)
        {
            daobj.EmpName         = txtEmpName.Text;
            daobj.UserName        = txtUserName.Text;
            daobj.Password        = txtPassword.Text;
            daobj.ConfirmPassword = txtConfirmPassword.Text;
            daobj.Gender          = null;
            daobj.PhoneNumber     = txtPhoneNumber.Text;
            daobj.Emailid         = txtEmailId.Text;
            daobj.Designation     = ddlDesignation1.SelectedItem.Value.ToString();
            daobj.Empid           = Convert.ToInt32(txtlblempid.Text);

            if (rbMale.Checked == true)
            {
                daobj.Gender = rbMale.Text;
            }
            else
            {
                daobj.Gender = rbFeMale.Text;
            }


            int i = blobj.InsertEmployee(daobj);
            //if (EmpName != null && UserName != null && Password != null && ConfirmPassword != null && Gender != null && PhoneNumber != null && Emailid != null && Designation != null)
        }
コード例 #2
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     try
     {
         if (btnsave.Text == "save")
         {
             InsertintoDb();
             int i = blobj.InsertEmployee(daobj);
             if (i > 0)
             {
                 Response.Write("inserted successfully");
             }
             //if (EmpName != null && UserName != null && Password != null && ConfirmPassword != null && Gender != null && PhoneNumber != null && Emailid != null && Designation != null)
         }
         if (btnsave.Text == "Update")
         {
             InsertintoDb();
             int i = blobj.Updateedit(daobj);
         }
     }
     catch (Exception ex)
     {
     }
 }