コード例 #1
0
ファイル: SMSTemplate.cs プロジェクト: yongxie/-
        public SMSTemplateDB FindTemp(string ID)
        {
            DBManager db = DBManager.Instance();        //通用数据操作类

            try
            {
                DataTable dt = new DataTable();

                dt = db.GetDataTable(@"select TemplateName,TemplateContent from SMS_Template where Id='" + ID + "';");

                SMSTemplateDB clsSMS = new SMSTemplateDB();
                if (dt.Rows.Count > 0)
                {
                    clsSMS.Id = ID;
                    clsSMS.TemplateContent = Common.CNullToStr(dt.Rows[0]["TemplateContent"]);
                    clsSMS.TemplateName    = Common.CNullToStr(dt.Rows[0]["TemplateName"]);
                }
                return(clsSMS);
            }
            catch (Exception exc)
            {
                Common.ShowMsg("系统警告:查询短信模版信息失败!");
                return(new SMSTemplateDB());
            }
        }
コード例 #2
0
ファイル: SMSTemplate.cs プロジェクト: yongxie/-
        /// <summary>
        /// 用于显示详细信息(用于DataGrid绑定)
        /// </summary>
        public SMSTemplateDB ShowTemp(string Id)
        {
            DBManager db = DBManager.Instance();
            DataTable dt = new DataTable();

            try
            {
                dt = db.GetDataTable("select TemplateName,TemplateContent from SMS_Template where Id=" + Id);
                SMSTemplateDB smsDB = new SMSTemplateDB();
                if (dt.Rows.Count > 0)
                {
                    smsDB.Id              = Id;
                    smsDB.TemplateName    = Common.CNullToStr(dt.Rows[0]["TemplateName"]);
                    smsDB.TemplateContent = Common.CNullToStr(dt.Rows[0]["TemplateContent"]);
                }
                return(smsDB);
            }
            catch (Exception exc)
            {
                Common.ShowMsg("系统警告:查询短信模版信息失败!");
                return(new SMSTemplateDB());
            }
        }