Ejemplo n.º 1
0
    public void SetDepartment(string value)
    {
        value = value.Trim();
        if (String.IsNullOrEmpty(value))
        {
            DepartmentID1 = null;
            DepartmentID2 = null;
            DepartmentID3 = null;
        }
        else
        {
            Department g = DepartmentBLL.GetByFullname(value);
            if (g == null)
            {
                throw new Exception("Nhập sai triệu chứng.");
            }
            else
            {
                DepartmentID1 = null;
                DepartmentID2 = null;
                DepartmentID3 = null;

                if (g.Level == 1)
                {
                    DepartmentID1 = g.ID;
                }

                if (g.Level == 2)
                {
                    DepartmentID2 = g.ID;
                    DepartmentID1 = g.ParentDepartment.ID;
                }

                if (g.Level == 3)
                {
                    DepartmentID3 = g.ID;
                    DepartmentID2 = g.ParentDepartment.ID;
                    DepartmentID1 = g.ParentDepartment.ParentDepartment.ID;
                }
            }
        }
    }