コード例 #1
0
    private static string GetSmsTemplate(eTemplateType tempType)
    {
        object content = SqlModel.Select(SMSTEMPLATE.TEMPCONTENT).From(DB.SMSTEMPLATE)
                         .Where(SMSTEMPLATE.SMSTEMPTYPE == (int)tempType
                                & SMSTEMPLATE.ISUSE == "1")
                         .ExecuteScalar();

        return(content == null ? "" : content.ToString());
    }
コード例 #2
0
    public static bool AddToSendSms(string receiver, eTemplateType tempType, params string[] args)
    {
        string template = GetSmsTemplate(tempType);

        if (template.Equals(""))
        {
            return(false);
        }
        string         content = string.Format(template, args);
        SMSTOSENDModel model   = new SMSTOSENDModel();

        model.CONTENT     = content;
        model.CREATETIME  = DateTime.Now;
        model.CREATEUSER  = UI.Web.CurrentUser.UserName;
        model.RECEIVEUSER = receiver;
        model.SMSBASTYPE  = "";
        model.SMSTEMPTYPE = ((int)tempType).ToString();
        model.STATUS      = "0";

        return(model.Insert());
    }