Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
AnswerRe: vochancer program PinPopular
Mycroft Holmes8-Jan-14 20:24
professionalMycroft Holmes8-Jan-14 20:24 
AnswerRe: vochancer program PinPopular
OriginalGriff8-Jan-14 21:16
mveOriginalGriff8-Jan-14 21:16 
GeneralRe: vochancer program Pin
Rahul VB31-Jan-14 6:59
professionalRahul VB31-Jan-14 6:59 
QuestionIf else statemant Pin
manoj s sherje8-Jan-14 19:00
manoj s sherje8-Jan-14 19:00 
AnswerRe: If else statemant Pin
Wayne Gaylard8-Jan-14 19:20
professionalWayne Gaylard8-Jan-14 19:20 
AnswerRe: If else statemant Pin
Bernhard Hiller8-Jan-14 20:29
Bernhard Hiller8-Jan-14 20:29 
AnswerRe: If else statemant Pin
BillWoodruff8-Jan-14 20:35
professionalBillWoodruff8-Jan-14 20:35 
GeneralRe: If else statemant Pin
manoj s sherje8-Jan-14 22:03
manoj s sherje8-Jan-14 22:03 
Thanks sir ,
i ma drop my code i have need to check multiple condition and i want immense my code but many time i have need to wrote one line more time please check
nothing any issue regarding if else statement i am only try to make minimize my code and time if you have time please check

----------------
Dim es As Input.KeyEventArgs
If String.IsNullOrEmpty(txt_pname.Text) Then
comlibobj.msg("Please Enter Name", "Warning")
e.Handled = True
Else
cmd = New SqlCommand("", sqlcn)
cmd.CommandType = CommandType.StoredProcedure
Dim flag As String = ""
Dim schcmd As New SqlCommand("SELECT * FROM mschemst WHERE scode='" + txt_pcode.Text + "'", sqlcn)
Dim schrd As SqlDataReader = schcmd.ExecuteReader
While schrd.Read
Dim sxm As String = schrd("scode")
If sxm.Count > 0 Then
userCh = "Modify"
End If
If txt_schfree1.Text = "0" And txt_schfree2.Text = "0" And txt_schfree3.Text = "0" And txt_schqty1.Text = "0" And txt_schqty1.Text = "0" And txt_schqty2.Text = "0" And txt_schqty3.Text = "0" Then
userCh = "Delete"
End If
End While
schrd.Close()
If txt_batchcode.Text.Count > 0 Then
Batchno = txt_batchcode.Text
Else
Batchno = Batchno
End If
If userCh = "Add New" Then
flag = "A"
ElseIf userCh = "Modify" Then
flag = "M"
ElseIf userCh = "Delete" Then
flag = "D"
End If
batch = ""
batch = DirectCast(cmb_batch.SelectedItem, ComboBoxItem).Content.ToString()
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))

If cmb_batch.Visibility = Windows.Visibility.Visible Then
If cmb_batch.Visibility = Windows.Visibility.Visible And cmb_batch.SelectedIndex = 0 Then
System.Windows.MessageBox.Show("Please Select Batch If use Batch Wise Product And enable Select Bacth")
Else
If cmb_batch.SelectedIndex = 1 Then
cmd = New SqlCommand("SELECT BATCHNO FROM mbachmst WHERE BCODE='" + txt_pcode.Text + "'", sqlcn)
rdr = cmd.ExecuteReader
While rdr.Read
Batchno = rdr("BATCHNO").ToString
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
End While
rdr.Close()
Me.Close()
comlibobj.upd()
ElseIf cmb_batch.SelectedIndex = 2 Then
If String.IsNullOrEmpty(txt_batchcode.Text) Then
System.Windows.MessageBox.Show("Batch Cod Field Is blank Please Select Batch")
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
End If
End If
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
GeneralRe: If else statemant Pin
OriginalGriff8-Jan-14 22:12
mveOriginalGriff8-Jan-14 22:12 
GeneralRe: If else statemant Pin
V.8-Jan-14 23:50
professionalV.8-Jan-14 23:50 
GeneralRe: If else statemant Pin
manoj s sherje13-Jan-14 18:10
manoj s sherje13-Jan-14 18:10 
AnswerRe: If else statemant Pin
CPallini8-Jan-14 21:10
mveCPallini8-Jan-14 21:10 
AnswerRe: If else statemant Pin
Rahul VB31-Jan-14 7:06
professionalRahul VB31-Jan-14 7:06 
QuestionSprite Animation and Movement in XNA Pin
incxx8-Jan-14 11:04
incxx8-Jan-14 11:04 
AnswerRe: Sprite Animation and Movement in XNA Pin
Bernhard Hiller8-Jan-14 20:34
Bernhard Hiller8-Jan-14 20:34 
GeneralRe: Sprite Animation and Movement in XNA Pin
incxx10-Jan-14 5:55
incxx10-Jan-14 5:55 
QuestionRFID read and write on sql server using c# Pin
sandsip7-Jan-14 20:50
sandsip7-Jan-14 20:50 
AnswerRe: RFID read and write on sql server using c# Pin
Peter Leow7-Jan-14 21:05
professionalPeter Leow7-Jan-14 21:05 
AnswerRe: RFID read and write on sql server using c# Pin
Eddy Vluggen7-Jan-14 22:32
professionalEddy Vluggen7-Jan-14 22:32 
AnswerRe: RFID read and write on sql server using c# Pin
Marco Bertschi7-Jan-14 23:06
protectorMarco Bertschi7-Jan-14 23:06 
GeneralRe: RFID read and write on sql server using c# Pin
Eddy Vluggen8-Jan-14 0:32
professionalEddy Vluggen8-Jan-14 0:32 
GeneralRe: RFID read and write on sql server using c# Pin
Marco Bertschi8-Jan-14 1:55
protectorMarco Bertschi8-Jan-14 1:55 
AnswerRe: RFID read and write on sql server using c# Pin
David Knechtges8-Jan-14 3:24
David Knechtges8-Jan-14 3:24 
AnswerRe: RFID read and write on sql server using c# Pin
Bernhard Hiller8-Jan-14 20:38
Bernhard Hiller8-Jan-14 20:38 
QuestionNeed help with Floor detection using depth information Pin
erdij7-Jan-14 13:11
professionalerdij7-Jan-14 13:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.