Ejemplo n.º 1
0
        private void SetSalaryItemElement(SalaryItem salaryItem, TeacherSalary teacherSalary)
        {
            if (teacherSalary != null && teacherSalary.GetSalaryInItemElements() != null)
            {
                foreach (SalaryItemElement salaryItemElement in teacherSalary.GetSalaryInItemElements())
                {
                    if (salaryItem.salaryItemId.ToString() == salaryItemElement.salaryItemId) {
                        SalaryItemElement element = new SalaryItemElement();
                        if (int.Parse(string.Format("{0:0}", salaryItemElement.times)) != 0)
                        {
                            element.times = salaryItemElement.times / salaryItemElement.MonthNum;
                            element.times = CommonUtility.ConvertFormatedFloat("{0:F2}", element.times.ToString());
                        }
                        if (salaryItemElement.salaryStandard != 0)
                        {
                            element.salaryStandard = salaryItemElement.salaryStandard;
                        }
                        else if (salaryItemElement.itemCost != 0) {
                            element.salaryStandard = salaryItemElement.itemCost / salaryItemElement.MonthNum;
                            element.salaryStandard = CommonUtility.ConvertFormatedFloat("{0:F2}", element.salaryStandard.ToString());
                        }

                        salaryItem.salaryItemElement = element;
                        break;
                    }
                }
            }
            if (salaryItem.salaryItemElement == null)
            {
                SalaryItemElement element = new SalaryItemElement();
                element.salaryStandard = 1;
                element.times = 1;
            }
        }
Ejemplo n.º 2
0
        private List<SalaryItemElement> ReBuildSalaryItemElementCommon(string salaryItemValueList)
        {
            List<SalaryItemElement> salaryItemElements = null;

            if (salaryItemValueList != null && salaryItemValueList.Trim().Length > 0)
            {
                string[] salaryItemValues = salaryItemValueList.Split(';');
                if (salaryItemValues.Length > 0)
                {
                    salaryItemElements = new List<SalaryItemElement>();
                    int length = salaryItemValues.Length;
                    for (int i = 0; i < length; i++)
                    {
                        SalaryItemElement element = new SalaryItemElement();
                        string[] itemValue = salaryItemValues[i].Split(':');
                        element.salaryItemId = itemValue[0];
                        string[] itemValueElements = itemValue[1].Split(',');
                        element.salaryStandard = float.Parse(itemValueElements[0]);
                        element.times = float.Parse(itemValueElements[1]);
                        element.itemCost = float.Parse(itemValueElements[2]);
                        element.MonthNum = int.Parse(itemValueElements[3]);
                        element.hasTax = int.Parse(itemValueElements[4]) == 1;
                        salaryItemElements.Add(element);
                    }
                }
            }
            return salaryItemElements;
        }
Ejemplo n.º 3
0
        private List<SalaryItemElement> ReBuildSalaryItemElementCommon(string salaryItemValueList)
        {
            List<SalaryItemElement> salaryItemElements = null;

            if (salaryItemValueList != null && salaryItemValueList.Trim().Length > 0)
            {
                string[] salaryItemValues = salaryItemValueList.Split(';');
                if (salaryItemValues.Length > 0)
                {
                    salaryItemElements = new List<SalaryItemElement>();
                    int length = salaryItemValues.Length;
                    for (int i = 0; i < length; i++)
                    {
                        SalaryItemElement element = new SalaryItemElement();
                        string[] itemValue = salaryItemValues[i].Split(':');
                        element.salaryItemId = itemValue[0];
                        string[] itemValueElements = itemValue[1].Split(',');
                        element.salaryStandard = float.Parse(itemValueElements[0]);
                        element.times = float.Parse(itemValueElements[1]);
                        element.adjustFactor = float.Parse(itemValueElements[2]);
                        element.itemCost = element.salaryStandard * element.times * element.adjustFactor;
                        element.itemCost = float.Parse(string.Format("{0:0.00}", element.itemCost));

                        salaryItemElements.Add(element);
                    }
                }
            }
            return salaryItemElements;
        }