Beispiel #1
0
        /// <summary>
        /// 修改库存自定义属性
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bbtnModifyProp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            StockProp sp = gridViewStockProp.GetFocusedRow() as StockProp;

            if (sp != null)
            {
                string cid         = textCatCode.Text;
                string catName     = textCatName.Text;
                string fParentPid  = sp.ParentPid;
                string fParentName = string.Empty;
                if (fParentPid != "0")
                {
                    fParentName = StockPropService.GetStockProp(sp.ParentPid).Name;
                }
                string fParentVid       = sp.ParentVid;
                string fParentValueName = string.Empty;
                if (fParentVid != "0")
                {
                    fParentValueName = StockPropValueService.GetStockPropValue(sp.ParentVid).Name;
                }
                StockPropAdd spa = new StockPropAdd(cid, catName, fParentName, fParentPid, fParentValueName, fParentVid, sp.StockPid, sp.Name);
                spa.ShowDialog();
                WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
                waitForm.Show();
                gridCtrlStockProp.DataSource = StockPropService.GetStockProp(c => c.StockCid == cid);
                waitForm.Close();
            }
        }
Beispiel #2
0
 /// <summary>
 /// 添加库存自定义属性
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void bbtnAddNewProp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (treeListStockCat.FocusedNode != null && !treeListStockCat.FocusedNode.HasChildren)
     {
         string       cid              = textCatCode.Text;
         string       catName          = textCatName.Text;
         string       fParentPid       = "0";
         string       fParentName      = "";
         string       fParentVid       = "0";
         string       fParentValueName = "";
         StockPropAdd spa              = new StockPropAdd(cid, catName, fParentName, fParentPid, fParentValueName, fParentVid, false);
         spa.ShowDialog();
         WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
         waitForm.Show();
         gridCtrlStockProp.DataSource = StockPropService.GetStockProp(c => c.StockCid == cid);
         waitForm.Close();
     }
 }
Beispiel #3
0
        /// <summary>
        /// 增加子属性
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bbtnAddSonStockProp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            StockProp      sp  = gridViewStockProp.GetFocusedRow() as StockProp;
            StockPropValue spv = gridViewStockPropValue.GetFocusedRow() as StockPropValue;

            if (sp != null && spv != null)
            {
                string       cid              = sp.StockCid;
                string       catName          = textCatName.Text;
                string       fParentPid       = sp.StockPid;
                string       fParentName      = sp.Name;
                string       fParentVid       = spv.StockVid;
                string       fParentValueName = spv.Name;
                StockPropAdd spa              = new StockPropAdd(cid, catName, fParentName, fParentPid, fParentValueName, fParentVid, true);
                spa.ShowDialog();
                WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
                waitForm.Show();
                gridCtrlStockProp.DataSource      = StockPropService.GetStockProp(c => c.StockCid == cid);
                gridCtrlStockPropValue.DataSource = StockPropValueService.GetStockPropValue(c => c.StockPid == sp.StockPid);
                waitForm.Close();
            }
        }