Esempio n. 1
0
        /// <summary>
        /// 根据UserId
        /// </summary>
        /// <param name="strId"></param>
        /// <returns></returns>
        public int DelDictuserandlabByUserID(string strId)
        {
            int nflag = 0;

            try
            {
                var arrayId = strId.Split(',');
                //临时存储待删除对象,备写日志用
                List <Dictuserandlab> dictLibraryList = new List <Dictuserandlab>();
                foreach (string strid in arrayId)
                {
                    dictLibraryList.Add(GetDictuserandlabById(Convert.ToDouble(strid)));
                }
                nflag = this.delete("Dict.DeleteDictuserandlabByUserId", strId);
                foreach (Dictuserandlab item in dictLibraryList)
                {
                    Dictlab dictlab = new Dictlab();
                    dictlab.Dictlabid = item.Dictlabid;
                    dictlab           = new DictlabService().GetDictlabInfo(dictlab);
                    AddMaintenanceLog("Dictuserandlab", item.Dictuserandlabid, null, "删除", dictlab.Labname, item.Createdate.ToString(), modulename);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(nflag);
        }
Esempio n. 2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="usercode"></param>
        /// <returns></returns>
        public int DelDictfastcommentByID(string strId)
        {
            int nflag = 0;

            try
            {
                var arrayId = strId.Split(',');
                //临时存储待删除对象,备写日志用
                List <Dictlabandtest> dictLibraryList = new List <Dictlabandtest>();
                foreach (string strid in arrayId)
                {
                    dictLibraryList.Add(GetDictDictlabandtestById(Convert.ToDouble(strid)));
                }
                nflag = this.delete("Dict.DeleteDictlabandtest", strId);
                CacheHelper.RemoveAllCache("daan.GetDictlabandtest");
                CacheHelper.RemoveAllCache("daan.GetDicttestitemNotDictlabandtest");
                //记录日志
                foreach (Dictlabandtest item in dictLibraryList)
                {
                    Dictlab dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(item.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtest", item.Dictlabandtestid, null, "删除", dictlab.Labname, item.Createdate.ToString(), modulename);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(nflag);
        }
Esempio n. 3
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="usercode"></param>
        /// <returns></returns>
        public int DelDictlabandtestpriceByID(string strId)
        {
            int nflag = 0;

            try
            {
                var arrayId = strId.Split(',');
                //临时存储待删除对象,备写日志用
                List <Dictlabandtestprice> dictLibraryList = new List <Dictlabandtestprice>();
                foreach (string strid in arrayId)
                {
                    dictLibraryList.Add(GetDictlabandtestpriceById(Convert.ToDouble(strid)));
                }
                nflag = this.delete("Dict.DeleteDictlabandtestprice", strId);
                CacheHelper.RemoveAllCache("daan.GetDictlabandtestpriceresult");
                //记录日志
                foreach (Dictlabandtestprice item in dictLibraryList)
                {
                    //增加删除日志对象 fhp
                    List <LogInfo> logLst  = getLogInfo <Dictlabandtestprice>(item, new Dictlabandtestprice());
                    Dictlab        dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(item.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtestprice", item.Dictlabandtestpriceid, logLst, "删除", dictlab.Labname, item.Price.ToString(), modulename);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(nflag);
        }
Esempio n. 4
0
        ///<summary>
        ///新增编辑后保存
        ///</summary>
        ///<param name="library"></param>
        /// <returns></returns>
        public bool SaveDictlabandtest(Dictlabandtest dictlabandtest)
        {
            int nflag = 0;

            //新增
            if (dictlabandtest.Dictlabandtestid == 0 || dictlabandtest.Dictlabandtestid == null)
            {
                try
                {
                    dictlabandtest.Dictlabandtestid = getSeqID("SEQ_DICTLABANDTEST");
                    insert("Dict.InsertDictlabandtest", dictlabandtest);
                    nflag = 1;
                    List <LogInfo> logLst  = getLogInfo <Dictlabandtest>(new Dictlabandtest(), dictlabandtest);
                    Dictlab        dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(dictlabandtest.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtest", int.Parse(dictlabandtest.Dictlabandtestid.ToString()), logLst, "新增", dictlab.Labname, dictlabandtest.Createdate.ToString(), modulename);
                    CacheHelper.RemoveAllCache("daan.GetDictlabandtest");
                    CacheHelper.RemoveAllCache("daan.GetDicttestitemNotDictlabandtest");
                }
                catch (Exception ex)
                {
                    nflag = 0;
                    throw new Exception(ex.Message);
                }
            }
            else//保存
            {
                try
                {
                    Dictlabandtest oldDictlabandtest = GetDictlabandtestInfo(dictlabandtest);

                    dictlabandtest.Createdate     = oldDictlabandtest.Createdate;
                    dictlabandtest.Dictlabid      = oldDictlabandtest.Dictlabid;
                    dictlabandtest.Dicttestitemid = oldDictlabandtest.Dicttestitemid;
                    nflag = update("Dict.UpdateDictlabandtest", dictlabandtest);

                    List <LogInfo> logLst  = getLogInfo <Dictlabandtest>(oldDictlabandtest, dictlabandtest);
                    Dictlab        dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(dictlabandtest.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtest", int.Parse(dictlabandtest.Dictlabandtestid.ToString()), logLst, "修改", dictlabandtest.Labname, dictlabandtest.Createdate.ToString(), modulename);
                    CacheHelper.RemoveAllCache("daan.GetDictlabandtest");
                    CacheHelper.RemoveAllCache("daan.GetDicttestitemNotDictlabandtest");
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(nflag > 0);
        }
Esempio n. 5
0
        ///<summary>
        ///新增编辑后保存
        ///</summary>
        ///<param name="library"></param>
        /// <returns></returns>
        public bool SaveDictuserandlab(Dictuserandlab library)
        {
            int nflag = 0;

            //新增
            if (library.Dictuserandlabid == 0 || library.Dictuserandlabid == null)
            {
                try
                {
                    library.Dictuserandlabid = getSeqID("SEQ_DICTUSERANDLAB");
                    insert("Dict.InsertDictuserandlab", library);
                    nflag = 1;
                    List <LogInfo> logLst  = getLogInfo <Dictuserandlab>(new Dictuserandlab(), library);
                    Dictlab        dictlab = new Dictlab();
                    dictlab.Dictlabid = library.Dictlabid;
                    dictlab           = new DictlabService().GetDictlabInfo(dictlab);
                    AddMaintenanceLog("Dictuserandlab", int.Parse(library.Dictuserandlabid.ToString()), logLst, "新增", dictlab.Labname, library.Createdate.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    nflag = 0;
                    throw new Exception(ex.Message);
                }
            }
            else//保存
            {
                try
                {
                    Dictuserandlab dictcustomer = GetDictcustomeridInfo(library);
                    nflag = update("Dict.UpdateDictuserandlab", library);
                    List <LogInfo> logLst  = getLogInfo <Dictuserandlab>(dictcustomer, library);
                    Dictlab        dictlab = new Dictlab();
                    dictlab.Dictlabid = library.Dictlabid;
                    dictlab           = new DictlabService().GetDictlabInfo(dictlab);
                    AddMaintenanceLog("Dictuserandlab", int.Parse(library.Dictuserandlabid.ToString()), logLst, "修改", dictlab.Labname, library.Createdate.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(nflag > 0);
        }
Esempio n. 6
0
        ///<summary>
        ///新增编辑后保存
        ///</summary>
        ///<param name="library"></param>
        /// <returns></returns>
        public bool SaveDictlabandtestprice(Dictlabandtestprice library)
        {
            int nflag = 0;

            //新增
            if (library.Dictlabandtestpriceid == 0 || library.Dictlabandtestpriceid == null)
            {
                try
                {
                    library.Dictlabandtestpriceid = getSeqID("SEQ_DICTLABANDTESTPRICE");
                    insert("Dict.InsertDictlabandtestprice", library);
                    CacheHelper.RemoveAllCache("daan.GetDictlabandtestpriceresult");
                    nflag = 1;
                    List <LogInfo> logLst  = getLogInfo <Dictlabandtestprice>(new Dictlabandtestprice(), library);
                    Dictlab        dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(library.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtestprice", int.Parse(library.Dictlabandtestpriceid.ToString()), logLst, "新增", dictlab.Labname.ToString(), library.Price.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    nflag = 0;
                    throw new Exception(ex.Message);
                }
            }
            else//保存
            {
                try
                {
                    Dictlabandtestprice dictlabandtestprice = GetDictlabandtestpriceInfo(library);
                    nflag = update("Dict.UpdateDictlabandtestprice", library);
                    CacheHelper.RemoveAllCache("daan.GetDictlabandtestpriceresult");
                    List <LogInfo> logLst  = getLogInfo <Dictlabandtestprice>(dictlabandtestprice, library);
                    Dictlab        dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(library.Dictlabid)); //查询分点
                    AddMaintenanceLog("Dictlabandtestprice", int.Parse(library.Dictlabandtestpriceid.ToString()), logLst, "修改", dictlab.Labname.ToString(), library.Price.ToString(), modulename);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(nflag > 0);
        }