Exemple #1
0
        private void chkLevel_Checked(object sender, RoutedEventArgs e)
        {
            CheckBox objCheck = (CheckBox)sender;

            //bool isParking = false;
            int    floor      = 0;
            string enableType = objCheck.Name.Split('_')[0];

            //isParking = objCheck.Name.Split('_')[0]=="P";
            floor = Convert.ToInt32(objCheck.Name.Split('_')[1]);
            bool isBlocked = !(bool)objCheck.IsChecked;

            // P_1
            if (enableType == "P") //parking
            {
                objGeneralDba.UpdateParkFloorStatus(floor, isBlocked);
                objCheck.IsChecked = !objGeneralDba.GetParkFloorStatus(floor);
            }
            else if (enableType == "FPM")  //pallet feeding
            {
                objGeneralDba.UpdatePMSFeedFloorStatus(floor, isBlocked);
                objCheck.IsChecked = !objGeneralDba.GetPMSFeedFloorStatus(floor);
            }
            else if (enableType == "SPM") //pallet storing
            {
                objGeneralDba.UpdatePMSStoreFloorStatus(floor, isBlocked);
                objCheck.IsChecked = !objGeneralDba.GetPMSStoreFloorStatus(floor);
            }
        }