Exemple #1
0
 private void ReadOnlyText(Panel panelBase, FormMode mode)
 {
     foreach (Control component in panelBase.Controls)
     {
         if (component is TextBox)
         {
             if (((TextBox)component).AccessibleDescription == null ||
                 !((TextBox)component).AccessibleDescription.ToString().Contains("block"))
             {
                 ((TextBox)component).ReadOnly = mode.Equals(FormMode.EDITOR)? false:true;
             }
         }
         if (component is Button)
         {
             if (component.Tag != null && component.Tag.ToString().Contains("frm"))
             {
                 ((Button)component).Enabled = mode.Equals(FormMode.EDITOR) ? true : false;
             }
         }
         if (component is CheckBox)
         {
             ((CheckBox)component).Enabled = mode.Equals(FormMode.EDITOR) ? true : false;
         }
         if (component is ComboBox)
         {
             ((ComboBox)component).Enabled = mode.Equals(FormMode.EDITOR) ? true : false;
         }
         if (component is Panel)
         {
             ReadOnlyText(((Panel)component), mode);
         }
         if (component is FlowLayoutPanel)
         {
             ReadOnlyText((Panel)component, mode);
         }
     }
 }
        private void F12()
        {
            if (ErrorCheck())
            {
                string confirmMessageID = FormMode.Equals("削除") ? "Q102" : "Q101";
                string msg = DSP_MSG(confirmMessageID, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);

                if (msg.Equals("1"))
                {
                    if (ExecutionProcess())
                    {
                        Clear();
                    }
                    else
                    {
                        DSP_MSG("E015", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    }
                }
            }
        }
        private void SetMaker_Data(string comCode)

        {
            MakerZaiko_D_Entity   maker_D_data = new MakerZaiko_D_Entity();
            M_NoukiHenkan_Entity  nouki_data   = new M_NoukiHenkan_Entity();
            M_MakerZaiko_H_Entity maker_H_data = new M_MakerZaiko_H_Entity();
            SuuryoHenKan_Entity   suuryo_data  = new SuuryoHenKan_Entity();
            PSKS0101M_BL          sks0101m_bl  = new PSKS0101M_BL();
            DataTable             dtmakerD     = new DataTable();
            DataTable             dtnoukidata  = new DataTable();
            DataTable             dtsuuryodata = new DataTable();

            if (!FormMode.Equals("新規"))
            {
                txtPatternName.Text = ucPattern.UC_Name;
            }

            maker_D_data.PatternCD = comCode;
            nouki_data.PatternCD   = comCode;
            maker_H_data.PatternCD = comCode;
            suuryo_data.PatternCD  = comCode;

            dtmakerD     = sks0101m_bl.MakerZaiko_Select(maker_D_data);
            dtnoukidata  = sks0101m_bl.Nouki_Select(nouki_data);
            dtsuuryodata = sks0101m_bl.Suuryo_Select(suuryo_data);

            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtnoukidata.Select("SEQ = '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtnoukidata.NewRow();
                    dr["SEQ"] = i.ToString();

                    dtnoukidata.Rows.Add(dr);

                    DataView dv = dtnoukidata.DefaultView;
                    dv.Sort = "SEQ ASC";
                    dtNouki = dv.ToTable();
                }
            }
            dtNouki = dtnoukidata;
            dgvdelivery.DataSource = dtNouki;


            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtmakerD.Select("SEQ = '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtmakerD.NewRow();
                    dr["SEQ"] = i.ToString();

                    dtmakerD.Rows.Add(dr);

                    DataView dv = dtmakerD.DefaultView;
                    dv.Sort  = "SEQ ASC";
                    dtmakerD = dv.ToTable();
                }
            }
            dtKaMoku             = dtmakerD;
            dgvKamoku.DataSource = dtKaMoku;

            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtsuuryodata.Select("SEQ= '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtsuuryodata.NewRow();
                    dr["SEQ"] = i.ToString();
                    dtsuuryodata.Rows.Add(dr);
                    DataView dv = dtsuuryodata.DefaultView;
                    dv.Sort      = "SEQ ASC ";
                    dtsuuryodata = dv.ToTable();
                }
            }
            dtSuuryo = dtsuuryodata;
            dgvSuuryoHenKan.DataSource = dtsuuryodata;

            ucPattern.SetFocus();
        }