Esempio n. 1
0
 /// <summary>
 /// 删除方案事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Btn_Drop_Click(object sender, EventArgs e)
 {
     try
     {
         //获取当前选择的方案名称
         string FSltID = TrList_FltSlt.FocusedNode.GetValue("FSltID").ToString();
         ComClient.BeginTransaction();
         ComClient.SaveFltSlt1(OperType.Delete, "", "t_ADMM_FltSltList", " FSltID='" + FSltID + "'");
         ComClient.SaveFltSlt1(OperType.Delete, "", "t_ADMM_FltSltforDtl", " FSltID='" + FSltID + "'");
         ComClient.CommitTransaction();
         TrList_FltSlt.DataSource = Serializer.DeserializeXMLToDT(ComClient.GetFltSlt(CurUsrID, FrmNam));
         TrList_FltSlt.ExpandAll();
     }
     catch (Exception Ex)
     {
         Common.ShowMsg(Ex.Message);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 另存为弹窗事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_SaveAs_Click(object sender, EventArgs e)
        {
            try
            {
                //获取面板中最后一个用户控件
                int             ContrNum = Pal_FlCtner.Controls.Count;
                UsrContr_Filter Filter   = (UsrContr_Filter)Pal_FlCtner.Controls[ContrNum - 1];

                if (((SearchLookUpEdit)Filter.Controls["SLkUp_ColNams"]).EditValue != null)
                {
                    FrmSaveAs frmSaveAs = new DiousEPortal.FrmSaveAs();
                    frmSaveAs.ComClient  = ComClient;
                    frmSaveAs.CurUsrID   = CurUsrID;
                    frmSaveAs.CurUsrName = CurUsrName;
                    frmSaveAs.FrmNam     = FrmNam;
                    CurFltSltDtl         = GetFltSltDtl();
                    //判断左右括号是否匹配,如果不匹配则退出方法
                    if (BracketsMatch(CurFltSltDtl))
                    {
                        //传递过滤方案明细数据
                        frmSaveAs.FltSltDtl = CurFltSltDtl;
                        frmSaveAs.ShowDialog();
                        TrList_FltSlt.DataSource = Serializer.DeserializeXMLToDT(ComClient.GetFltSlt(CurUsrID, FrmNam));
                        TrList_FltSlt.ExpandAll();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    Common.ShowMsg("字段名不能为空!");
                }
            }
            catch (Exception Ex)
            {
                Common.ShowMsg(Ex.Message);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmFilter_Load(object sender, EventArgs e)
        {
            try
            {
                if (CurOperType == OperType.InitFilter)
                {
                    UsrContr_Filter2.CtrContainer = Pal_FlCtner;
                    DataTransformer = new DataTransform();
                    InitLkUp(this.UsrContr_Filter2);
                    //新建树菜单列
                    DevExpress.XtraTreeList.Columns.TreeListColumn Col_FSltID = new DevExpress.XtraTreeList.Columns.TreeListColumn();
                    Col_FSltID.Name      = "FSltID";
                    Col_FSltID.FieldName = "FSltID";
                    Col_FSltID.Caption   = "FSltID";

                    DevExpress.XtraTreeList.Columns.TreeListColumn Col_FParentID = new DevExpress.XtraTreeList.Columns.TreeListColumn();
                    Col_FParentID.Name      = "FParentID";
                    Col_FParentID.Caption   = "FParentID";
                    Col_FParentID.FieldName = "FParentID";

                    DevExpress.XtraTreeList.Columns.TreeListColumn Col_FSltName = new DevExpress.XtraTreeList.Columns.TreeListColumn();
                    Col_FSltName.Name         = "FSltName";
                    Col_FSltName.Caption      = "FSltName";
                    Col_FSltName.FieldName    = "FSltName";
                    Col_FSltName.Visible      = true;
                    Col_FSltName.VisibleIndex = 2;

                    DevExpress.XtraTreeList.Columns.TreeListColumn Col_FFrmName = new DevExpress.XtraTreeList.Columns.TreeListColumn();
                    Col_FFrmName.Name      = "FFrmName";
                    Col_FFrmName.Caption   = "FFrmName";
                    Col_FFrmName.FieldName = "FFrmName";

                    //将列添加到树菜单
                    TrList_FltSlt.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
                        Col_FSltID,
                        Col_FParentID,
                        Col_FSltName,
                        Col_FFrmName
                    }
                                                   );

                    TrList_FltSlt.KeyFieldName             = "FSltID";
                    TrList_FltSlt.ParentFieldName          = "FParentID";
                    TrList_FltSlt.OptionsView.ShowColumns  = false;
                    TrList_FltSlt.OptionsBehavior.Editable = false;

                    //设置树菜单节点竖向边框不显示
                    TrList_FltSlt.OptionsView.ShowVertLines = false;
                    //设置树菜单节点横向边框不显示
                    TrList_FltSlt.OptionsView.ShowHorzLines = false;
                    //设置树菜单节点的字体大小
                    TrList_FltSlt.Appearance.Row.Font = new System.Drawing.Font("Tahoma", 10F);

                    Pal_FltSlt.Controls.Add(TrList_FltSlt);
                    //将过滤方案反序列化成Datatable
                    TrList_FltSlt.DataSource = Serializer.DeserializeXMLToDT(ComClient.GetFltSlt(CurUsrID, FrmNam));
                    TrList_FltSlt.ExpandAll();
                }
            }
            catch (Exception Ex)
            {
                Common.ShowMsg(Ex.Message);
            }
        }