Пример #1
0
        private void barEdit1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            GridColumn gc = this.ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn;

            if (gc == null)
            {
                return;
            }

            if (gc.FieldName.Substring(0, 1) != "S")
            {
                return;
            }

            FrmPower_AddBands frm = new FrmPower_AddBands();

            frm.ClassName = gc.Caption;
            frm.ClassType = gc.FieldName;
            frm.Type      = type;
            frm.Flag      = flag;
            frm.Type2     = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20);
            frm.IsUpdate  = true;
            frm.Text      = "修改分类";
            if (frm.ShowDialog() == DialogResult.OK)
            {
                // gc.Caption = frm.ClassName;
                InitValues();
            }
        }
Пример #2
0
        private void barAdd1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                FrmPower_AddBands frm = new FrmPower_AddBands();
                frm.Type    = type;
                frm.Flag    = flag;
                frm.Type2   = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20);
                frm.AddFlag = "powerflag";


                if (frm.ShowDialog() == DialogResult.OK)
                {
                    InitValues();
                }

                //    if (frm.ShowDialog() == DialogResult.OK)
                //    {
                //        foreach(GridColumn gc in this.ctrlPSP_PowerSubstationInfo1.GridView.Columns)
                //        {
                //            if (gc.FieldName == frm.ClassType)
                //            {
                //                gc.Caption = frm.ClassName;
                //                gc.Visible = true;
                //                gc.OptionsColumn.ShowInCustomizationForm = true;
                //            }
                //        }



                //    if (gc.Columns[0].FieldName.Substring(0, 1) == "S")
                //    {
                //        gc.Visible = false;
                //        foreach (PowerSubstationLine pss in li)
                //        {

                //            if (gc.Columns[0].FieldName == pss.ClassType)
                //            {
                //                gc.Visible = true;
                //                gc.Caption = pss.Title;
                //                gc.Columns[0].Caption = pss.Title;
                //                gc.Columns[0].Visible = true;
                //                gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true;

                //            }
                //        }
                //    }
                //}
            }

            catch (Exception ex)
            { MsgBox.Show(ex.Message); }
        }
Пример #3
0
        private void barAdd1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                FrmPower_AddBands frm = new FrmPower_AddBands();
                frm.Type = type;
                frm.Flag = flag;
                frm.Type2 = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20);
                frm.AddFlag = "powerflag";

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    InitValues();
                }

            //    if (frm.ShowDialog() == DialogResult.OK)
            //    {
            //        foreach(GridColumn gc in this.ctrlPSP_PowerSubstationInfo1.GridView.Columns)
            //        {
            //            if (gc.FieldName == frm.ClassType)
            //            {
            //                gc.Caption = frm.ClassName;
            //                gc.Visible = true;
            //                gc.OptionsColumn.ShowInCustomizationForm = true;
            //            }
            //        }

            //    if (gc.Columns[0].FieldName.Substring(0, 1) == "S")
            //    {
            //        gc.Visible = false;
            //        foreach (PowerSubstationLine pss in li)
            //        {

            //            if (gc.Columns[0].FieldName == pss.ClassType)
            //            {
            //                gc.Visible = true;
            //                gc.Caption = pss.Title;
            //                gc.Columns[0].Caption = pss.Title;
            //                gc.Columns[0].Visible = true;
            //                gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true;

            //            }
            //        }
            //    }
            //}
            }

            catch (Exception ex)
            { MsgBox.Show(ex.Message); }
        }
Пример #4
0
        private void barAdd1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                FrmPower_AddBands frm = new FrmPower_AddBands();
                frm.Type    = type;
                frm.Flag    = flag;
                frm.Type2   = type2;
                frm.AddFlag = "powerflag";


                if (frm.ShowDialog() == DialogResult.OK)
                {
                    InitValues();
                }
            }

            catch (Exception ex)
            { MsgBox.Show(ex.Message); }
        }
Пример #5
0
        private void barEdit1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            GridColumn gc = this.ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn;
            if (gc == null)
                return;

            if (gc.FieldName.Substring(0, 1) != "S")
                return;

            FrmPower_AddBands frm = new FrmPower_AddBands();
            frm.ClassName = gc.Caption;
            frm.ClassType = gc.FieldName;
            frm.Type = type;
            frm.Flag = flag;
            frm.Type2="PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20);
            frm.IsUpdate = true;
            frm.Text = "�޸ķ���";
            if (frm.ShowDialog() == DialogResult.OK)
            {
               // gc.Caption = frm.ClassName;
                InitValues();
            }
        }
Пример #6
0
        private void barAdd1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                FrmPower_AddBands frm = new FrmPower_AddBands();
                frm.Type = type;
                frm.Flag = flag;
                frm.Type2 = type2;
                frm.AddFlag = "powerflag";

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    InitValues();
                }

            }

            catch (Exception ex)
            { MsgBox.Show(ex.Message); }
        }
Пример #7
0
        private void barButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.ctrlPowerEachList1.FocusedObject == null)
            {
                MsgBox.Show("请先添加项目分类管理!");
                return;
            }
            try
            {

                ArrayList al = new ArrayList();
                al.Clear();
                for (int i = 0; i < treeList1.Columns.Count; i++)
                {
                    if (treeList1.Columns[i].VisibleIndex != -1)
                        al.Add(treeList1.Columns[i].Caption);
                }

                FrmPower_AddBands frm = new FrmPower_AddBands();

                //psl.Flag = "1";
                //psl.Type = typeFlag2;
                //psl.Type2 = type;

                frm.Type = typeFlag2;
                frm.Flag = "1";
                frm.Type2 = type;
                frm.AddFlag = "form1_liaoflag";
                frm.Al = al;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    ReAddColumn(frm.ClassType,frm.textBox1.Text);
                }

            }
            catch (Exception ex) { MsgBox.Show(ex.Message); }
        }
Пример #8
0
        private void barButtonItem15_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedColumn == null)
            {
                return;
            }

            string fieldName = treeList1.FocusedColumn.FieldName;

            if (fieldName.Substring(0, 1) != "S")
            {
                MessageBox.Show("此列,无权修改!");
                return;
            }
            try
            {
                FrmPower_AddBands frm = new FrmPower_AddBands();
                frm.ClassName = treeList1.FocusedColumn.Caption;
                frm.ClassType = treeList1.FocusedColumn.FieldName;
                frm.Type = typeFlag2;
                frm.Flag ="1";
                frm.Type2 = type;
                frm.IsUpdate = true;

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    // gc.Caption = frm.ClassName;
                    EditColumn(frm.ClassType, frm.textBox1.Text, treeList1.FocusedColumn.VisibleIndex);
                }
            }
            catch (Exception ex) { MsgBox.Show(ex.Message); }
        }