不能隐式地将SananPos类型转换为Void

本文关键字:类型转换 Void SananPos 不能 | 更新日期: 2023-09-27 18:13:29

protected void btnSave_Click(object sender, EventArgs e)
{
    if (txtMagazaNo.Text != string.Empty && txtTerminalNo.Text != string.Empty && txtKullaniciAdı.Text != string.Empty &&
        txtSifre.Text != string.Empty && txtParola.Text != string.Empty && comboCompany.SelectedIndex > -1 && comboCompany.SelectedIndex > -1 && comboBank.SelectedIndex > -1 && DatePicker3.SelectedDate != null && LstTaskOfUsers.Items.Count > 0)
    {
        if (sanalPosList == null && txtMagazaNo.Text != string.Empty && txtTerminalNo.Text != string.Empty)
        {
            SanalPos SanalPosControl = SanalPos.InsertSanalPos(sanalPosList[comboCompany.SelectedIndex].Id, sanalPosList[comboBank.SelectedIndex].Id, txtMagazaNo.Text, txtTerminalNo.Text, txtKullaniciAdı.Text, txtParola.Text, txtSifre.Text, "", "", txtNot.Text, 1, DateTime.Now, "");
            if (sanalPosList == null)
                SanalPos.InsertSanalPos(sanalPosList[comboCompany.SelectedIndex].Id, sanalPosList[comboBank.SelectedIndex].Id, txtMagazaNo.Text, txtTerminalNo.Text, txtKullaniciAdı.Text,

                txtParola.Text, txtSifre.Text, "", "", txtNot.Text, 0, DateTime.Now, "");
            }
    }

不能隐式地将SananPos类型转换为Void

这个方法很有可能:

SanalPos.InsertSanalPos();

返回类型为void

如果您需要它返回一些东西,您需要将返回类型更改为SanalPos并返回相同类型的对象