0

我正在使用此代码添加和编辑员工。首先,我通过验证进行检查,然后将图像添加到数据库中,如果 U 在运行时编辑意味着显示错误“无法导航到 'IF' ”。编码有问题吗?

private void btn_submit_Click(object sender, EventArgs e)
{
    if (employeevalidate() == true)
    {
        toproperties();
        if (cpbempadd.employeesave(cpemp) == true)
        {
            if (saveImageInDataBase(cpemp.Empid) == true)
            {
                MessageBox.Show("Employee Details are Saved Sucessfully....");
                grid();
                pnl_addedit.Visible = false;
                pnl_grid.Visible = true;
            }
        }
    }
    else
    {
        MessageBox.Show("Error in Saving Employee Details... ");
    }
}

验证编码是:

public  bool employeevalidate()
{
    if (cpbempadd.textboxnull(txt_empid) == false) { return false; }
    if (cpbempadd.textboxnull(txt_empname) == false) { return false; }
    if (cpbempadd.textboxnull(txt_mobno) == false) { return false; }
    if (cpbempadd.textboxnull(txt_proofdetails) == false) { return false; }
    if (cpbempadd.textboxnull(txt_upload) == false) { return false; }
    if (txt_add2.Text == string.Empty) { txt_add2.Text = "-"; }
    if (txt_add3.Text == string.Empty) { txt_add3.Text = "-"; }
    if (txt_bg.Text == string.Empty) { txt_bg.Text = "-"; }
    if (txt_email.Text == string.Empty) { txt_email.Text = "-"; }
    if (txt_pf.Text == string.Empty) { txt_pf.Text = "-"; }
    if (txt_status.Text == string.Empty) { txt_status.Text = "-"; }
    return true; 
}
4

1 回答 1

0

问题已解决。错误出在 SQL 语法中。非常感谢

于 2013-03-12T12:23:36.277 回答