Ejemplo n.º 1
0
 /// <summary>
 /// ado 短信查车列表
 /// </summary>
 /// <param name="vehicleCodeList"></param>
 /// <param name="customerName"></param>
 /// <param name="telephone"></param>
 /// <param name="tenantCode"></param>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="rowCount"></param>
 /// <returns></returns>
 public IList<EMSMSQueryVehicle> GetNewSMSQueryList(IList<Guid> vehicleCodeList, string customerName, string telephone,
     string tenantCode, int pageIndex, int pageSize, ref int rowCount)
 {
     List<EMSMSQueryVehicle> smsVeList = new List<EMSMSQueryVehicle>();
     SMSVehicleDAL smsDal = new SMSVehicleDAL();
     smsVeList = smsDal.SMSQueryList(vehicleCodeList, customerName, telephone, tenantCode, pageIndex, pageSize, ref rowCount);
     return smsVeList;
 }
Ejemplo n.º 2
0
        public void Add(EMSMSQueryVehicle smsQuery)
        {
            bool exist = IsExistTelephone(smsQuery.CustomerTelephone, null);
            if (exist)
            {
                throw new BusinessException("手机号码己存在,请输入其它号码。");
            }
            //using (IRepository repository = SessionManager.CreateRepository(typeof(EMSMSQueryVehicle)))
            //{

            //    repository.Save(smsQuery);
            //}
            //优化代码
            else
            {
                SMSVehicleDAL dal = new SMSVehicleDAL();
                dal.AddSmsVehicle(smsQuery);
            }
        }
Ejemplo n.º 3
0
 public EMSMSQueryVehicle GetSMSQuery(ulong smsid)
 {
     //using (IRepository repository = SessionManager.CreateRepository(typeof(EMSMSQueryVehicle)))
     //{
     //    return repository.Get<EMSMSQueryVehicle>(smsid);
     //}
     SMSVehicleDAL dal = new SMSVehicleDAL();
     return dal.GetSMSQuery(smsid);
 }
Ejemplo n.º 4
0
        public void Modify(EMSMSQueryVehicle smsQuery)
        {
            EMSMSQueryVehicle oldSetting = GetSMSQuery(smsQuery.sms_vehicle_set_id);
            bool exist = IsExistTelephone(smsQuery.CustomerTelephone, oldSetting.sms_vehicle_set_id.ToString());
            if (exist)
            {
                throw new BusinessException("手机号码己存在,请输入其它号码。");
            }
            //using (IRepository repository = SessionManager.CreateRepository(typeof(EMSMSQueryVehicle)))
            //{

            //    repository.Update(smsQuery);
            //}
            //代码优化
            else
            {
                SMSVehicleDAL dal = new SMSVehicleDAL();
                dal.UpdateSmsVehicle(smsQuery);
            }
        }
Ejemplo n.º 5
0
        public IList<EWebSMSAndUserNew> SearchNewUnRead(IList<Guid> ltVehicleCode, string userCode, IList<int> ltType, int rowIndex, int pageSize, out int rowCount)
        {
            //using (IRepository repository = SessionManager.CreateRepository(typeof(EWebSMSAndUser)))
            //{
            //    IList<EWebSMSAndUserNew> list = new List<EWebSMSAndUserNew>();
            //    Expression expression = null;
            //    Query query = new Query(typeof(EWebSMSAndUserNew));
            //    ExpressionUtility<string>.AddExpression("ReceiveUserCode", userCode, BinaryOperatorType.EqualTo, ref expression);
            //    ExpressionUtility<bool>.AddExpression("IsRead", false, BinaryOperatorType.EqualTo, ref expression);
            //    if (!ltVehicleCode.IsNullOrEmpty())
            //    {
            //        query.Associations.Add(new Association("Info"));
            //        ExpressionUtility<Guid>.AddExpression("Info.VehicleCode", ltVehicleCode, PolynaryOperatorType.In, ref expression);
            //    }
            //    ExpressionUtility<int>.AddExpression("SMSInfoType", ltType, PolynaryOperatorType.In, ref expression);

            //    query.Order = Order.Asc("IsRead") & Order.Desc("ReceiveTime");
            //    query.Expression = expression;
            //    query.Projections.Add(Projection.RowCount());
            //    rowCount = repository.Single<int>(query);
            //    if (rowCount == 0)
            //        return null;
            //    query.Index = rowIndex;
            //    query.Count = pageSize;
            //    query.Projections.Clear();
            //    list = repository.List<EWebSMSAndUserNew>(query);

            //    return list;
            //}
            //代码优化后
            SMSVehicleDAL smsDal = new SMSVehicleDAL();
            return  smsDal.GetSearchNewUnRead(ltVehicleCode, userCode, ltType, rowIndex, pageSize, out rowCount);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新报警提醒信息为已读状态
        /// </summary>
        /// <param name="recordIdList">记录编号数组</param>
        /// <returns>未读记录条数</returns>
        public void SetUnReadToRead(Guid[] recordIdList)
        {
            //string connectionStr = ConfigurationManager.ConnectionStrings[@"SelpConnectionStr"].ConnectionString;
            //string sql = "";
            //for (int i = 0; i < recordIdList.Length; i++)
            //{
            //    sql += string.Format(@"delete from gps_websmsanduser_new where recordid='{0}';update gps_websmsanduser set isread=1,readtime='{1}' where  recordid='{0}';", recordIdList[i].ToString(), System.DateTime.Now);
            //}

            //MySqlHelper.ExecuteNonQuery(connectionStr, sql);
            //代码优化及纠正错误
            SMSVehicleDAL veDal = new SMSVehicleDAL();
            veDal.SetReadOper(recordIdList);
        }