naveed_786's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
308 (0.19 per day)
Joined:
13-October 09
Profile Views:
9,891
Last Active:
User is offline Oct 21 2013 05:27 AM
Currently:
Offline

Previous Fields

Country:
PA
OS Preference:
Windows
Favorite Browser:
Internet Explorer
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   naveed_786 has not set their status

Posts I've Made

  1. In Topic: Datetimepicker Not Refreshing

    Posted 21 Oct 2013

    @jimzcoder thanks alot for your kind support, it the method provided by you worked for me.
  2. In Topic: Datetimepicker Not Refreshing

    Posted 21 Oct 2013

    Yes why not please view the below code



    Imports System.Data.oracleclient
    Public Class FRM_FEE_ENTRTY
        Private Sub FRM_FEE_ENTRY_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            If MessageBox.Show("Are you sure you want to exit????", "High Aims Star Land Schoool System", MessageBoxButtons.YesNo, MessageBoxIcon.Information) = Windows.Forms.DialogResult.No Then
                e.Cancel = True
            End If
        End Sub
    
        Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
            If txtsno.Text = "" Then
                txtsno.Text = "1000"
            End If
    
            Auto_no()
    
            If txtreg.Text = "" Or txtname.Text = "" Or txtfname.Text = "" Or txtPaymentDay.Text = "" Or txtRecievedAmount.Text = "" Or txttamount.Text = "" Or txtRemainingAmount.Text = "" Or txtPaymentRecieverName.Text = "" Then
                MessageBox.Show("Please enter the required field(s)", "High Aims Star Land Schoool System", MessageBoxButtons.OK, MessageBoxIcon.Information)
                txtreg.Focus()
                Exit Sub
            End If
            Dim con As New OracleConnection(ConnectionString)
            Dim com As OracleCommand = Nothing
    
            Try
                con.Open()
                Dim tempDateTime As DateTime
                Dim textDateTime As String
                If DateTime.TryParse(txtPaymentDay.Text, tempDateTime) Then
                    textDateTime = tempDateTime.ToString("MM/dd/yyyy HH:mm:ss")
                Else
                    textDateTime = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")
                End If
                com = New OracleCommand("INSERT INTO STD_FEE(SNO,STD_REG_NO,STD_NAME,STD_F_NAME,STD_F_D_DT,STD_P_AMT,STD_TTL_AMT,STD_RMG_AMT,STD_P_D_NAME,STD_P_R_NAME)VALUES ('" & Me.txtsno.Text & "','" & Me.txtreg.Text & "', '" & Me.txtname.Text & "', '" & Me.txtfname.Text & "',to_date('" & textDateTime & "','mm/dd/yyyy hh24:mi:ss'),'" & Me.txtRecievedAmount.Text & "','" & Me.txttamount.Text & "','" & Me.txtRemainingAmount.Text & "','" & Me.txtpdname.Text & "', '" & Me.txtPaymentRecieverName.Text & "')", con)
                com.ExecuteNonQuery()
                con.Close()
                MessageBox.Show("Record Successfully Inserted!", "ALI High Aims Star Land Schoool System", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Dim a As Integer
                a = MessageBox.Show("Do you want to proceed with another transaction????", "High Aims Star Land Schoool System", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
                If a = vbYes Then
                    txtsno.Text = ""
                    txtreg.Text = ""
                    txtname.Text = ""
                    txtfname.Text = ""
                    txtPaymentDay.Text = ""
                    txtRecievedAmount.Text = ""
                    txttamount.Text = ""
                    txtRemainingAmount.Text = ""
                    txtpdname.Text = ""
                    Me.datPaymentDay.Value = Now
                    Me.datPaymentDay.BringToFront()
                Else
                    Exit Sub
                End If
            Catch ex As Exception
                If con.State = ConnectionState.Open Then
                    con.Close()
                End If
                MessageBox.Show(ex.Message, "Error")
            End Try
        End Sub
        Private Sub datPaymentDay_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles datPaymentDay.ValueChanged
            txtPaymentDay.Text = datPaymentDay.Value.ToString
            Me.datPaymentDay.SendToBack()
            datPaymentDay.Refresh()
        End Sub
    
        Private Sub txtRecievedAmount_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtRecievedAmount.GotFocus
            'If txtRecievedAmount.Text = "" Then
            '    Exit Sub
            'End If
            Dim con As New OracleConnection(ConnectionString)
            Dim com As OracleCommand = Nothing
            Dim reader As OracleDataReader = Nothing
            Try
                'com = New OracleCommand("SELECT * FROM STD_ADMSN STD_REG_NO = '" & txtreg.Text & "'", con)
                com = New OracleCommand("SELECT STD_M_FEE FROM STD_ADMSN WHERE STD_REG_NO = '" & txtreg.Text & "'", con)
                con.Open()
                reader = com.ExecuteReader(Commandbehavior.CloseConnection)
                If reader.HasRows Then
                    reader.Read()
                    txttamount.Text = reader("STD_M_FEE")
                Else
                    MessageBox.Show("Sorry No Record Found Please Try Again!", "High Aims Star Land Schoool System", MessageBoxButtons.OK, MessageBoxIcon.Information)
                End If
                reader.Close()
            Catch ex As Exception
                If con.State = ConnectionState.Open Then
                    con.Close()
                End If
                MessageBox.Show("Student Not found" + ex.Message)
            End Try
        End Sub
        Private Sub txtRecievedAmount_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRecievedAmount.KeyPress
            If Asc(e.KeyChar) = 13 Then
                txtpdname.Focus()
                Dim a, b, c As Integer
                a = txtRecievedAmount.Text
                b = txttamount.Text
                c = b - a
                txtRemainingAmount.Text = c.ToString
            End If
        End Sub
        Private Sub Auto_no()
            Dim con As New OracleConnection(ConnectionString)
            Dim com As OracleCommand = Nothing
            Try
                con.Open()
                com = New OracleCommand("SELECT MAX(SNO)FROM(SELECT * FROM STD_FEE ORDER BY SNO DESC)", con)
                txtsno.Text = IIf(IsDBNull(com.ExecuteScalar), 1000, com.ExecuteScalar) + 1
            Catch ex As OracleException
                If con.State = ConnectionState.Open Then
                    con.Close()
                End If
            End Try
        End Sub
        Private Sub txtreg_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtreg.Leave
    
        End Sub
    
        Private Sub FRM_FEE_ENTRTY_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            btnSave.Enabled = False
            If IsAdmin(Username) Then
                btnSave.Enabled = True
            End If
            If Not IsAdmin(Username) Then
                Dim result() As String = CheckPermission(Username)
                If result IsNot Nothing Then
                    If result(0).Equals("READ") Then
                        btnSave.Enabled = False
                    End If
                    If result(1).Equals("WRITE") Then
                        btnSave.Enabled = True
                    End If
                End If
            End If
            txtPaymentRecieverName.Text = Username
            txtPaymentRecieverName.Enabled = False
            txtsno.Enabled = False
            Me.txtpdname.CharacterCasing = CharacterCasing.Upper
            'txttamount.Text = 0
        End Sub
        Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
            If MsgBox("Are You Sure You want to Exit???", vbOKCancel, "igh Aims Star Land Schoool System") = vbOK Then
                Me.Close()
            Else
                Exit Sub
            End If
        End Sub
    
        Private Sub BTNLOV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNLOV.Click
            FRM_LOV_REG.Show()
        End Sub
    
        Private Sub txtreg_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtreg.TextChanged
            If txtreg.Text = "" Then
                Exit Sub
            End If
            Dim con As New OracleConnection(ConnectionString)
            Dim com As OracleCommand = Nothing
            Dim reader As OracleDataReader = Nothing
            Try
                com = New OracleCommand("SELECT * FROM STD_INFO WHERE STD_REG_NO = '" & txtreg.Text & "'", con)
    
                con.Open()
                reader = com.ExecuteReader(Commandbehavior.CloseConnection)
                If reader.HasRows Then
                    reader.Read()
                    txtname.Text = reader("STD_NAME")
                    txtfname.Text = reader("STD_F_NAME")
                Else
                    MessageBox.Show("Sorry No Record Found Please Try Again!", "High Aims Star Land Schoool System", MessageBoxButtons.OK, MessageBoxIcon.Information)
                End If
                reader.Close()
            Catch ex As Exception
                If con.State = ConnectionState.Open Then
                    con.Close()
                End If
                MessageBox.Show("Student Not found" + ex.Message)
            End Try
        End Sub
    End Class
    
  3. In Topic: Datetimepicker Not Refreshing

    Posted 21 Oct 2013

    Ok now i have tried the code provided with you now it gives me message "Are you sure you want exit???" with Ok and cancel option, but when i click on ok then it shows me another message "Are you sure you want exit???" with yes and no option.

    But i have removed old code which i have posted earlier in my last post.

    Yes of course it is on click event of exit button see below:

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
            If MsgBox("Are You Sure You want to Exit???", vbOKCancel, "igh Aims Star Land Schoool System") = vbOK Then
                Me.Close()
            Else
                Exit Sub
            End If
        End Sub
    
  4. In Topic: Datetimepicker Not Refreshing

    Posted 21 Oct 2013

    I am writing code like this

    Dim a As Integer
            a = MessageBox.Show("Are you sure you want to exit????", "High Aims Star Land Schoool System", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
            If a = vbYes Then
                Me.Close()
            Else
                Exit Sub
            End If
    


    What is wrong with this code?
  5. In Topic: Datetimepicker Not Refreshing

    Posted 21 Oct 2013

    Today is a good day for me thanks problem solved.

    Two little more question only

    1. On a form my exit button not behaving good, when i click on exit here comes a message "Are you sure you want to exit???" when i click yes then it does nothing when i click again it then it exits the form why?
    2. On another form when i click on exit button it gives message "Are you sure you want to exit???" when i click on yes then it populates same message again asking "Are you sure you want to exit???" then i click on yes again and it exits.

My Information

Member Title:
D.I.C Regular
Age:
27 years old
Birthday:
February 4, 1987
Gender:
Location:
PK
Interests:
Client Server Applications
Full Name:
Naveed Akhter
Years Programming:
3
Programming Languages:
C++,C,C#,VB.NET,Deleveloper Forms 6i

Contact Information

E-mail:
Private
MSN:
MSN  mrakhter_786@hotmail.com
Yahoo:
Yahoo  mrakhter_786@Yahoo.com

Friends

Comments

naveed_786 has no profile comments yet. Why not say hello?