예제 #1
0
    //inserting into database
    public int funds_DAL_insert(fundsBO funds_BO)
    {
        try
        {
            Next_ID nid = new Next_ID();
            funds_BO.sl_no = nid.incrementer("sl_no", "funds");
            s_querry       = "insert into funds(sl_no,first_name,last_name,email_id,uknown_user,amount) values(@sl_no,@first_name,@last_name,@email_id,@uknown_user,@amount)";
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            cmd = new SqlCommand(s_querry, con);
            cmd.Parameters.AddWithValue("@sl_no", funds_BO.sl_no);
            cmd.Parameters.AddWithValue("@first_name", funds_BO.first_name);
            cmd.Parameters.AddWithValue("@last_name", funds_BO.last_name);
            cmd.Parameters.AddWithValue("@email_id", funds_BO.email_id);
            cmd.Parameters.AddWithValue("@uknown_user", funds_BO.unknown_user);
            cmd.Parameters.AddWithValue("@amount", funds_BO.amount);

            return(cmd.ExecuteNonQuery());
        }
        catch (Exception)
        {
            throw;
        }
        finally { cmd.Dispose(); con.Close(); con.Dispose(); }
    }
예제 #2
0
 public int funds_DAL_insert(fundsBO funds_BO)
 {
     try
     {
         return(fdal.funds_DAL_insert(funds_BO));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #3
0
    protected void fillFundDetails()
    {
        try
        {
            fundsBO   fbo  = new fundsBO();
            funds_BAL fbal = new funds_BAL();
            fbo.email_id     = TB_Email.Value;
            fbo.first_name   = TB_FirstName.Value;
            fbo.last_name    = TB_LastName.Value;
            fbo.unknown_user = Convert.ToBoolean(usertype);
            fbal.funds_DAL_insert(fbo);
        }

        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("DonateForm.aspx", ex.ToString());
            Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
        }
    }