Beispiel #1
0
        public static void Invoke_InputPanel_Ctl_Enabled(C1InputPanel inp, bool enabled)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputPanel_Ctl_Enabled(Invoke_InputPanel_Ctl_Enabled), new object[] { inp, enabled });
                return;
            }



            foreach (InputComponent c in inp.Items)
            {
                c.Enabled = enabled;
            }
        }
Beispiel #2
0
        /// <summary>
        /// inputpannel 그룹에 선택된 그룹만 보이게 한다.
        /// </summary>
        /// <param name="inp"></param>
        /// <param name="strGrpNames"></param>
        public static void Invoke_InputPanel_Group_Collapsed(C1InputPanel inp, string [] strGrpNames)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputPanel_Group_Collapsed(Invoke_InputPanel_Group_Collapsed), new object[] { inp, strGrpNames });
                return;
            }



            InputGroupHeader grp = null;

            //일단 전부 않보이게..
            foreach (InputComponent c in inp.Items)
            {
                grp = c as InputGroupHeader;

                if (grp != null)
                {
                    grp.Height     = 0;
                    grp.Collapsed  = true;
                    grp.Visibility = C1.Win.C1InputPanel.Visibility.Hidden;
                }
            }


            //대상만 보이게..
            foreach (InputComponent c in inp.Items)
            {
                grp = c as InputGroupHeader;

                if (grp != null)
                {
                    foreach (string strGrpName in strGrpNames)
                    {
                        if (grp.Name == strGrpName)
                        {
                            //grp.Height = -1;
                            grp.Collapsed  = false;
                            grp.Visibility = C1.Win.C1InputPanel.Visibility.Visible;
                            break;
                        }
                    }
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// InputComboBox에 string 배열의 값을 item으로 추가한다.
        /// </summary>
        /// <param name="inp"></param>
        /// <param name="cmb"></param>
        /// <param name="strItems"></param>
        /// <returns></returns>
        public static void Invoke_InputComboBox_Items_AddItems(C1InputPanel inp,
                                                               C1.Win.C1InputPanel.InputComboBox cmb, string[] strItems)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputComboBox_Items_AddItems(Invoke_InputComboBox_Items_AddItems), new object[] { inp, cmb, strItems });
                return;
            }

            InputOption io;

            foreach (string str in strItems)
            {
                io = new InputOption(str);
                cmb.Items.Add(io);
            }
        }
Beispiel #4
0
        /// <summary>
        /// InputComboBox에 string 배열의 값을 Group으로 추가한다.
        /// </summary>
        /// <param name="inp"></param>
        /// <param name="cmb"></param>
        /// <param name="strItems"></param>
        /// <returns></returns>
        public static void Invoke_InputComboBox_Items_AddGroups(C1InputPanel inp,
                                                                C1.Win.C1InputPanel.InputComboBox cmb, string[] strGroups)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputComboBox_Items_AddItems(Invoke_InputComboBox_Items_AddGroups), new object[] { inp, cmb, strGroups });
                return;
            }

            InputGroupHeader ig;

            foreach (string str in strGroups)
            {
                ig      = new InputGroupHeader();
                ig.Text = str;
                cmb.Items.Add(ig);
            }
        }
Beispiel #5
0
        /// <summary>
        /// InputComboBox에 값을 선택한다.
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="strField"></param>
        public static void Invoke_InputComboBox_SetSelectedValue(C1InputPanel inp,
                                                                 C1.Win.C1InputPanel.InputComboBox cmb, string strValue)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputComboBox_SetSelectedValue(Invoke_InputComboBox_SetSelectedValue), new object[] { inp, cmb, strValue });
                return;
            }

            if (cmb.DataSource != null)
            {
                foreach (DataRowView dr in ((DataTable)cmb.DataSource).DefaultView)
                {
                    if (dr[cmb.DisplayMember].ToString() == strValue)
                    {
                        cmb.SelectedValue = dr;
                        return;
                    }
                }

                cmb.SelectedIndex = -1;
            }
            else
            {
                InputOption io;
                foreach (InputComponent i in cmb.Items)
                {
                    io = i as InputOption;
                    if (io != null)
                    {
                        if (io.Text == strValue)
                        {
                            cmb.SelectedOption = io;
                            return;
                        }
                    }
                }
                cmb.SelectedIndex = -1;
            }
        }
Beispiel #6
0
        /// <summary>
        /// InputComboBox에 값을 선택한다.
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="strField"></param>
        public static void Invoke_InputComboBox_SetSelectedValue(C1InputPanel inp,
                                                                 C1.Win.C1InputPanel.InputComboBox cmb, string strField, string strValue)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputComboBox_SetSelectedValue2(Invoke_InputComboBox_SetSelectedValue), new object[] { inp, cmb, strField, strValue });
                return;
            }

            if (cmb.DataSource != null)
            {
                DataView dv;

                DataTable dt = cmb.DataSource as DataTable;


                if (dt != null)
                {
                    dv = dt.DefaultView;
                }
                else
                {
                    dv = cmb.DataSource as DataView;
                }


                foreach (DataRowView dr in dv)
                {
                    if (dr[strField].ToString().Trim() == strValue)
                    {
                        Application.DoEvents();
                        cmb.SelectedValue = dr;
                        return;
                    }
                }

                cmb.SelectedIndex = -1;
            }
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inp"></param>
        /// <returns></returns>
        public static void Invoke_InputPanel_Reset(C1InputPanel inp)
        {
            if (inp.InvokeRequired)
            {
                inp.Invoke(new delInvoke_InputPanel_Reset(Invoke_InputPanel_Reset), new object[] { inp });
                return;
            }

            foreach (InputComponent ctl in inp.Items)
            {
                InputDatePicker dt = ctl as InputDatePicker;
                if (dt != null)
                {
                    dt.ValueIsNull = true;
                    continue;
                }

                InputTimePicker tm = ctl as InputTimePicker;
                if (tm != null)
                {
                    tm.ValueIsNull = true;
                    continue;
                }

                InputTextBox txt = ctl as InputTextBox;
                if (txt != null)
                {
                    txt.Text = string.Empty;
                    continue;
                }

                InputComboBox cmb = ctl as InputComboBox;
                if (cmb != null)
                {
                    cmb.SelectedIndex = -1;
                    continue;
                }
            }
        }