예제 #1
0
    protected bool ConferenceLaunch(int meetingInfoId, string sendUser, string flag)
    {
        DateTime sendTime = default(DateTime);

        sendTime = DateTime.Now;
        DataTable dataTable = ConferenceManage.QuerySubsectionList(meetingInfoId);

        if (dataTable.Rows.Count > 0)
        {
            foreach (DataRow dataRow in dataTable.Rows)
            {
                if (dataRow["IsSms"].ToString() == "1")
                {
                    string message;
                    string types;
                    if (flag == "1")
                    {
                        message = string.Concat(new string[]
                        {
                            dataRow["CallHour"].ToString(),
                            "时",
                            dataRow["CallMinute"].ToString(),
                            "分",
                            dataRow["Topic"].ToString(),
                            ",请准时参加!"
                        });
                        types = "012";
                    }
                    else
                    {
                        message = string.Concat(new string[]
                        {
                            dataRow["CallHour"].ToString(),
                            "时",
                            dataRow["CallMinute"].ToString(),
                            "分",
                            dataRow["Topic"].ToString(),
                            "已取消,请相互转告!"
                        });
                        types = "013";
                    }
                    string text = dataRow["AttendManCodes"].ToString();
                    int    i    = text.IndexOf(",");
                    if (i > 0)
                    {
                        while (i > 0)
                        {
                            string receiveUser = text.Substring(0, i);
                            if (!this.SendSms(sendUser, receiveUser, message, sendTime, meetingInfoId, types))
                            {
                                bool result = false;
                                return(result);
                            }
                            text = text.Substring(i + 1, text.Length - i - 1);
                            i    = text.IndexOf(",");
                        }
                        if (!this.SendSms(sendUser, text, message, sendTime, meetingInfoId, types))
                        {
                            bool result = false;
                            return(result);
                        }
                    }
                    else
                    {
                        if (!this.SendSms(sendUser, text, message, sendTime, meetingInfoId, types))
                        {
                            bool result = false;
                            return(result);
                        }
                    }
                }
            }
            return(ConferenceManage.SetLaunchState(meetingInfoId, flag));
        }
        return(false);
    }