Ejemplo n.º 1
0
 ///<summary>Inserts one WebSchedRecall into the database.  Returns the new priKey.</summary>
 public static long Insert(WebSchedRecall webSchedRecall)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         webSchedRecall.WebSchedRecallNum = DbHelper.GetNextOracleKey("webschedrecall", "WebSchedRecallNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(webSchedRecall, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     webSchedRecall.WebSchedRecallNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(webSchedRecall, false));
     }
 }
Ejemplo n.º 2
0
 ///<summary>Inserts one WebSchedRecall into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(WebSchedRecall webSchedRecall)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(webSchedRecall, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             webSchedRecall.WebSchedRecallNum = DbHelper.GetNextOracleKey("webschedrecall", "WebSchedRecallNum");                  //Cacheless method
         }
         return(InsertNoCache(webSchedRecall, true));
     }
 }
Ejemplo n.º 3
0
        public static WebSchedRecall CreateWebSchedRecall(long patNum, long recallNum, long clinicNum)
        {
            WebSchedRecall wsRecall = new WebSchedRecall {
                ClinicNum       = clinicNum,
                EmailPat        = "*****@*****.**",
                EmailSendStatus = AutoCommStatus.SendNotAttempted,
                IsForEmail      = true,
                IsForSms        = true,
                PatNum          = patNum,
                PhonePat        = "503-363-5432",
                RecallNum       = recallNum,
                SmsSendStatus   = AutoCommStatus.SendNotAttempted,
            };

            WebSchedRecalls.Insert(wsRecall);
            return(wsRecall);
        }
Ejemplo n.º 4
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <WebSchedRecall> TableToList(DataTable table)
        {
            List <WebSchedRecall> retVal = new List <WebSchedRecall>();
            WebSchedRecall        webSchedRecall;

            foreach (DataRow row in table.Rows)
            {
                webSchedRecall = new WebSchedRecall();
                webSchedRecall.WebSchedRecallNum       = PIn.Long(row["WebSchedRecallNum"].ToString());
                webSchedRecall.ClinicNum               = PIn.Long(row["ClinicNum"].ToString());
                webSchedRecall.PatNum                  = PIn.Long(row["PatNum"].ToString());
                webSchedRecall.RecallNum               = PIn.Long(row["RecallNum"].ToString());
                webSchedRecall.DateTimeEntry           = PIn.DateT(row["DateTimeEntry"].ToString());
                webSchedRecall.DateDue                 = PIn.Date(row["DateDue"].ToString());
                webSchedRecall.ReminderCount           = PIn.Int(row["ReminderCount"].ToString());
                webSchedRecall.PreferRecallMethod      = (OpenDentBusiness.ContactMethod)PIn.Int(row["PreferRecallMethod"].ToString());
                webSchedRecall.DateTimeReminderSent    = PIn.DateT(row["DateTimeReminderSent"].ToString());
                webSchedRecall.DateTimeSendFailed      = PIn.DateT(row["DateTimeSendFailed"].ToString());
                webSchedRecall.EmailSendStatus         = (OpenDentBusiness.AutoCommStatus)PIn.Int(row["EmailSendStatus"].ToString());
                webSchedRecall.SmsSendStatus           = (OpenDentBusiness.AutoCommStatus)PIn.Int(row["SmsSendStatus"].ToString());
                webSchedRecall.PhonePat                = PIn.String(row["PhonePat"].ToString());
                webSchedRecall.EmailPat                = PIn.String(row["EmailPat"].ToString());
                webSchedRecall.MsgTextToMobileTemplate = PIn.String(row["MsgTextToMobileTemplate"].ToString());
                webSchedRecall.MsgTextToMobile         = PIn.String(row["MsgTextToMobile"].ToString());
                webSchedRecall.EmailSubjTemplate       = PIn.String(row["EmailSubjTemplate"].ToString());
                webSchedRecall.EmailSubj               = PIn.String(row["EmailSubj"].ToString());
                webSchedRecall.EmailTextTemplate       = PIn.String(row["EmailTextTemplate"].ToString());
                webSchedRecall.EmailText               = PIn.String(row["EmailText"].ToString());
                webSchedRecall.GuidMessageToMobile     = PIn.String(row["GuidMessageToMobile"].ToString());
                webSchedRecall.ShortGUIDSms            = PIn.String(row["ShortGUIDSms"].ToString());
                webSchedRecall.ShortGUIDEmail          = PIn.String(row["ShortGUIDEmail"].ToString());
                webSchedRecall.ResponseDescript        = PIn.String(row["ResponseDescript"].ToString());
                webSchedRecall.Source                  = (OpenDentBusiness.WebSchedRecallSource)PIn.Int(row["Source"].ToString());
                retVal.Add(webSchedRecall);
            }
            return(retVal);
        }
Ejemplo n.º 5
0
        public static void UpdateDateTEntry(WebSchedRecall wsRecall, DateTime dateTEntry)
        {
            string command = $"UPDATE webschedrecall SET DateTimeEntry={POut.DateT(dateTEntry)} WHERE WebSchedRecallNum={wsRecall.WebSchedRecallNum}";

            DataCore.NonQ(command);
        }
Ejemplo n.º 6
0
 ///<summary>Returns true if Update(WebSchedRecall,WebSchedRecall) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(WebSchedRecall webSchedRecall, WebSchedRecall oldWebSchedRecall)
 {
     if (webSchedRecall.ClinicNum != oldWebSchedRecall.ClinicNum)
     {
         return(true);
     }
     if (webSchedRecall.PatNum != oldWebSchedRecall.PatNum)
     {
         return(true);
     }
     if (webSchedRecall.RecallNum != oldWebSchedRecall.RecallNum)
     {
         return(true);
     }
     //DateTimeEntry not allowed to change
     if (webSchedRecall.DateDue.Date != oldWebSchedRecall.DateDue.Date)
     {
         return(true);
     }
     if (webSchedRecall.ReminderCount != oldWebSchedRecall.ReminderCount)
     {
         return(true);
     }
     if (webSchedRecall.PreferRecallMethod != oldWebSchedRecall.PreferRecallMethod)
     {
         return(true);
     }
     if (webSchedRecall.DateTimeReminderSent != oldWebSchedRecall.DateTimeReminderSent)
     {
         return(true);
     }
     if (webSchedRecall.DateTimeSendFailed != oldWebSchedRecall.DateTimeSendFailed)
     {
         return(true);
     }
     if (webSchedRecall.EmailSendStatus != oldWebSchedRecall.EmailSendStatus)
     {
         return(true);
     }
     if (webSchedRecall.SmsSendStatus != oldWebSchedRecall.SmsSendStatus)
     {
         return(true);
     }
     if (webSchedRecall.PhonePat != oldWebSchedRecall.PhonePat)
     {
         return(true);
     }
     if (webSchedRecall.EmailPat != oldWebSchedRecall.EmailPat)
     {
         return(true);
     }
     if (webSchedRecall.MsgTextToMobileTemplate != oldWebSchedRecall.MsgTextToMobileTemplate)
     {
         return(true);
     }
     if (webSchedRecall.MsgTextToMobile != oldWebSchedRecall.MsgTextToMobile)
     {
         return(true);
     }
     if (webSchedRecall.EmailSubjTemplate != oldWebSchedRecall.EmailSubjTemplate)
     {
         return(true);
     }
     if (webSchedRecall.EmailSubj != oldWebSchedRecall.EmailSubj)
     {
         return(true);
     }
     if (webSchedRecall.EmailTextTemplate != oldWebSchedRecall.EmailTextTemplate)
     {
         return(true);
     }
     if (webSchedRecall.EmailText != oldWebSchedRecall.EmailText)
     {
         return(true);
     }
     if (webSchedRecall.GuidMessageToMobile != oldWebSchedRecall.GuidMessageToMobile)
     {
         return(true);
     }
     if (webSchedRecall.ShortGUIDSms != oldWebSchedRecall.ShortGUIDSms)
     {
         return(true);
     }
     if (webSchedRecall.ShortGUIDEmail != oldWebSchedRecall.ShortGUIDEmail)
     {
         return(true);
     }
     if (webSchedRecall.ResponseDescript != oldWebSchedRecall.ResponseDescript)
     {
         return(true);
     }
     if (webSchedRecall.Source != oldWebSchedRecall.Source)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 7
0
        ///<summary>Updates one WebSchedRecall in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(WebSchedRecall webSchedRecall, WebSchedRecall oldWebSchedRecall)
        {
            string command = "";

            if (webSchedRecall.ClinicNum != oldWebSchedRecall.ClinicNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ClinicNum = " + POut.Long(webSchedRecall.ClinicNum) + "";
            }
            if (webSchedRecall.PatNum != oldWebSchedRecall.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(webSchedRecall.PatNum) + "";
            }
            if (webSchedRecall.RecallNum != oldWebSchedRecall.RecallNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RecallNum = " + POut.Long(webSchedRecall.RecallNum) + "";
            }
            //DateTimeEntry not allowed to change
            if (webSchedRecall.DateDue.Date != oldWebSchedRecall.DateDue.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateDue = " + POut.Date(webSchedRecall.DateDue) + "";
            }
            if (webSchedRecall.ReminderCount != oldWebSchedRecall.ReminderCount)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ReminderCount = " + POut.Int(webSchedRecall.ReminderCount) + "";
            }
            if (webSchedRecall.PreferRecallMethod != oldWebSchedRecall.PreferRecallMethod)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PreferRecallMethod = " + POut.Int((int)webSchedRecall.PreferRecallMethod) + "";
            }
            if (webSchedRecall.DateTimeReminderSent != oldWebSchedRecall.DateTimeReminderSent)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeReminderSent = " + POut.DateT(webSchedRecall.DateTimeReminderSent) + "";
            }
            if (webSchedRecall.DateTimeSendFailed != oldWebSchedRecall.DateTimeSendFailed)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeSendFailed = " + POut.DateT(webSchedRecall.DateTimeSendFailed) + "";
            }
            if (webSchedRecall.EmailSendStatus != oldWebSchedRecall.EmailSendStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailSendStatus = " + POut.Int((int)webSchedRecall.EmailSendStatus) + "";
            }
            if (webSchedRecall.SmsSendStatus != oldWebSchedRecall.SmsSendStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SmsSendStatus = " + POut.Int((int)webSchedRecall.SmsSendStatus) + "";
            }
            if (webSchedRecall.PhonePat != oldWebSchedRecall.PhonePat)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PhonePat = '" + POut.String(webSchedRecall.PhonePat) + "'";
            }
            if (webSchedRecall.EmailPat != oldWebSchedRecall.EmailPat)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailPat = '" + POut.String(webSchedRecall.EmailPat) + "'";
            }
            if (webSchedRecall.MsgTextToMobileTemplate != oldWebSchedRecall.MsgTextToMobileTemplate)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgTextToMobileTemplate = " + DbHelper.ParamChar + "paramMsgTextToMobileTemplate";
            }
            if (webSchedRecall.MsgTextToMobile != oldWebSchedRecall.MsgTextToMobile)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgTextToMobile = " + DbHelper.ParamChar + "paramMsgTextToMobile";
            }
            if (webSchedRecall.EmailSubjTemplate != oldWebSchedRecall.EmailSubjTemplate)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailSubjTemplate = " + DbHelper.ParamChar + "paramEmailSubjTemplate";
            }
            if (webSchedRecall.EmailSubj != oldWebSchedRecall.EmailSubj)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailSubj = " + DbHelper.ParamChar + "paramEmailSubj";
            }
            if (webSchedRecall.EmailTextTemplate != oldWebSchedRecall.EmailTextTemplate)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailTextTemplate = " + DbHelper.ParamChar + "paramEmailTextTemplate";
            }
            if (webSchedRecall.EmailText != oldWebSchedRecall.EmailText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailText = " + DbHelper.ParamChar + "paramEmailText";
            }
            if (webSchedRecall.GuidMessageToMobile != oldWebSchedRecall.GuidMessageToMobile)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GuidMessageToMobile = " + DbHelper.ParamChar + "paramGuidMessageToMobile";
            }
            if (webSchedRecall.ShortGUIDSms != oldWebSchedRecall.ShortGUIDSms)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ShortGUIDSms = '" + POut.String(webSchedRecall.ShortGUIDSms) + "'";
            }
            if (webSchedRecall.ShortGUIDEmail != oldWebSchedRecall.ShortGUIDEmail)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ShortGUIDEmail = '" + POut.String(webSchedRecall.ShortGUIDEmail) + "'";
            }
            if (webSchedRecall.ResponseDescript != oldWebSchedRecall.ResponseDescript)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ResponseDescript = " + DbHelper.ParamChar + "paramResponseDescript";
            }
            if (webSchedRecall.Source != oldWebSchedRecall.Source)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Source = " + POut.Int((int)webSchedRecall.Source) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (webSchedRecall.MsgTextToMobileTemplate == null)
            {
                webSchedRecall.MsgTextToMobileTemplate = "";
            }
            OdSqlParameter paramMsgTextToMobileTemplate = new OdSqlParameter("paramMsgTextToMobileTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobileTemplate));

            if (webSchedRecall.MsgTextToMobile == null)
            {
                webSchedRecall.MsgTextToMobile = "";
            }
            OdSqlParameter paramMsgTextToMobile = new OdSqlParameter("paramMsgTextToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobile));

            if (webSchedRecall.EmailSubjTemplate == null)
            {
                webSchedRecall.EmailSubjTemplate = "";
            }
            OdSqlParameter paramEmailSubjTemplate = new OdSqlParameter("paramEmailSubjTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubjTemplate));

            if (webSchedRecall.EmailSubj == null)
            {
                webSchedRecall.EmailSubj = "";
            }
            OdSqlParameter paramEmailSubj = new OdSqlParameter("paramEmailSubj", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubj));

            if (webSchedRecall.EmailTextTemplate == null)
            {
                webSchedRecall.EmailTextTemplate = "";
            }
            OdSqlParameter paramEmailTextTemplate = new OdSqlParameter("paramEmailTextTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailTextTemplate));

            if (webSchedRecall.EmailText == null)
            {
                webSchedRecall.EmailText = "";
            }
            OdSqlParameter paramEmailText = new OdSqlParameter("paramEmailText", OdDbType.Text, POut.StringParam(webSchedRecall.EmailText));

            if (webSchedRecall.GuidMessageToMobile == null)
            {
                webSchedRecall.GuidMessageToMobile = "";
            }
            OdSqlParameter paramGuidMessageToMobile = new OdSqlParameter("paramGuidMessageToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.GuidMessageToMobile));

            if (webSchedRecall.ResponseDescript == null)
            {
                webSchedRecall.ResponseDescript = "";
            }
            OdSqlParameter paramResponseDescript = new OdSqlParameter("paramResponseDescript", OdDbType.Text, POut.StringParam(webSchedRecall.ResponseDescript));

            command = "UPDATE webschedrecall SET " + command
                      + " WHERE WebSchedRecallNum = " + POut.Long(webSchedRecall.WebSchedRecallNum);
            Db.NonQ(command, paramMsgTextToMobileTemplate, paramMsgTextToMobile, paramEmailSubjTemplate, paramEmailSubj, paramEmailTextTemplate, paramEmailText, paramGuidMessageToMobile, paramResponseDescript);
            return(true);
        }
Ejemplo n.º 8
0
        ///<summary>Updates one WebSchedRecall in the database.</summary>
        public static void Update(WebSchedRecall webSchedRecall)
        {
            string command = "UPDATE webschedrecall SET "
                             + "ClinicNum              =  " + POut.Long(webSchedRecall.ClinicNum) + ", "
                             + "PatNum                 =  " + POut.Long(webSchedRecall.PatNum) + ", "
                             + "RecallNum              =  " + POut.Long(webSchedRecall.RecallNum) + ", "
                             //DateTimeEntry not allowed to change
                             + "DateDue                =  " + POut.Date(webSchedRecall.DateDue) + ", "
                             + "ReminderCount          =  " + POut.Int(webSchedRecall.ReminderCount) + ", "
                             + "PreferRecallMethod     =  " + POut.Int((int)webSchedRecall.PreferRecallMethod) + ", "
                             + "DateTimeReminderSent   =  " + POut.DateT(webSchedRecall.DateTimeReminderSent) + ", "
                             + "DateTimeSendFailed     =  " + POut.DateT(webSchedRecall.DateTimeSendFailed) + ", "
                             + "EmailSendStatus        =  " + POut.Int((int)webSchedRecall.EmailSendStatus) + ", "
                             + "SmsSendStatus          =  " + POut.Int((int)webSchedRecall.SmsSendStatus) + ", "
                             + "PhonePat               = '" + POut.String(webSchedRecall.PhonePat) + "', "
                             + "EmailPat               = '" + POut.String(webSchedRecall.EmailPat) + "', "
                             + "MsgTextToMobileTemplate=  " + DbHelper.ParamChar + "paramMsgTextToMobileTemplate, "
                             + "MsgTextToMobile        =  " + DbHelper.ParamChar + "paramMsgTextToMobile, "
                             + "EmailSubjTemplate      =  " + DbHelper.ParamChar + "paramEmailSubjTemplate, "
                             + "EmailSubj              =  " + DbHelper.ParamChar + "paramEmailSubj, "
                             + "EmailTextTemplate      =  " + DbHelper.ParamChar + "paramEmailTextTemplate, "
                             + "EmailText              =  " + DbHelper.ParamChar + "paramEmailText, "
                             + "GuidMessageToMobile    =  " + DbHelper.ParamChar + "paramGuidMessageToMobile, "
                             + "ShortGUIDSms           = '" + POut.String(webSchedRecall.ShortGUIDSms) + "', "
                             + "ShortGUIDEmail         = '" + POut.String(webSchedRecall.ShortGUIDEmail) + "', "
                             + "ResponseDescript       =  " + DbHelper.ParamChar + "paramResponseDescript, "
                             + "Source                 =  " + POut.Int((int)webSchedRecall.Source) + " "
                             + "WHERE WebSchedRecallNum = " + POut.Long(webSchedRecall.WebSchedRecallNum);

            if (webSchedRecall.MsgTextToMobileTemplate == null)
            {
                webSchedRecall.MsgTextToMobileTemplate = "";
            }
            OdSqlParameter paramMsgTextToMobileTemplate = new OdSqlParameter("paramMsgTextToMobileTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobileTemplate));

            if (webSchedRecall.MsgTextToMobile == null)
            {
                webSchedRecall.MsgTextToMobile = "";
            }
            OdSqlParameter paramMsgTextToMobile = new OdSqlParameter("paramMsgTextToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobile));

            if (webSchedRecall.EmailSubjTemplate == null)
            {
                webSchedRecall.EmailSubjTemplate = "";
            }
            OdSqlParameter paramEmailSubjTemplate = new OdSqlParameter("paramEmailSubjTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubjTemplate));

            if (webSchedRecall.EmailSubj == null)
            {
                webSchedRecall.EmailSubj = "";
            }
            OdSqlParameter paramEmailSubj = new OdSqlParameter("paramEmailSubj", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubj));

            if (webSchedRecall.EmailTextTemplate == null)
            {
                webSchedRecall.EmailTextTemplate = "";
            }
            OdSqlParameter paramEmailTextTemplate = new OdSqlParameter("paramEmailTextTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailTextTemplate));

            if (webSchedRecall.EmailText == null)
            {
                webSchedRecall.EmailText = "";
            }
            OdSqlParameter paramEmailText = new OdSqlParameter("paramEmailText", OdDbType.Text, POut.StringParam(webSchedRecall.EmailText));

            if (webSchedRecall.GuidMessageToMobile == null)
            {
                webSchedRecall.GuidMessageToMobile = "";
            }
            OdSqlParameter paramGuidMessageToMobile = new OdSqlParameter("paramGuidMessageToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.GuidMessageToMobile));

            if (webSchedRecall.ResponseDescript == null)
            {
                webSchedRecall.ResponseDescript = "";
            }
            OdSqlParameter paramResponseDescript = new OdSqlParameter("paramResponseDescript", OdDbType.Text, POut.StringParam(webSchedRecall.ResponseDescript));

            Db.NonQ(command, paramMsgTextToMobileTemplate, paramMsgTextToMobile, paramEmailSubjTemplate, paramEmailSubj, paramEmailTextTemplate, paramEmailText, paramGuidMessageToMobile, paramResponseDescript);
        }
Ejemplo n.º 9
0
        ///<summary>Inserts one WebSchedRecall into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(WebSchedRecall webSchedRecall, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO webschedrecall (";

            if (!useExistingPK && isRandomKeys)
            {
                webSchedRecall.WebSchedRecallNum = ReplicationServers.GetKeyNoCache("webschedrecall", "WebSchedRecallNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "WebSchedRecallNum,";
            }
            command += "ClinicNum,PatNum,RecallNum,DateTimeEntry,DateDue,ReminderCount,PreferRecallMethod,DateTimeReminderSent,DateTimeSendFailed,EmailSendStatus,SmsSendStatus,PhonePat,EmailPat,MsgTextToMobileTemplate,MsgTextToMobile,EmailSubjTemplate,EmailSubj,EmailTextTemplate,EmailText,GuidMessageToMobile,ShortGUIDSms,ShortGUIDEmail,ResponseDescript,Source) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(webSchedRecall.WebSchedRecallNum) + ",";
            }
            command +=
                POut.Long(webSchedRecall.ClinicNum) + ","
                + POut.Long(webSchedRecall.PatNum) + ","
                + POut.Long(webSchedRecall.RecallNum) + ","
                + DbHelper.Now() + ","
                + POut.Date(webSchedRecall.DateDue) + ","
                + POut.Int(webSchedRecall.ReminderCount) + ","
                + POut.Int((int)webSchedRecall.PreferRecallMethod) + ","
                + POut.DateT(webSchedRecall.DateTimeReminderSent) + ","
                + POut.DateT(webSchedRecall.DateTimeSendFailed) + ","
                + POut.Int((int)webSchedRecall.EmailSendStatus) + ","
                + POut.Int((int)webSchedRecall.SmsSendStatus) + ","
                + "'" + POut.String(webSchedRecall.PhonePat) + "',"
                + "'" + POut.String(webSchedRecall.EmailPat) + "',"
                + DbHelper.ParamChar + "paramMsgTextToMobileTemplate,"
                + DbHelper.ParamChar + "paramMsgTextToMobile,"
                + DbHelper.ParamChar + "paramEmailSubjTemplate,"
                + DbHelper.ParamChar + "paramEmailSubj,"
                + DbHelper.ParamChar + "paramEmailTextTemplate,"
                + DbHelper.ParamChar + "paramEmailText,"
                + DbHelper.ParamChar + "paramGuidMessageToMobile,"
                + "'" + POut.String(webSchedRecall.ShortGUIDSms) + "',"
                + "'" + POut.String(webSchedRecall.ShortGUIDEmail) + "',"
                + DbHelper.ParamChar + "paramResponseDescript,"
                + POut.Int((int)webSchedRecall.Source) + ")";
            if (webSchedRecall.MsgTextToMobileTemplate == null)
            {
                webSchedRecall.MsgTextToMobileTemplate = "";
            }
            OdSqlParameter paramMsgTextToMobileTemplate = new OdSqlParameter("paramMsgTextToMobileTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobileTemplate));

            if (webSchedRecall.MsgTextToMobile == null)
            {
                webSchedRecall.MsgTextToMobile = "";
            }
            OdSqlParameter paramMsgTextToMobile = new OdSqlParameter("paramMsgTextToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.MsgTextToMobile));

            if (webSchedRecall.EmailSubjTemplate == null)
            {
                webSchedRecall.EmailSubjTemplate = "";
            }
            OdSqlParameter paramEmailSubjTemplate = new OdSqlParameter("paramEmailSubjTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubjTemplate));

            if (webSchedRecall.EmailSubj == null)
            {
                webSchedRecall.EmailSubj = "";
            }
            OdSqlParameter paramEmailSubj = new OdSqlParameter("paramEmailSubj", OdDbType.Text, POut.StringParam(webSchedRecall.EmailSubj));

            if (webSchedRecall.EmailTextTemplate == null)
            {
                webSchedRecall.EmailTextTemplate = "";
            }
            OdSqlParameter paramEmailTextTemplate = new OdSqlParameter("paramEmailTextTemplate", OdDbType.Text, POut.StringParam(webSchedRecall.EmailTextTemplate));

            if (webSchedRecall.EmailText == null)
            {
                webSchedRecall.EmailText = "";
            }
            OdSqlParameter paramEmailText = new OdSqlParameter("paramEmailText", OdDbType.Text, POut.StringParam(webSchedRecall.EmailText));

            if (webSchedRecall.GuidMessageToMobile == null)
            {
                webSchedRecall.GuidMessageToMobile = "";
            }
            OdSqlParameter paramGuidMessageToMobile = new OdSqlParameter("paramGuidMessageToMobile", OdDbType.Text, POut.StringParam(webSchedRecall.GuidMessageToMobile));

            if (webSchedRecall.ResponseDescript == null)
            {
                webSchedRecall.ResponseDescript = "";
            }
            OdSqlParameter paramResponseDescript = new OdSqlParameter("paramResponseDescript", OdDbType.Text, POut.StringParam(webSchedRecall.ResponseDescript));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramMsgTextToMobileTemplate, paramMsgTextToMobile, paramEmailSubjTemplate, paramEmailSubj, paramEmailTextTemplate, paramEmailText, paramGuidMessageToMobile, paramResponseDescript);
            }
            else
            {
                webSchedRecall.WebSchedRecallNum = Db.NonQ(command, true, "WebSchedRecallNum", "webSchedRecall", paramMsgTextToMobileTemplate, paramMsgTextToMobile, paramEmailSubjTemplate, paramEmailSubj, paramEmailTextTemplate, paramEmailText, paramGuidMessageToMobile, paramResponseDescript);
            }
            return(webSchedRecall.WebSchedRecallNum);
        }
Ejemplo n.º 10
0
 ///<summary>Inserts one WebSchedRecall into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(WebSchedRecall webSchedRecall)
 {
     return(InsertNoCache(webSchedRecall, false));
 }