Sub common_Click
Try
showadint = showadint + 1
If showadint >= 8 Then
showadint = 0
csu.CallSubDelayedPlus(Me,"showad",1000)
End If
Dim b As Button = Sender
Select b.Tag
Case "clock"
loadwindow("clockin")
Case "shifts"
loadwindow("shift")
Case "wage"
setvaluesforsalaryinfo
csu.CallSubDelayedPlus(Me,"opensalinfo",250)
Case "settings"
settingsmod.Show
Case "excel"
If shiftsclv.GetSize = 0 Then
HUD1.ToastMessageShow("אין משמרות לחודש " & shiftfatebtn.Text, False)
Return
End If
'export to csv file
Dim items As List
items.Initialize
DateTime.TimeFormat = "HH:mm"
DateTime.DateFormat = "dd/MM/yyyy"
Dim line1() As String
line1 = Array As String("Date", "In", "Out", "Break", "Daily Spend", "Daily Bonus", "Time", "Wage")
items.Add(line1)
Dim totaltime As Int = 0
Dim totalwage As Double = 0
For i = 0 To shiftsclv.GetSize-1
Dim p As Panel = shiftsclv.GetPanel(i)
Dim newshift As shift = allshift.Get(p.Tag)
Dim row() As String
row = Array As String(DateTime.Date(newshift.timein),DateTime.Time(newshift.timein),DateTime.Time(newshift.timeout),newshift.breaktime,newshift.dayspend,newshift.bonus,Floor(newshift.totalminutes/60) & ":" & NumberFormat2(newshift.totalminutes Mod 60,2,0,0,False),NumberFormat2(newshift.totalwage,1,2,2,Null))
items.Add(row)
totaltime = totaltime + newshift.totalminutes
totalwage = totalwage + newshift.totalwage
Next
line1 = Array As String("", "", "", "", "", "", "", "")
items.Add(line1)
items.Add(line1)
line1 = Array As String("", "", "", "", "", "", "Total Hours", "Total Wage")
items.Add(line1)
line1 = Array As String("", "", "", "", "", "", Floor(totaltime/60) & ":" & NumberFormat2(totaltime Mod 60, 2,0,0,Null), NumberFormat2(totalwage,1,2,2,Null))
items.Add(line1)
SaveData(items, shiftfatebtn.Text.Replace("/","_"))
Dim mailc As MailComposer
mailc.Initialize("mailc")
mailc.SetToRecipients(Array(""))' Array("[email protected]", "[email protected]"))
mailc.SetSubject("שכרניק - דוח שעות")
mailc.SetBody("דוח שעות לחודש " & shiftfatebtn.Text.Replace("/","_"), True)
mailc.AddAttachment(File.DirDocuments,shiftfatebtn.Text.Replace("/","_") & ".csv", "text/plain")
mailc.Show(Page1)
Case "contact"
DateTime.DateFormat = "dd/MM/yyyy"
Dim mailc As MailComposer
mailc.Initialize("mailc")
mailc.SetToRecipients(Array("[email protected]"))' Array("[email protected]", "[email protected]"))
mailc.SetSubject("משוב - שכרניק לאייפון")
mailc.SetBody(",תאריך: " & DateTime.Date(DateTime.Now), True)
mailc.Show(Page1)
Case "accounts"
Private ashPages As ActionSheet
ashPages.Initialize("account", "חשבון", "ביטול", "", Array As String("עבודה 1", "עבודה 2", "עבודה 3", "עבודה 4"))
ashPages.Show(Page1.RootPanel)
Case "share"
Try
Dim txt As String = "%D7%94%D7%9E%D7%97%D7%A9%D7%91%D7%95%D7%9F+%D7%94%D7%A9%D7%9B%D7%A8+%D7%94%D7%9B%D7%99+%D7%97%D7%9B%D7%9D+%D7%95%D7%94%D7%9B%D7%99+%D7%9E%D7%93%D7%95%D7%99%D7%99%D7%A7+%D7%A9%D7%9B%D7%A8%D7%A0%D7%99%D7%A7+%D7%94%D7%92%D7%99%D7%A2+%D7%92%D7%9D+%D7%9C%D7%90%D7%99%D7%99%D7%A4%D7%95%D7%9F%2C+%D7%91%D7%95%D7%90%D7%95+%D7%AA%D7%95%D7%A8%D7%99%D7%93%D7%95+%D7%90%D7%95%D7%AA%D7%95+%D7%A2%D7%95%D7%93+%D7%91%D7%99%D7%95%D7%9D+%D7%91%D7%97%D7%99%D7%A0%D7%9D%0D%0Ahttps%3A%2F%2Fitunes.apple.com%2Fus%2FApp%2Fskrnyq-mhsbwn-skr%2Fid950196740%3Fmt%3D8"
Dim txtmail As String = " המחשבון השכר הכי חכם והכי מדוייק שכרניק הגיע גם לאייפון, בואו תורידו אותו עוד ביום בחינם!" & CRLF & "https://itunes.apple.com/us/App/skrnyq-mhsbwn-skr/id950196740?mt=8"
Dim url As String = "whatsapp://send?text=" & txt
If App.CanOpenUrl(url) Then
App.OpenUrl(url)
Else
Log("send email")
Dim mailc As MailComposer
mailc.Initialize("mailc")
mailc.SetToRecipients(Array(""))' Array("[email protected]", "[email protected]"))
mailc.SetSubject("משוב - שכרניק לאייפון")
mailc.SetBody(txtmail, True)
mailc.Show(Page1)
End If
Catch
Log(LastException)
HUD1.ToastMessageShow("לא היה ניתן לשתף","שגיאה")
End Try
Case "law"
loadwindow("lawpnl")
Case "like"
If App.CanOpenURL("https://itunes.apple.com/us/app/skrnyq-mhsbwn-skr/id950196740?mt=8") Then
App.OpenURL("https://itunes.apple.com/us/app/skrnyq-mhsbwn-skr/id950196740?mt=8")
Else
HUD1.ToastMessageShow("לא היה ניתן לפתוח עמוד","שגיאה")
End If
Case "backup"
If backuppnl.Alpha = 1 Then Return
backuppnl.Left = 0
backuppnl.Top = 0
backuppnl.Alpha = 0
backuppnl.Visible = True
backuppnl.BringToFront
backuppnl.SetAlphaAnimated(250,1)
Case "help"
Private ashPages As ActionSheet
ashPages.Initialize("helplist", "עזרה", "ביטול", "", Array As String("הגדרת משמרת" ,"פירוט שכר" ,"דוח אקסל" ,"הפסקה קבועה"))
ashPages.Show(Page1.RootPanel)
Case "shop"
Private ashPages As ActionSheet
ashPages.Initialize("shoping", "הסרת פרסומות", "ביטול", "", Array As String("רכוש חבילה", "שחזר רכישה"))
ashPages.Show(Page1.RootPanel)
End Select
Catch
Log(LastException)
sendreport.SendMessage("mysalarycrashesios", "", "IOS-main: common_Click|" & LastException)
End Try
End Sub