当前位置: 首页>>代码示例>>C#>>正文


C# DataConnection.Connect方法代码示例

本文整理汇总了C#中CDMISrestful.CommonLibrary.DataConnection.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# DataConnection.Connect方法的具体用法?C# DataConnection.Connect怎么用?C# DataConnection.Connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDMISrestful.CommonLibrary.DataConnection的用法示例。


在下文中一共展示了DataConnection.Connect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangePassword

        //ChangePassword ZAM 2014-12-01 //WF 20151010
        public int ChangePassword(DataConnection pclsCache, string UserId, string OldPassword, string newPassword, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            int ret = 0;
            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return ret;

                }
                ret = (int)Cm.MstUser.ChangePassword(pclsCache.CacheConnectionObject, UserId, OldPassword, newPassword, revUserId, TerminalName, TerminalIP, DeviceType);
                return ret;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "保存失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstUser.ChangePassword", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return ret;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
开发者ID:BME319,项目名称:CDMISrestful,代码行数:26,代码来源:UsersMethod.cs

示例2: Remove

        //private List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
     

        //public IEnumerable<CmMstInfoItem> GetAll()
        //{
        //    List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
        //    GetCmMstInfoItem(CmMstInfoItemList);
        //    return CmMstInfoItemList;
        //}

        //public CmMstInfoItem Get(string CategoryCode, string Code, int StartDate)
        //{
        //    List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
        //    GetCmMstInfoItem(CmMstInfoItemList);
        //    return CmMstInfoItemList.Find(p => p.CategoryCode == CategoryCode && p.Code == Code && p.StartDate == StartDate);
        //}

        public int Remove(DataConnection pclsCache, string CategoryCode, string Code, int StartDate)
        {
             int ret = 3;
             try
             {
                 if (!pclsCache.Connect())
                 {
                     //MessageBox.Show("Cache数据库连接失败");
                     return ret;

                 }
                 ret = (int)Cm.MstInfoItem.DeleteData(pclsCache.CacheConnectionObject, CategoryCode, Code);
                 return ret;
             }
             catch (Exception ex)
             {
                 //MessageBox.Show(ex.ToString(), "保存失败!");
                 HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstInfoItem.DeleteData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                 return ret;
             }
             finally
             {
                 pclsCache.DisConnect();
             }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:42,代码来源:CmMstInfoItemRepository.cs

示例3: GetUserInfoByUserId

 /// <summary>
 ///  GetUserInfoByUserId ZAM 2014-12-02 //syf 20151014
 /// </summary>
 /// <param name="pclsCache"></param>
 /// <param name="UserId"></param>
 /// <returns></returns>
 public UserInfoByUserId GetUserInfoByUserId(DataConnection pclsCache, string UserId)
 {
     UserInfoByUserId ret = new UserInfoByUserId();
     try
     {
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Cm.MstUser.GetUserInfoByUserId(pclsCache.CacheConnectionObject, UserId);
         if (list != null)
         {
             ret.UserId = list[0];
             ret.UserName = list[1];
             ret.Password = list[2];
             ret.Class = list[3];
             ret.ClassName = list[4];
             ret.StartDate = list[5];
             ret.EndDate = list[6];
         }
         return ret;
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.ToString(), "获取名称失败!");
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstUser.GetUserInfoByUserId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:40,代码来源:UsersMethod.cs

示例4: GetNo

        //GetNo 自动编号 CSQ 20151010
        public string GetNo(DataConnection pclsCache, int NumberingType, string TargetDate)
        {
            string number = "";
            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return number;

                }
                number = Cm.MstNumbering.GetNo(pclsCache.CacheConnectionObject, NumberingType, TargetDate);
                return number;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "获取编号失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstNumbering.GetNo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return number;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
开发者ID:BME319,项目名称:CDMISrestful,代码行数:26,代码来源:CommonMethod.cs

示例5: GetLatestSMS

 /// <summary>
 /// 获取最新一条消息 GL 2015-10-10
 /// </summary>
 /// <param name="DoctorId"></param>
 /// <param name="PatientId"></param>
 /// <returns></returns>
 public Message GetLatestSMS(DataConnection pclsCache, string DoctorId, string PatientId)
 {
     try
     {
         Message Meg = new Message();
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Mb.MessageRecord.GetLatestSMS(pclsCache.CacheConnectionObject, DoctorId, PatientId);
         if (list != null)
         {
             Meg.MessageNo = list[0];
             Meg.Content = list[1];
             Meg.SendDateTime = list[2];
             Meg.SendByName = list[3];
             Meg.Flag = list[4];
         }
         return Meg;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MessageMethod.GetLatestSMS", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
开发者ID:wfguanhan,项目名称:CDMISrestful,代码行数:37,代码来源:MessageMethod.cs

示例6: GetCompliacneRate

            /// <summary>
            /// 计算某段时间的总依从率 syf 2015-10-10
            /// </summary>
            /// <param name="pclsCache"></param>
            /// <param name="PatientId"></param>
            /// <param name="PlanNo"></param>
            /// <param name="StartDate"></param>
            /// <param name="EndDate"></param>
            /// <returns></returns>
            public string GetCompliacneRate(DataConnection pclsCache, string PatientId, string PlanNo, int StartDate, int EndDate)
            {
                string compliacneRate = "";
                   CacheCommand cmd = null;
                   CacheDataReader cdr = null;

                   try
                   {
                   if (!pclsCache.Connect())
                   {
                       return null;
                   }

                   cmd = new CacheCommand();
                   cmd = Ps.Compliance.GetComplianceListByPeriod(pclsCache.CacheConnectionObject);
                   cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                   cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value = PlanNo;
                   cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                   cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value = EndDate;

                   cdr = cmd.ExecuteReader();

                   double sum = 0;
                   int count = 0;
                   while (cdr.Read())
                   {
                       sum += Convert.ToDouble(cdr["Compliance"]);
                       count++;
                   }

                   if (count != 0)
                   {
                       compliacneRate = (Math.Round(sum / count, 2, MidpointRounding.AwayFromZero) * 100).ToString(); //保留整数

                   }

                   return compliacneRate;
                   }
                   catch (Exception ex)
                   {
                   HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.GetCompliacneRate", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                   return null;
                   }
                   finally
                   {
                   if ((cdr != null))
                   {
                       cdr.Close();
                       cdr.Dispose(true);
                       cdr = null;
                   }
                   if ((cmd != null))
                   {
                       cmd.Parameters.Clear();
                       cmd.Dispose();
                       cmd = null;
                   }
                   pclsCache.DisConnect();
                   }
            }
开发者ID:BME319,项目名称:CDMISrestful,代码行数:69,代码来源:PlanInfoMethod.cs

示例7: PsTreatmentIndicatorsSetData

        /// <summary>
        /// Ps.TreatmentIndicators.SetData GL 2015-10-10
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="SortNo"></param>
        /// <param name="AssessmentType"></param>
        /// <param name="AssessmentName"></param>
        /// <param name="AssessmentTime"></param>
        /// <param name="Result"></param>
        /// <param name="revUserId"></param>
        /// <param name="TerminalName"></param>
        /// <param name="TerminalIP"></param>
        /// <param name="DeviceType"></param>
        /// <returns></returns>
        public int PsTreatmentIndicatorsSetData(DataConnection pclsCache, string UserId, int SortNo, string AssessmentType, string AssessmentName, DateTime AssessmentTime, string Result, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            int ret = 2;
            try
            {
                if (!pclsCache.Connect())
                {
                    return ret;
                }
                ret = (int)Ps.TreatmentIndicators.SetData(pclsCache.CacheConnectionObject, UserId, SortNo, AssessmentType, AssessmentName, AssessmentTime, Result, revUserId, TerminalName, TerminalIP, DeviceType);
                //if(ret == 1)
                //{
                //    int Ass = 0;
                //    string Amt = "";
                //    Amt = Ps.DoctorInfoDetail.GetValue(pclsCache.CacheConnectionObject, revUserId, "Score", "AssessmentNum", 1);
                //    if(Amt != null)
                //    {
                //        Ass = Convert.ToInt32(Amt);
                //        Ass++;
                //    }
                //    ret = (int)Ps.DoctorInfoDetail.SetData(pclsCache.CacheConnectionObject, revUserId, "Score", "AssessmentNum", 1, Convert.ToString(Ass), "", 1, revUserId, TerminalName, TerminalIP, DeviceType);

                //}
                return ret;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "RiskInfoMethod.SetData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return 2;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:49,代码来源:RiskInfoMethod.cs

示例8: GetVitalSignDates

 /// <summary>
 /// 获取某日期之后的有数据的起止时间 GL 2015-10-10
 /// </summary>
 /// <param name="UserId"></param>
 /// <param name="date"></param>
 /// <param name="Num"></param>
 /// <returns></returns>
 public VitalInfo GetVitalSignDates(DataConnection pclsCache, string UserId, int date, int Num)
 {
     try
     {
         VitalInfo item = new VitalInfo();
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         if (!pclsCache.Connect())
         {
             return null;
         }
         list = Ps.VitalSigns.GetVitalSignDates(pclsCache.CacheConnectionObject, UserId, date, Num);
         if (list != null)
         {
             item.StartDate = list[0];
             item.EndDate = list[1];
         }
         return item;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetVitalSignDates", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:35,代码来源:VitalInfoMethod.cs

示例9: GetCmMstInfoItem

        //public bool Update(CmMstInfoItem item)
        //{
        //    if (item == null)
        //    {
        //        throw new ArgumentNullException("item");
        //    }
        //    bool ret = SetData(item);
        //    return ret;
        //}

        //public bool AddItem(CmMstInfoItem item)
        //{
        //    if (item == null)
        //    {
        //        throw new ArgumentNullException("item");
        //    }
        //    bool ret = SetData(item);
        //    return ret;
        //}

        #region functions
        private void GetCmMstInfoItem(DataConnection pclsCache, List<CmMstInfoItem> CmMstInfoItemList)
        {
            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return;
                }
                //cmd = new CacheCommand();
                cmd = Cm.MstInfoItem.GetInfoItem(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    CmMstInfoItemList.Add(new CmMstInfoItem
                    {
                        CategoryCode = cdr["CategoryCode"].ToString(),
                                            Code = cdr["Code"].ToString(),
                                            Name = cdr["Name"].ToString(),
                                            ParentCode = cdr["ParentCode"].ToString(),
                                            SortNo = Convert.ToInt32(cdr["SortNo"].ToString()),
                                            StartDate = Convert.ToInt32(cdr["StartDate"].ToString()),
                                            EndDate = Convert.ToInt32(cdr["EndDate"].ToString()),
                                            GroupHeaderFlag = Convert.ToInt32(cdr["GroupHeaderFlag"].ToString()),
                                            ControlType = cdr["ControlType"].ToString(),
                                            OptionCategory = cdr["OptionCategory"].ToString(),
                                            RevUserId = "",
                                            TerminalName ="",
                                            TerminalIP = "",
                                            DeviceType = 0                                       
                    });
                }
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstInfoItem.GetInfoItem", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return;
            }
            finally
            {

                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:79,代码来源:CmMstInfoItemRepository.cs

示例10: GetAllSignsByPeriod

        //输出一段时间中记录的所有体征信息
        public List<VitalInfo> GetAllSignsByPeriod(DataConnection pclsCache, string UserId, int StartDate, int EndDate)
        {
            {
                List<VitalInfo> items = new List<VitalInfo>();
                CacheCommand cmd = null;
                CacheDataReader cdr = null;
                try
                {
                    if (!pclsCache.Connect())
                    {
                        return null;
                    }
                    cmd = new CacheCommand();
                    cmd = Ps.VitalSigns.GetAllSignsByPeriod(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value = UserId;
                    cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                    cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value = EndDate;

                    cdr = cmd.ExecuteReader();
                    while (cdr.Read())
                    {
                        VitalInfo item = new VitalInfo();
                        item.RecordDate = cdr["RecordDate"].ToString();
                        item.RecordTime = cdr["RecordTime"].ToString();
                        item.ItemType   = cdr["ItemType"].ToString();
                        item.ItemCode   = cdr["ItemCode"].ToString();
                        item.Value      = cdr["Value"].ToString();
                        item.Unit       = cdr["Unit"].ToString();
                        item.Name = cdr["VitalName"].ToString();
                        items.Add(item);
                    }
                    return items;
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetAllSignsByPeriod", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return null;
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
        }
开发者ID:wfguanhan,项目名称:CDMISrestful,代码行数:57,代码来源:VitalInfoMethod.cs

示例11: GetParameters

        public List<Parameters> GetParameters(DataConnection pclsCache, string Indicators)
        {
            List<Parameters> list = new List<Parameters>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = new CacheCommand();
                cmd = Ps.Parameters.GetParameters(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Indicators", CacheDbType.NVarChar).Value = Indicators;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new Parameters
                    {
                        Id = cdr["Id"].ToString(),
                        Name = cdr["Name"].ToString(),
                        Value = cdr["Value"].ToString(),
                        Unit = cdr["Unit"].ToString()

                    });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "RiskInfoMethod.GetParameters", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:wfguanhan,项目名称:CDMISrestful,代码行数:53,代码来源:RiskInfoMethod.cs

示例12: GetModulesByPID

        /// <summary>
        /// GetModulesByPID LS 2014-12-4 //SYF20151109
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="PatientId"></param>
        /// <returns></returns>
        public List<ModulesByPID> GetModulesByPID(DataConnection pclsCache, string PatientId)
        {
            List<ModulesByPID> list = new List<ModulesByPID>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return null;
                }

                cmd = new CacheCommand();
                cmd = Ps.BasicInfoDetail.GetModulesByPID(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    ModulesByPID NewLine = new ModulesByPID();
                    NewLine.CategoryCode = cdr["CategoryCode"].ToString();
                    NewLine.Modules = cdr["Modules"].ToString();
                    list.Add(NewLine);
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetModulesByPID", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:57,代码来源:UsersMethod.cs

示例13: CmMstHypertensionDrugGetTypeList

        // GetTypeList 返回所有类型代码及名称 CSQ 20151010
        public List<TypeAndName> CmMstHypertensionDrugGetTypeList(DataConnection pclsCache)
        {
            List<TypeAndName> list = new List<TypeAndName>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }

                cmd = new CacheCommand();
                cmd = Cm.MstHypertensionDrug.GetTypeList(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new TypeAndName
                    {
                        Type = cdr["Type"].ToString(),
                        Name = cdr["TypeName"].ToString()
                    });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstHypertensionDrug.GetTypeList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:BME319,项目名称:CDMISrestful,代码行数:51,代码来源:DictMethod.cs

示例14: GetSMSDialogue

        /// <summary>
        /// 获取消息对话 GL 2015-10-10
        /// </summary>
        /// <param name="Reciever"></param>
        /// <param name="SendBy"></param>
        /// <returns></returns>
        public List<Message> GetSMSDialogue(DataConnection pclsCache, string Reciever, string SendBy)
        {
            List<Message> items = new List<Message>();
            CacheCommand cmd = null;
            CacheDataReader cdr = null;
            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = Mb.MessageRecord.GetSMSDialogue(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Reciever", CacheDbType.NVarChar).Value = Reciever;
                cmd.Parameters.Add("SendBy", CacheDbType.NVarChar).Value = SendBy;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    Message item = new Message();
                    item.Time = cdr["Time"].ToString();
                    item.Content = cdr["Content"].ToString();
                    item.IDFlag = cdr["IDFlag"].ToString();
                    item.SendDateTime = cdr["SendDateTime"].ToString().Replace("-","/");
                    items.Add(item);
                }
                return items;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MessageMethod.GetSMSDialogue", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {

                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:55,代码来源:MessageMethod.cs

示例15: CmMstTypeGetTypeList

        /// <summary>
        /// 获取某个分类的类别 CSQ 20151010
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="Category"></param>
        /// <returns></returns>
        public List<TypeAndName> CmMstTypeGetTypeList(DataConnection pclsCache, string Category)
        {
            List<TypeAndName> list = new List<TypeAndName>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return null;
                }

                cmd = new CacheCommand();
                cmd = Cm.MstType.GetTypeList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Category", CacheDbType.NVarChar).Value = Category;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new TypeAndName { Type = cdr["Type"].ToString(), Name = cdr["Name"].ToString() });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "DictMethod.GetTypeList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
开发者ID:syfbme,项目名称:CDMISrestful,代码行数:55,代码来源:DictMethod.cs


注:本文中的CDMISrestful.CommonLibrary.DataConnection.Connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。