Exemple #1
0
        /// <summary>
        /// 自定义视图
        /// </summary>
        public cms_user viewtestModel()
        {
            using (SelectAction action = new SelectAction(""))
            {
                action.SqlClomns = "_cms_user.*,_cms_manager.name as  managername";
                {
                    //添加视图的关联关系
                    List <QueryField> field = new List <QueryField>();
                    field.Add(new QueryField()
                    {
                        FiledName = "mangerid", Condition = ConditionEnum.And, Value = "id"
                    });
                    action.AddJoin(ViewJoinEnum.leftjoin, "cms_user", "cms_manager", field);
                }


                action.SqlWhere(
                    new QueryField {
                    FiledName = cms_user.Columns.username, Value = "wangjun"
                });
                action.SqlWhere(cms_user.Columns.password, "123456");
                PageList <cms_user> lists = action.QueryPage <cms_user>(1);
                return(null);
            }
        }
Exemple #2
0
 public PageList <SmsBatchDetailsMoreInfo> GetList(int PageIndex, int PageSize, string phone, string state, string starttime, string endtime, int eid)
 {
     using (SelectAction action = new SelectAction(""))
     {
         action.SqlClomns = "_sms_batch_details.*,_sms_batch.batchname";
         {
             //添加视图的关联关系
             List <QueryField> field = new List <QueryField>();
             field.Add(new QueryField()
             {
                 Value     = SmsBatchDetailsInfo.Columns.BatchID,
                 Condition = ConditionEnum.And,
                 FiledName = SmsBatchInfo.Columns.ID
             });
             action.AddJoin(ViewJoinEnum.innerjoin, "sms_batch", "sms_batch_details", field);
         }
         if (eid != 1)
         {
             action.SqlWhere("_sms_batch." + SmsBatchInfo.Columns.EnterPriseID, eid);
         }
         if (!string.IsNullOrEmpty(phone))
         {
             action.SqlWhere(SmsBatchDetailsInfo.Columns.Phone, phone, RelationEnum.Like);
         }
         if (!string.IsNullOrEmpty(state) && int.Parse(state) > 0)
         {
             action.SqlWhere(SmsBatchDetailsInfo.Columns.State, state);
         }
         if (!string.IsNullOrEmpty(starttime) && string.IsNullOrEmpty(endtime))
         {
             action.SqlWhere(SmsBatchDetailsInfo.Columns.SubmitTime, starttime, ConditionEnum.And, RelationEnum.LargeThen);
         }
         if (!string.IsNullOrEmpty(endtime) && string.IsNullOrEmpty(starttime))
         {
             action.SqlWhere(SmsBatchDetailsInfo.Columns.SubmitTime, endtime, ConditionEnum.And, RelationEnum.LessThen);
         }
         if (!string.IsNullOrEmpty(endtime) && !string.IsNullOrEmpty(starttime))
         {
             action.SqlWhere(SmsBatchDetailsInfo.Columns.SubmitTime, starttime, endtime, ConditionEnum.And, RelationEnum.Between);
         }
         action.SqlOrderBy("_sms_batch_details.SubmitTime", OrderByEnum.Desc);
         action.PageSize = PageSize;
         return(action.QueryPage <SmsBatchDetailsMoreInfo>(PageIndex));
     }
 }
Exemple #3
0
 public PageList <BatchMoreInfo> GetList(int PageIndex, int PageSize, string batchname, string state, string starttime, string endtime, int eid)
 {
     using (SelectAction action = new SelectAction(""))
     {
         action.SqlClomns = "_sms_batch.*,_sms_batch_amount.RealAmount,_sms_batch_amount.SendAmount,_sms_batch_amount.SuccessAmount";
         {
             //添加视图的关联关系
             List <QueryField> field = new List <QueryField>();
             field.Add(new QueryField()
             {
                 Value     = SmsBatchAmountInfo.Columns.BatchID,
                 Condition = ConditionEnum.And,
                 FiledName = SmsBatchInfo.Columns.ID
             });
             action.AddJoin(ViewJoinEnum.leftjoin, "sms_batch", "sms_batch_amount", field);
         }
         if (eid != 1)
         {
             action.SqlWhere("_sms_batch." + SmsBatchInfo.Columns.EnterPriseID, eid);
         }
         if (!string.IsNullOrEmpty(batchname))
         {
             action.SqlWhere(SmsBatchInfo.Columns.BatchName, batchname, ConditionEnum.And, RelationEnum.Like);
         }
         if (!string.IsNullOrEmpty(state) && int.Parse(state) > 0)
         {
             action.SqlWhere(SmsBatchInfo.Columns.BatchState, state);
         }
         if (!string.IsNullOrEmpty(starttime) && string.IsNullOrEmpty(endtime))
         {
             action.SqlWhere(SmsBatchInfo.Columns.PostTime, starttime, ConditionEnum.And, RelationEnum.LargeThen);
         }
         if (!string.IsNullOrEmpty(endtime) && string.IsNullOrEmpty(starttime))
         {
             action.SqlWhere(SmsBatchInfo.Columns.PostTime, endtime, ConditionEnum.And, RelationEnum.LessThen);
         }
         if (!string.IsNullOrEmpty(endtime) && !string.IsNullOrEmpty(starttime))
         {
             action.SqlWhere(SmsBatchInfo.Columns.PostTime, starttime, endtime, ConditionEnum.And, RelationEnum.Between);
         }
         action.SqlOrderBy("_sms_batch.Createtime", OrderByEnum.Desc);
         action.PageSize = PageSize;
         return(action.QueryPage <BatchMoreInfo>(PageIndex));
     }
 }
Exemple #4
0
 /// <summary>
 /// 获取账号的基本信息
 /// </summary>
 /// <param name="username"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public SmsAddrecordInfo GetAccountInfo(string username, string password)
 {
     using (SelectAction action = new SelectAction(Entity))
     {
         action.SqlClomns = "_Sms_AddRecord.*";
         {
             //添加视图的关联关系
             List <QueryField> field = new List <QueryField>();
             field.Add(new QueryField()
             {
                 FiledName = SmsAddrecordInfo.Columns.AccountID,
                 Condition = ConditionEnum.And,
                 Value     = SmsAccountInfo.Columns.ID
             });
             action.AddJoin(ViewJoinEnum.leftjoin, "SmsAccountInfo", "Sms_AddRecord", field);
         }
         action.SqlWhere(SmsAccountInfo.Columns.Account, username);
         action.SqlWhere(SmsAccountInfo.Columns.Password, password);
         action.SqlOrderBy("_Sms_AddRecord." + SmsAddrecordInfo.Columns.CreateTime, OrderByEnum.Desc);
         return(action.QueryEntity <SmsAddrecordInfo>());
     }
 }
Exemple #5
0
 public List <SmsMoInfo> GetUserMo(string username, string password)
 {
     using (SelectAction action = new SelectAction(""))
     {
         action.SqlClomns = "_SmsMoInfo.*";
         {
             //添加视图的关联关系
             List <QueryField> field = new List <QueryField>();
             field.Add(new QueryField()
             {
                 Value     = SmsMoInfo.Columns.AccountID,
                 Condition = ConditionEnum.And,
                 FiledName = SmsAccountInfo.Columns.ID
             });
             action.AddJoin(ViewJoinEnum.innerjoin, "sms_account", "sms_mo", field);
         }
         action.SqlWhere(SmsAccountInfo.Columns.Account, username);
         action.SqlWhere(SmsAccountInfo.Columns.Password, password);
         action.PageSize = 20;
         return(action.QueryPage <SmsMoInfo>(1));
     }
 }