Example #1
0
    protected void ShiftEmployee()
    {
        ShiftsEmployee se       = new ShiftsEmployee();
        List <string>  listE    = new List <string>();
        List <string>  listE2   = new List <string>();
        int            emp      = Convert.ToInt32((string)Session["userID"]);
        string         tempList = se.getShiftsAfterEditing(emp);

        string[] arrayList = tempList.Split('/');
        listE = arrayList[0].Split(',').ToList <string>();
        foreach (string shift in listE)
        {
            ListItem l = new ListItem();
            if (shift == "11")
            {
                l = new ListItem("ראשון בוקר (שבוע הבא)", "11n");
            }
            else if (shift == "12")
            {
                l = new ListItem("ראשון אמצע (שבוע הבא)", "12n");
            }
            else if (shift == "13")
            {
                l = new ListItem("ראשון ערב (שבוע הבא)", "13n");
            }
            else if (shift == "21")
            {
                l = new ListItem("שני בוקר (שבוע הבא)", "21n");
            }
            else if (shift == "22")
            {
                l = new ListItem("שני אמצע (שבוע הבא)", "22n");
            }
            else if (shift == "23")
            {
                l = new ListItem("שני ערב (שבוע הבא)", "22n");
            }
            else if (shift == "31")
            {
                l = new ListItem("שלישי בוקר (שבוע הבא)", "32n");
            }
            else if (shift == "32")
            {
                l = new ListItem("שלישי אמצע (שבוע הבא)", "32n");
            }
            else if (shift == "33")
            {
                l = new ListItem("שלישי ערב (שבוע הבא)", "32n");
            }
            else if (shift == "41")
            {
                l = new ListItem("רביעי בוקר (שבוע הבא)", "42n");
            }
            else if (shift == "42")
            {
                l = new ListItem("רביעי אמצע (שבוע הבא)", "42n");
            }
            else if (shift == "43")
            {
                l = new ListItem("רביעי ערב (שבוע הבא)", "42n");
            }
            else if (shift == "51")
            {
                l = new ListItem("חמישי בוקר (שבוע הבא)", "51n");
            }
            else if (shift == "52")
            {
                l = new ListItem("חמישי אמצע (שבוע הבא)", "52n");
            }
            else if (shift == "53")
            {
                l = new ListItem("חמישי ערב (שבוע הבא)", "53n");
            }
            else if (shift == "61")
            {
                l = new ListItem("שישי בוקר (שבוע הבא)", "61n");
            }
            else if (shift == "71")
            {
                l = new ListItem("צאת שבת (שבוע הבא)", "73n");
            }
            DropDownList1.Items.Add(l);
        }
        if (arrayList.Length > 1)
        {
            listE2 = arrayList[1].Split(',').ToList <string>();
            foreach (string shift in listE2)
            {
                ListItem l = new ListItem();
                if (shift == "11")
                {
                    l = new ListItem("ראשון בוקר (השבוע)", "11w");
                }
                else if (shift == "12")
                {
                    l = new ListItem("ראשון אמצע (השבוע)", "12w");
                }
                else if (shift == "13")
                {
                    l = new ListItem("ראשון ערב (השבוע)", "13w");
                }
                else if (shift == "21")
                {
                    l = new ListItem("שני בוקר (השבוע)", "21w");
                }
                else if (shift == "22")
                {
                    l = new ListItem("שני אמצע (השבוע)", "22w");
                }
                else if (shift == "23")
                {
                    l = new ListItem("שני ערב (השבוע)", "22w");
                }
                else if (shift == "31")
                {
                    l = new ListItem("שלישי בוקר (השבוע)", "32w");
                }
                else if (shift == "32")
                {
                    l = new ListItem("שלישי אמצע (השבוע)", "32w");
                }
                else if (shift == "33")
                {
                    l = new ListItem("שלישי ערב (השבוע)", "32w");
                }
                else if (shift == "41")
                {
                    l = new ListItem("רביעי בוקר (השבוע)", "42w");
                }
                else if (shift == "42")
                {
                    l = new ListItem("רביעי אמצע (השבוע)", "42w");
                }
                else if (shift == "43")
                {
                    l = new ListItem("רביעי ערב (השבוע)", "42w");
                }
                else if (shift == "51")
                {
                    l = new ListItem("חמישי בוקר (השבוע)", "51w");
                }
                else if (shift == "52")
                {
                    l = new ListItem("חמישי אמצע (השבוע)", "52w");
                }
                else if (shift == "53")
                {
                    l = new ListItem("חמישי ערב (השבוע)", "53w");
                }
                else if (shift == "61")
                {
                    l = new ListItem("שישי בוקר (השבוע)", "61w");
                }
                else if (shift == "71")
                {
                    l = new ListItem("צאת שבת (השבוע)", "73w");
                }
                DropDownList1.Items.Add(l);
            }
        }
    }