コード例 #1
0
        /// <summary>
        /// 新建事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNew_Click(object sender, EventArgs e)
        {
            WeightSortEditForm form = new WeightSortEditForm(this, "new");

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTreeViewData();
            }
        }
コード例 #2
0
        /// <summary>
        /// 编辑事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }

            string[] files = System.IO.Directory.GetFiles(strPath + "weightCategory" + "\\" + selNode.Name, "*.WEM");

            string strtype = (files.Length > 0) ? "readOnlyEdit" : "edit";

            WeightSortEditForm form = new WeightSortEditForm(this, weightSort, strtype);

            form.ShowDialog();
        }
コード例 #3
0
        /// <summary>
        /// 基于新建
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnJYNew_Click(object sender, EventArgs e)
        {
            if (selNode == null || selNode.Level == 0)
            {
                XCommon.XLog.Write("请选择重量分类");
                return;
            }

            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }

            WeightSortEditForm form = new WeightSortEditForm(this, weightSort, "JYNew");

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTreeViewData();
            }
        }
コード例 #4
0
        /// <summary>
        /// 双击节点事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewWeightSort_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }
            string strFolderPath = strPath + "weightCategory" + "\\" + selNode.Name;

            if (Directory.Exists(strFolderPath))
            {
                string[] files   = System.IO.Directory.GetFiles(strFolderPath, "*.WEM");
                string   strtype = (files.Length > 0) ? "readOnlyEdit" : "edit";

                WeightSortEditForm form = new WeightSortEditForm(this, weightSort, strtype);
                form.ShowDialog();
            }
            else
            {
                XLog.Write("文件\"" + strFolderPath + "\"不存在");
            }
        }
コード例 #5
0
        /// <summary>
        /// 双击节点事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewWeightSort_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }
            string strFolderPath = strPath + "weightCategory" + "\\" + selNode.Name;

            if (Directory.Exists(strFolderPath))
            {
                string[] files = System.IO.Directory.GetFiles(strFolderPath, "*.WEM");
                string strtype = (files.Length > 0) ? "readOnlyEdit" : "edit";

                WeightSortEditForm form = new WeightSortEditForm(this, weightSort, strtype);
                form.ShowDialog();
            }
            else
            {
                XLog.Write("文件\"" + strFolderPath + "\"不存在");
            }
        }
コード例 #6
0
 /// <summary>
 /// 新建事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnNew_Click(object sender, EventArgs e)
 {
     WeightSortEditForm form = new WeightSortEditForm(this, "new");
     if (form.ShowDialog() == DialogResult.OK)
     {
         RefreshTreeViewData();
     }
 }
コード例 #7
0
        /// <summary>
        /// 基于新建
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnJYNew_Click(object sender, EventArgs e)
        {
            if (selNode == null || selNode.Level == 0)
            {
                XCommon.XLog.Write("请选择重量分类");
                return;
            }

            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }

            WeightSortEditForm form = new WeightSortEditForm(this, weightSort, "JYNew");
            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTreeViewData();
            }
        }
コード例 #8
0
        /// <summary>
        /// 编辑事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            weightSort = selNode.Tag as WeightSortData;
            if (weightSort == null)
            {
                return;
            }

            string[] files = System.IO.Directory.GetFiles(strPath + "weightCategory" + "\\" + selNode.Name, "*.WEM");

            string strtype = (files.Length > 0) ? "readOnlyEdit" : "edit";

            WeightSortEditForm form = new WeightSortEditForm(this, weightSort, strtype);
            form.ShowDialog();
        }