public void FinishPhoneMessageOperation(PhoneMessageType phoneMessageType) { PhoneMessage phoneMessage = _PhoneMessageDal.GetPhoneMessageByType(phoneMessageType); if (phoneMessage != null) { _PhoneMessageDal.FinishPhoneMessageByPKID(phoneMessage.PKID); } SendMessage(); }
/// <summary> /// 发送消息给下一个审核人 /// </summary> public void SendConfirmMessage(Account nextassessor, PhoneMessageType phoneMessageType) { nextassessor = _AccountBll.GetAccountById(nextassessor.Id); if (nextassessor.IsAcceptSMS) { PhoneMessage phoneMessage = _PhoneMessageDal.GetPhoneMessageByType(phoneMessageType); phoneMessage.Assessor = nextassessor; phoneMessage.Status = PhoneMessageStatus.ToBeSent; _PhoneMessageDal.UpdatePhoneMessage(phoneMessage); } SendMessage(); }
/// <summary> /// 发送取消短消息 /// </summary> public void SendCancelMessage(Account assessor, string message, PhoneMessageType phoneMessageType) { assessor = _AccountBll.GetAccountById(assessor.Id); if (assessor.IsAcceptSMS) { PhoneMessage phoneMessage = _PhoneMessageDal.GetPhoneMessageByType(phoneMessageType); phoneMessage.Assessor = assessor; phoneMessage.Message = message; phoneMessage.Status = PhoneMessageStatus.ToBeSent; _PhoneMessageDal.UpdatePhoneMessage(phoneMessage); } SendMessage(); }
/// <summary> /// /// </summary> public void FinishPhoneMessageOperationByAssessorID(PhoneMessageType phoneMessageType, int assessorID) { PhoneMessage phoneMessage = _PhoneMessageDal.GetPhoneMessageByType(phoneMessageType); if (phoneMessage != null) { if (phoneMessage.Assessor.Id == assessorID) { _PhoneMessageDal.FinishPhoneMessageByPKID(phoneMessage.PKID); } } SendMessage(); }
/// <summary> /// 发送新的加班,外出,等业务 /// </summary> public void SendNewMessage(Account requester, Account assessor, string message, PhoneMessageType phoneMessageType) { assessor = _AccountBll.GetAccountById(assessor.Id); if (assessor.IsAcceptSMS) { PhoneMessage phoneMessage = new PhoneMessage(); phoneMessage.Requester = requester; phoneMessage.Message = message; phoneMessage.PhoneMessageType = phoneMessageType; phoneMessage.Assessor = assessor; phoneMessage.Status = PhoneMessageStatus.ToBeSent; phoneMessage.Answer = ""; phoneMessage.PKID = _PhoneMessageDal.InsertPhoneMessage(phoneMessage); } SendMessage(); }
public override bool Equals(object obj) { PhoneMessageType phoneMessageType = obj as PhoneMessageType; if (phoneMessageType == null) { return(false); } else { if ( phoneMessageType.PhoneMessageEnumType.Equals(_PhoneMessageEnumType) && phoneMessageType.PKID.Equals(_PKID) ) { return(true); } else { return(false); } } }
/// <summary> /// /// </summary> /// <param name="phoneMessageType"></param> /// <returns></returns> public PhoneMessage GetPhoneMessageByType(PhoneMessageType phoneMessageType) { PhoneMessage phoneMessage = null; SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_Type, SqlDbType.Int).Value = phoneMessageType.PhoneMessageEnumType; cmd.Parameters.Add(_TypeID, SqlDbType.Int).Value = phoneMessageType.PKID; using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetPhoneMessageByType", cmd)) { while (sdr.Read()) { phoneMessage = new PhoneMessage(); phoneMessage.Message = sdr[_DBMessage].ToString(); phoneMessage.PhoneMessageType = new PhoneMessageType((PhoneMessageEnumType)sdr[_DBType], Convert.ToInt32(sdr[_DBTypeID])); phoneMessage.PKID = Convert.ToInt32(sdr[_DBPKID]); phoneMessage.Requester = new Account(Convert.ToInt32(sdr[_DBRequesterID]), "", ""); phoneMessage.Assessor = new Account(Convert.ToInt32(sdr[_DBAssessorID]), "", ""); phoneMessage.Answer = sdr[_DBAnswer].ToString(); phoneMessage.Status = (PhoneMessageStatus)sdr[_DBStatus]; phoneMessage.SendTime = sdr[_DBSendTime] == DBNull.Value ? Convert.ToDateTime("2008-11-1") : Convert.ToDateTime(sdr[_DBSendTime]); } } return(phoneMessage); }
///// <summary> ///// 通过类型和对应的id来删除message,针对网页审核后删除 ///// </summary> //public void DeletePhoneMessageByPhoneMessageType(PhoneMessageType phoneMessageType) //{ // PhoneMessage phoneMessage = _PhoneMessageDal.GetPhoneMessageByType(phoneMessageType); // if (phoneMessage != null) // { // _PhoneMessageDal.FinishPhoneMessageByType(phoneMessageType); // } // //发送被暂停的消息 // SendMessage(); //} /// <summary> /// 通过类型和对应的id来查找phonemessage /// </summary> public PhoneMessage GetPhoneMessageByPhoneMessageType(PhoneMessageType phoneMessageType) { return(_PhoneMessageDal.GetPhoneMessageByType(phoneMessageType)); }