Ejemplo n.º 1
0
        /// <summary>
        /// 保存过滤方案
        /// </summary>
        /// <param name="operType">操作类型</param>
        /// <param name="TabName">表名称</param>
        /// <param name="ParentID">父方案ID</param>
        /// <param name="SltType">过滤方案类型</param>
        /// <param name="KeyWords">查询关键字</param>
        private void AddFltSlt(OperType operType, string ParentID, string SltType, string KeyWords, List <DTSerializer <string, object> > List_DTObj)
        {
            try
            {
                //获取当前最大的方案ID
                string MaxSltID = ComClient.GetMaxSltID(FrmNam, SltType, ParentID);
                DTSerializer <string, object>         DTObj1      = new DTSerializer <string, object>();
                List <DTSerializer <string, object> > List_DTObj1 = new List <DTSerializer <string, object> >();
                DTObj1.Add("FSltID", MaxSltID);
                DTObj1.Add("FSltName", Txt_SltName.Text.Trim());
                DTObj1.Add("FParentID", ParentID);
                DTObj1.Add("FUsrID", CurUsrID);
                DTObj1.Add("FFrmName", FrmNam);
                DTObj1.Add("FSltType", SltType);
                List_DTObj1.Add(DTObj1);

                //开始SQL事务
                ComClient.BeginTransaction();
                ComClient.SaveFltSlt1(operType, Serializer.SerializeDTToXml <List <DTSerializer <string, object> > >(List_DTObj1), "t_ADMM_FltSltList", KeyWords);

                //向查询方案明细中追加方案ID和方案类型
                foreach (DTSerializer <string, object> DTObj2 in List_DTObj)
                {
                    DTObj2.Add("FSltID", MaxSltID);
                    DTObj2.Add("FSltType", SltType);
                }

                //增加/修改/删除过滤方案明细
                ComClient.SaveFltSlt1(operType, Serializer.SerializeDTToXml <List <DTSerializer <string, object> > >(List_DTObj), "t_ADMM_FltSltforDtl", KeyWords);
                //提交事务
                ComClient.CommitTransaction();
            }
            catch (Exception Ex)
            {
                Common.ShowMsg(Ex.Message);
            }
        }