-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSalaryAditional.swift
49 lines (39 loc) · 1.19 KB
/
SalaryAditional.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// SalaryAditional.swift
// ShiftMaster
//
// Created by Yair Levi on 8/12/14.
// Copyright (c) 2014 BarLeviSoft. All rights reserved.
//
import Foundation
class SalaryAditional{
enum AdditionalType : String {
case Monthly = "Monthly", Weekly = "Weekly", Dayly = "Dayly"
static let allValues = [Monthly, Weekly, Dayly]
}
var Description:String
var Amount:Int
var Type:AdditionalType
init(properties:String){
let propArray = properties.componentsSeparatedByString("$")
Description = propArray[0]
Amount = propArray[1].toInt()!
Type = AdditionalType.fromRaw(propArray[2])!
}
init(description:String, amount:Int, type:AdditionalType){
Description = description
Amount = amount
Type = type
}
class func StringCreator(array:[SalaryAditional]) -> [String]{
var strArr:[String] = []
for item in array{
var str:String = ""
str += item.Description + "$"
str += String(item.Amount) + "$"
str += item.Type.toRaw()
strArr.append(str)
}
return strArr;
}
}