Exemplo n.º 1
0
        private void barButtonItem11_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormAddInfo_TouZiGuSuan2 fep = new FormAddInfo_TouZiGuSuan2();

            fep.FlagId = typeFlag2;
            fep.ParentID = "0";
            fep.Text = "增加项目";
            fep.Isupdate = false;
            if (fep.ShowDialog() == DialogResult.OK)
            {
                WaitDialogForm wait = null;

                try
                {
                    wait = new WaitDialogForm("", "正在重新统计数据, 请稍候...");
                    LoadDatadata();
                    wait.Close();
                  //  MsgBox.Show("计算成功");

                }
                catch
                {
                    wait.Close();
                }
            }
        }
Exemplo n.º 2
0
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }

            //if (treeList1.FocusedNode.ParentNode == null)
            //{
            //    MsgBox.Show("一级项目名称不能修改!");
            //    return;
            //}
            if (treeList1.FocusedNode.HasChildren)
            {
                MsgBox.Show("此项目下有子项目,不允许修改此记录!");
                return;
            }
            FormAddInfo_TouZiGuSuan2 frm = new FormAddInfo_TouZiGuSuan2();
            frm.FlagId = typeFlag2;
            frm.PowerUId =this.treeList1.FocusedNode.GetValue("ID").ToString();
            frm.Text = "修改项目";
            frm.Isupdate = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                int i = this.treeList1.FocusedNode.Id;

                WaitDialogForm wait = null;

                try
                {
                    wait = new WaitDialogForm("", "正在重新统计数据, 请稍候...");
                    LoadDatadata();
                    wait.Close();
                    //MsgBox.Show("计算成功");

                }
                catch
                {
                    wait.Close();
                }

                //obj = frm.OBJ;
                TreeListColumn column = treeList1.Columns["L10"];
                CalculateSum(treeList1.FindNodeByID(i).ParentNode, column, 0,true);

                ////try
                ////{
                ////    string id = treeList1.FocusedNode["ID"].ToString();
                ////    string flag22 = typeFlag2;

                ////    PSP_Project_List pptss = new PSP_Project_List();
                ////    pptss.ID = id;
                ////    pptss.Flag2 = flag22;

                ////    PSP_Project_List psp_Type = Services.BaseService.GetOneByKey<PSP_Project_List>(pptss);
                ////    psp_Type.L3 = frm.TypeTitle;
                ////psp_Type.Flag = frm.PowerType;
                ////Common.Services.BaseService.Update<PSP_Project_List>(psp_Type);

                ////    if (psp_Type.Code != "")
                ////    {
                ////        LineInfo li3 = Services.BaseService.GetOneByKey<LineInfo>(psp_Type.Code);
                ////        if (li3 != null)
                ////        {
                ////            li3.LineName = psp_Type.L3;
                ////            Common.Services.BaseService.Update<LineInfo>(li3);
                ////        }

                ////        substation sb3 = Services.BaseService.GetOneByKey<substation>(psp_Type.Code);
                ////        if (sb3 != null)
                ////        {
                ////            sb3.EleName = psp_Type.L3;
                ////            Common.Services.BaseService.Update<substation>(sb3);
                ////        }
                ////    }

                ////    treeList1.FocusedNode.SetValue("L3", frm.TypeTitle);
                ////    FoucsLocation(id, treeList1.Nodes);
                ////}
                ////catch (Exception ex)
                ////{
                ////    //MsgBox.Show("修改出错:" + ex.Message);
                ////}
            }
        }
Exemplo n.º 3
0
        private void treeList1_DoubleClick(object sender, EventArgs e)
        {
            if (!EditRight)
                return;
            if (treeList1.FocusedNode == null)
                return;
            FormAddInfo_TouZiGuSuan2 frm = new FormAddInfo_TouZiGuSuan2();
            frm.FlagId = typeFlag2;
            frm.PowerUId =this.treeList1.FocusedNode.GetValue("ID").ToString();
            frm.Text = "修改项目";
            frm.Isupdate = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                int i = this.treeList1.FocusedNode.Id;
                WaitDialogForm wait = null;

                try
                {
                    wait = new WaitDialogForm("", "正在计算数据, 请稍候...");
                    LoadDatadata();
                    wait.Close();
                   // MsgBox.Show("计算成功");

                }
                catch
                {
                    wait.Close();
                }
                TreeListColumn column = treeList1.Columns["L10"];
                CalculateSum(treeList1.FindNodeByID(i).ParentNode, column, 0, true);
            }
            //FormAddInfo_TouZiGuSuan fep = new FormAddInfo_TouZiGuSuan();
            //fep.FlagId = typeFlag2;
            //fep.PowerUId = treeList1.FocusedNode["ID"].ToString();
            //string uid1 = treeList1.FocusedNode["ID"].ToString();
            //LineInfo li = Common.Services.BaseService.GetOneByKey<LineInfo>(treeList1.FocusedNode["Code"].ToString());
            //if (li != null)
            //    fep.IsLine = true;
            //substation li1 = Common.Services.BaseService.GetOneByKey<substation>(treeList1.FocusedNode["ID"].ToString());
            //if (li1 != null)
            //    fep.IsPower = true;

            //if (fep.ShowDialog() == DialogResult.OK)
            //{
            //    LoadData();
            //    treeList1.ExpandAll();
            //    FoucsLocation(uid1, treeList1.Nodes);
            //}
        }