Esempio n. 1
0
        public EditWPN(int idw, bool viewOnly)
        {
            InitializeComponent();
            if (viewOnly)
            {
                this.viewonly            = viewOnly;
                button2.Visible          = false;
                this.Text                = "Просмотр сведений об изделии";
                tbName.ReadOnly          = true;
                tbNote.ReadOnly          = true;
                tbPowerSupply.ReadOnly   = true;
                tbDecNum.ReadOnly        = true;
                tbConfiguration.ReadOnly = true;
                cbCategory.Enabled       = false;
                cbSubCategory.Enabled    = false;
            }
            this.IDW = idw;
            DBWPName dbwp = new DBWPName();
            WPNameVO wp   = WPNameVO.WPNameVOByID(this.IDW);

            tbName.Text = wp.WPName;
            cbCategory.SelectedValue    = wp.IDCat;
            cbSubCategory.SelectedValue = wp.IDSubCat;
            tbDecNum.Text        = wp.DecNum;
            tbPowerSupply.Text   = wp.PowerSupply;
            tbConfiguration.Text = wp.CONFIGURATION;
            tbNote.Text          = wp.Note;
        }
Esempio n. 2
0
        private void bEdit_Click(object sender, EventArgs e)//редактировать
        {
            PreviousState ps = new PreviousState(dgWP);

            if (cbPRODUCTTYPE.SelectedIndex == 0)
            {
                NewWPN ew = new NewWPN(WPNameVO.WPNameVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "EDIT", UVO);
                ew.ShowDialog();
            }
            if (cbPRODUCTTYPE.SelectedIndex == 1)
            {
                NewZHGUT ew = new NewZHGUT(ZhgutVO.GetZhgutVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "EDIT", UVO);
                ew.ShowDialog();
            }
            if (cbPRODUCTTYPE.SelectedIndex == 2)
            {
                NewCABLE ew = new NewCABLE(CableVO.GetCableVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "EDIT", UVO);
                ew.ShowDialog();
            }
            int idsub = (cbSubCat.SelectedValue != null) ? (int)cbSubCat.SelectedValue : 0;

            cbCAT_SelectedIndexChanged(sender, e);
            cbSubCat.SelectedValue = idsub;
            ps.Restore();
        }
Esempio n. 3
0
        private void bGoToWP_Click(object sender, EventArgs e)
        {
            if (dgWP.SelectedRows.Count != 1)
            {
                MessageBox.Show("Не выбрано ни одной строки!");
                return;
            }

            IProduct pr = WPNameVO.WPNameVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["IDWP"].Value));

            pr.ViewOnly(UVO);
            Remarks_Load(sender, e);
        }
Esempio n. 4
0
        private void EditWPN_Load(object sender, EventArgs e)
        {
            DBCategory dbc = new DBCategory("WPNAMELIST");

            cbCategory.ValueMember   = "ID";
            cbCategory.DisplayMember = "CATEGORYNAME";
            cbCategory.DataSource    = dbc.GetAllExceptAll();

            DBWPName dbwp = new DBWPName();
            WPNameVO wp   = WPNameVO.WPNameVOByID(this.IDW);

            cbCategory.SelectedValue = wp.IDCat;

            LoadSubs((int)cbCategory.SelectedValue);
        }
Esempio n. 5
0
        private void LoadSubs(int idCat)
        {
            if ((idCat == 1) || (idCat == 2))
            {
                cbSubCategory.Text    = "";
                cbSubCategory.Enabled = false;
            }
            if (!viewonly)
            {
                cbSubCategory.Enabled = true;
            }
            DBSubCategory dbs = new DBSubCategory();

            cbSubCategory.ValueMember   = "ID";
            cbSubCategory.DisplayMember = "SUBCATNAME";
            cbSubCategory.DataSource    = dbs.GetAllExceptAll(idCat);

            DBWPName dbwp = new DBWPName();
            WPNameVO wp   = WPNameVO.WPNameVOByID(this.IDW);

            cbSubCategory.SelectedValue = wp.IDSubCat;
        }
Esempio n. 6
0
 private void bView_Click(object sender, EventArgs e)//просмотр
 {
     if (dgWP.SelectedRows.Count == 0)
     {
         return;
     }
     if (cbPRODUCTTYPE.SelectedIndex == 0)
     {
         NewWPN ew = new NewWPN(WPNameVO.WPNameVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "VIEWONLY", UVO);
         ew.ShowDialog();
     }
     if (cbPRODUCTTYPE.SelectedIndex == 1)
     {
         NewZHGUT ew = new NewZHGUT(ZhgutVO.GetZhgutVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "VIEWONLY", UVO);
         ew.ShowDialog();
     }
     if (cbPRODUCTTYPE.SelectedIndex == 2)
     {
         NewCABLE ew = new NewCABLE(CableVO.GetCableVOByID(Convert.ToInt32(dgWP.SelectedRows[0].Cells["ID"].Value)), "VIEWONLY", UVO);
         ew.ShowDialog();
     }
 }