Exemple #1
0
 /// <summary>
 /// 显示数据
 /// </summary>
 /// <param name="resultList">要显示的数据</param>
 protected virtual void ShowItemsOnGrid(QueryResultList <TEntity> resultList)
 {
     GridView.Rows.Clear();
     if (resultList != null)
     {
         if (resultList.Result != ResultCode.Successful)
         {
             MessageBox.Show(resultList.Message);
             return;
         }
         var items = resultList.QueryObjects;
         if (items != null && items.Count > 0)
         {
             foreach (var item in items)
             {
                 int row = GridView.Rows.Add();
                 ShowItemInGridViewRow(GridView.Rows[row], item);
                 GridView.Rows[row].Tag = item;
             }
         }
         if (this.GridView.Rows.Count > 0)
         {
             ShowRowBackColor();
             this.GridView.Rows[0].Selected = false;
         }
         this.ucPaging1.ShowState(resultList.PageSize, resultList.PageIndex, (items != null ? items.Count : 0), resultList.TotalCount);
     }
     else
     {
         this.ucPaging1.Init();
     }
 }
Exemple #2
0
        private void ItemSearching_Handler(object sender, EventArgs e)
        {
            this.customDataGridview1.Rows.Clear();
            RecordSearchCondition con = new RecordSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.CardID    = this.txtCardID.Text.Trim();
            con.Operator  = this.comOperator.SelectecOperator;
            con.StationID = this.comWorkStation.Text.Trim();
            FreeAuthorizationLogBll bll = new FreeAuthorizationLogBll(Ralid.Park.BusinessModel.Configuration.AppSettings.CurrentSetting.ParkConnect);
            QueryResultList <FreeAuthorizationLog> result = bll.GetFreeAuthorizationLogs(con);

            if (result.Result == ResultCode.Successful)
            {
                List <FreeAuthorizationLog> items = (from log in result.QueryObjects
                                                     orderby log.LogDateTime descending
                                                     select log).ToList();
                foreach (FreeAuthorizationLog alarm in items)
                {
                    int row = this.customDataGridview1.Rows.Add();
                    ShowFreeAuthorizationLogOnRow(this.customDataGridview1.Rows[row], alarm);
                }
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
        public QueryResultList <ConsultationShowData> My([FromBody] string queryString)
        {
            var result = new QueryResultList <ConsultationShowData>();


            var request = JsonHelper.Build <QueryRequest <int> >(queryString);

            if (request.Body <= 0)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            if (request.PageInfo == null)
            {
                result.Message = "分页参数为NULL";
                return(result);
            }


            var verify = ValidaQueryString.Valida(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new ConsultationBP().GetUserCon(request);
            return(result);
        }
Exemple #4
0
        public QueryResultList <ArticleShowData> GetDailyNews([FromBody] string queryString)
        {
            var result = new QueryResultList <ArticleShowData>();


            var request = JsonHelper.Build <QueryRequest <ArticleQueryData> >(queryString);

            if (request.Body == null)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            if (request.PageInfo == null)
            {
                result.Message = "分页参数为NULL";
                return(result);
            }


            var verify = ValidaQueryString.ValidaDevice(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new ArticleBP().GetDailyNews(request);
            return(result);
        }
Exemple #5
0
        public QueryResultList <MenuExtentData> GetRoleMenuExtends()
        {
            var result = new QueryResultList <MenuExtentData>();

            try
            {
                var menus = Cache.Instance["mango_rolemenuextends"];
                if (menus == null)
                {
                    result.Body = RoleRightDA.GetRoleMenuExtends();

                    Cache.Instance.Add("mango_rolemenuextends", result.Body);
                }
                else
                {
                    result.Body = menus as List <MenuExtentData>;
                }


                result.ErrCode = 0;
                result.Message = "ok";
            }
            catch (Exception ex)
            {
                Logger.WriteException("GetRoleMenuExtends", ex, "");
                result.ErrCode = -1;
                result.Message = ex.Message;
            }

            return(result);
        }
Exemple #6
0
        public QueryResultList <TInfo> GetAll()
        {
            QueryResultList <TInfo> result;

            try
            {
                ParkDataContext parking = ParkDataContextFactory.CreateParking(ConnectStr);
                if (parking == null)
                {
                    result = new QueryResultList <TInfo>(ResultCode.CannotConnectServer, ResultCodeDecription.GetDescription(ResultCode.CannotConnectServer), new List <TInfo>());
                }
                else
                {
                    List <TInfo> infoes = GetingAllItems(parking);
                    result = new QueryResultList <TInfo>(ResultCode.Successful, successMsg, infoes);
                }
            }
            catch (SqlException ex)
            {
                result = new QueryResultList <TInfo>(ResultCodeResolver.GetFromSqlExceptionNumber(ex.Number), ex.Message, new List <TInfo>());
                ExceptionPolicy.HandleException(ex, this.GetType().Name + "." + "GetAll()");
            }
            catch (Exception ex)
            {
                result = new QueryResultList <TInfo>(ResultCode.Fail, ex.Message, new List <TInfo>());
                ExceptionPolicy.HandleException(ex, this.GetType().Name + "." + "GetAll()");
            }
            return(result);
        }
        private void ItemSearching_Handler(object sender, EventArgs e)
        {
            this.customDataGridview1.Rows.Clear();
            AlarmSearchCondition con = new AlarmSearchCondition();

            con.AlarmSource = this.entranceComboBox1.SelectedEntranceName;
            if (Enum.IsDefined(typeof(AlarmType), this.alarmTypeComboBox1.SelectedAlarmType))
            {
                con.AlarmType = this.alarmTypeComboBox1.SelectedAlarmType;
            }
            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.Operator = this.operatorCombobox1.SelectecOperator;
            AlarmBll bll = new AlarmBll(Ralid.Park.BusinessModel.Configuration.AppSettings.CurrentSetting.ParkConnect);
            QueryResultList <AlarmInfo> result = bll.GetAlarms(con);

            if (result.Result == ResultCode.Successful)
            {
                List <AlarmInfo> items = (from alarm in result.QueryObjects
                                          orderby alarm.AlarmDateTime descending
                                          select alarm).ToList();
                foreach (AlarmInfo alarm in items)
                {
                    int row = this.customDataGridview1.Rows.Add();
                    ShowAlarmOnRow(this.customDataGridview1.Rows[row], alarm);
                }
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
Exemple #8
0
        /// <summary>
        /// 获取角色id
        /// </summary>
        /// <returns></returns>
        public QueryResultList <RoleData> GetRoleTree()
        {
            var result = new QueryResultList <RoleData>();

            try
            {
                var roles = Cache.Instance["mango_roles"];
                if (roles == null)
                {
                    result.Body = RoleRightDA.GetRoles("A");
                    if (result.Body == null || result.Body.Count == 0)
                    {
                        throw new Exception("没有获取到相关角色");
                    }

                    Cache.Instance.Add("mango_roles", result.Body);
                }
                else
                {
                    result.Body = roles as List <RoleData>;
                }


                result.ErrCode = 0;
                result.Message = "ok";
            }
            catch (Exception ex)
            {
                Logger.WriteException("GetRoles", ex, "");
                result.ErrCode = -1;
                result.Message = ex.Message;
            }

            return(result);
        }
        private void ItemSearching_Handler(object sender, EventArgs e)
        {
            PreferentialReportSearchCondition con = new PreferentialReportSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.CardID        = this.txtCardID.Text.Trim();
            con.BusinessName  = this.cmbBusiness.Text.Trim();
            con.StationIDs    = this.txtWorkstations.Tag as List <string>;
            con.OperatorNames = this.txtOperators.Tag as List <string>;
            //附加查询条件
            con.CancelReason = this.txtCancelReason.Text.Trim();
            if (!string.IsNullOrEmpty(this.txtHour.Text))
            {
                try
                {
                    con.Hour = Convert.ToInt32(this.txtHour.Text.Trim());
                }
                catch { }
            }

            QueryResultList <PREPreferentialLog> result = _LogBLL.GetPreferentials(con);

            if (result.Result == ResultCode.Successful)
            {
                ShowReportsOnGrid(result.QueryObjects);
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
        private QueryResultList <CardPaymentInfo> GetPayRecord()
        {
            CardPaymentRecordSearchCondition con = new CardPaymentRecordSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval2.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval2.EndDateTime;
            // add by tom,2012-2-14
            con.CardType = this.cardTypeComboBox1.SelectedCardType;
            con.CardID   = this.txtCardID.Text.Trim();
            con.Source   = this.ucEntrance2.SelectedEntrances;
            con.CarPlate = this.txtCarPlate.Text;
            // end

            if (this.operatorComboBox2.SelectecOperator != null)
            {
                con.Operator = this.operatorComboBox2.SelectecOperator;
            }
            con.StationID = this.workStationCombobox2.Text;

            QueryResultList <CardPaymentInfo> result = bll.GetItems(con);

            this.CardPaymentList = SortCardPaymentData(result.QueryObjects);

            if (result.Result == ResultCode.Successful)
            {
                ShowReportsOnDetailGrid(result.QueryObjects);
            }
            else
            {
                MessageBox.Show(result.Message);
            }
            return(result);
        }
Exemple #11
0
        public QueryResultList <VideoSourceInfo> GetVideoSourcesOfEntrance(int entranceID)
        {
            QueryResultList <VideoSourceInfo> result = GetAllVideoSources();

            result.QueryObjects = result.QueryObjects.Where(v => v.EntranceID == entranceID).ToList();
            return(result);
        }
Exemple #12
0
        public virtual QueryResultList QueryRMAProductInventory(RMAInventoryQueryFilter request)
        {
            QueryResultList resultList = new QueryResultList();
            int             totalCount;
            decimal         totalMisCost;
            var             dataTable = ObjectFactory <IReportQueryDA> .Instance.QueryRMAProductInventory(request, out totalCount, out totalMisCost);

            QueryResult resultTable = new QueryResult()
            {
                Data       = dataTable,
                TotalCount = totalCount
            };
            DataTable dt = new DataTable();

            dt.Columns.Add("TotleMisCost", typeof(decimal));
            dt.Rows.Add(totalMisCost);

            QueryResult MisCost = new QueryResult()
            {
                Data = dt
            };

            resultList.Add(resultTable);
            resultList.Add(MisCost);
            return(resultList);
        }
Exemple #13
0
        public QueryResultList <ArticleShowData> GetDailyNews(QueryRequest <ArticleQueryData> query)
        {
            var result = new QueryResultList <ArticleShowData>();

            try
            {
                result = ArticleDA.GetDailyNews(query);
                if (result.Body == null)
                {
                    result.Body = new List <ArticleShowData>();
                }


                result.ErrCode = 0;
                result.Message = "ok";
            }
            catch (Exception ex)
            {
                Logger.WriteException("GetDailyNews", ex, query);
                result.ErrCode = -1;
                result.Message = ex.Message;
            }

            return(result);
        }
Exemple #14
0
        public QueryResultList <TInfo> GetItems(SearchCondition search)
        {
            QueryResultList <TInfo> result;

            try
            {
                ParkDataContext parking = ParkDataContextFactory.CreateParking(ConnectStr);
                List <TInfo>    infoes;
                if (search != null)
                {
                    infoes = GetingItems(parking, search);
                }
                else
                {
                    infoes = GetingAllItems(parking);
                }
                result = new QueryResultList <TInfo>(ResultCode.Successful, successMsg, infoes);
            }
            catch (Exception ex)
            {
                result = new QueryResultList <TInfo>(ResultCode.Fail, "从数据库获取数据时发生错误!", new List <TInfo>());
                ExceptionPolicy.HandleException(ex, this.GetType().Name + "." + "GetItems()");
            }
            return(result);
        }
Exemple #15
0
        public QueryResultList <CustomerLawyerData> GetLawyers(QueryRequest <CustomerQueryData> request)
        {
            var result = new QueryResultList <CustomerLawyerData>();

            if (request.Body == null)
            {
                result.Message = "请求参数为NULL";
                return(result);
            }

            if (request.PageInfo == null)
            {
                result.Message = "分页参数为NULL";
                return(result);
            }


            var verify = ValidaQueryString.Valida(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = service.GetLawyers(request);
            return(result);
        }
Exemple #16
0
        public QueryResultList <CustomerSkillData> GetCustomerSkill(RequestOperation request)
        {
            var result = new QueryResultList <CustomerSkillData>();

            try
            {
                var data = CustomerDA.GetCustomerSkill(request);

                if (data == null)
                {
                    data = new List <CustomerSkillData>();
                }
                result.Body = data;

                result.ErrCode = 0;
                result.Message = "ok";
            }
            catch (Exception ex)
            {
                //System.Reflection.MethodInfo.GetCurrentMethod().Name
                Logger.WriteException("GetCustomerSkill", ex, request);
                result.ErrCode = -1;
                result.Message = ex.Message;
            }

            return(result);
        }
        public QueryResultList <DeviceInfo> GetAttendanceReaders()
        {
            QueryResultList <DeviceInfo> ret   = ProviderFactory.Create <IDeviceInfoProvider>(_RepoUri).GetItems(null);
            List <DeviceInfo>            items = ret.QueryObjects;

            if (items != null && items.Count > 0)
            {
                items = items.Where(item => item.ForAttendance).ToList();
            }
            return(new QueryResultList <DeviceInfo>(ret.Result, items));
        }
        protected override void OnItemSearching(EventArgs e)
        {
            this.customDataGridView1.Rows.Clear();
            CardPaymentRecordSearchCondition con = new CardPaymentRecordSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.CardType       = this.comCardType.SelectedCardType;
            con.CardID         = this.txtCardID.Text.Trim();
            con.OperatorCardID = this.txtOperatorCardID.Text.Trim();
            con.PaymentCode    = this.comPaymentCode.SelectedPaymentCode;

            if (chkPaymentMode.Checked)
            {
                con.PaymentMode = comPaymentMode.SelectedPaymentMode;
            }

            if (this.comOperator.SelectecOperator != null)
            {
                con.Operator = this.comOperator.SelectecOperator;
            }
            if (carTypeComboBox1.SelectedIndex > 0)
            {
                con.CarType = carTypeComboBox1.SelectedCarType;
            }
            con.StationID = this.workStationCombobox1.Text;

            CardPaymentRecordBll bll = new CardPaymentRecordBll(AppSettings.CurrentSetting.ParkConnect);
            QueryResultList <CardPaymentInfo> result = bll.GetItems(con);

            if (result.Result == ResultCode.Successful)
            {
                CarFlowStatisticsType group;
                if (this.rdPerHour.Checked)
                {
                    group = CarFlowStatisticsType.perHour;
                }
                else if (this.rdPerDay.Checked)
                {
                    group = CarFlowStatisticsType.perDay;
                }
                else
                {
                    group = CarFlowStatisticsType.perMonth;
                }
                GroupBy(result.QueryObjects, group);
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
Exemple #19
0
        private void ItemSearching_Handler(object sender, EventArgs e)
        {
            CardPaymentRecordSearchCondition con = new CardPaymentRecordSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.CardType        = this.comCardType.SelectedCardType;
            con.CardID          = this.txtCardID.Text.Trim();
            con.CardCertificate = txtCertificate.Text.Trim();
            if (carTypeComboBox1.SelectedIndex > 0)
            {
                con.CarType = carTypeComboBox1.SelectedCarType;
            }
            if (rdSettled.Checked)
            {
                con.IsUnSettled = false;
            }
            if (rdUnsettled.Checked)
            {
                con.IsUnSettled = true;
            }
            if (chkCenterCharge.Checked)
            {
                con.IsCenterCharge = true;
            }
            if (chkPaymentMode.Checked)
            {
                con.PaymentMode = comPaymentMode.SelectedPaymentMode;
            }
            con.CarPlate = this.txtCarPlate.Text.Trim();

            if (this.comOperator.SelectecOperator != null)
            {
                con.Operator = this.comOperator.SelectecOperator;
            }
            con.StationID      = this.workStationCombobox1.Text.Trim();
            con.PaymentCode    = this.comPaymentCode.SelectedPaymentCode;
            con.OperatorCardID = this.txtOperatorCardID.Text.Trim();;

            CardPaymentRecordBll bll = new CardPaymentRecordBll(AppSettings.CurrentSetting.ParkConnect);
            QueryResultList <CardPaymentInfo> result = bll.GetItems(con);

            if (result.Result == ResultCode.Successful)
            {
                ShowReportsOnGrid(result.QueryObjects);
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
Exemple #20
0
        /// <summary>
        /// 导出停车场参数设置为xml文件
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <returns></returns>
        public CommandResult ExportParameter(string path)
        {
            CommandResult result = null;

            try
            {
                OperatorBll obll = new OperatorBll(_repoUri);
                QueryResultList <OperatorInfo> operators = obll.GetAllOperators();

                WorkstationBll wbll = new WorkstationBll(_repoUri);
                QueryResultList <WorkStationInfo> workstations = wbll.GetAllWorkstations();

                APMBll abll = new APMBll(_repoUri);
                QueryResultList <APM> apms = abll.GetAllItems();

                if (operators.Result == ResultCode.Successful &&
                    workstations.Result == ResultCode.Successful &&
                    apms.Result == ResultCode.Successful)
                {
                    ParkingParameterDataBuffer parameter = new ParkingParameterDataBuffer();
                    parameter.UserSetting           = UserSetting.Current;
                    parameter.HolidaySetting        = HolidaySetting.Current;
                    parameter.AccessSetting         = AccessSetting.Current;
                    parameter.TariffSetting         = TariffSetting.Current;
                    parameter.CarTypeSetting        = CarTypeSetting.Current;
                    parameter.CustomCardTypeSetting = CustomCardTypeSetting.Current;
                    parameter.BaseCardTypeSetting   = BaseCardTypeSetting.Current;
                    parameter.KeySetting            = KeySetting.Current;
                    parameter.Operators             = operators.QueryObjects;
                    parameter.WorkStations          = workstations.QueryObjects;
                    parameter.APMs = apms.QueryObjects;

                    DataContractSerializer ser = new DataContractSerializer(typeof(ParkingParameterDataBuffer));
                    using (FileStream stream = new FileStream(path, FileMode.Create, FileAccess.Write))
                    {
                        ser.WriteObject(stream, parameter);
                    }
                    result = new CommandResult(ResultCode.Successful);
                }
                else
                {
                    result = new CommandResult(ResultCode.Fail, "获取系统参数设置失败!");
                }
            }
            catch (Exception ex)
            {
                result = new CommandResult(ResultCode.Fail, ex.Message);
                Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex);
            }
            return(result);
        }
Exemple #21
0
        public static QueryResultList <ConsultationShowData> GetUserCon(QueryRequest <int> query)
        {
            var         result = new QueryResultList <ConsultationShowData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("Consultation_GetUserCon");

            cmd.SetParameterValue("@UserID", query.Body);

            //cmd.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);
            //cmd.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            //cmd.SetParameterValue("@SortType", query.PageInfo.SortType);
            //cmd.SetParameterValue("@SortField", query.PageInfo.SortField);
            result.Body = cmd.ExecuteEntityList <ConsultationShowData>();
            return(result);
        }
Exemple #22
0
        /// <summary>
        /// 获取卡片在某个时间的第一个卡片事件
        /// </summary>
        /// <param name="cardID"></param>
        /// <param name="cardEventDateTime"></param>
        /// <returns></returns>
        public CardEventRecord GetFirstCardEvent(string cardID, DateTime cardEventDateTime)
        {
            RecordSearchCondition con = new RecordSearchCondition();

            con.CardID = cardID;
            con.RecordDateTimeRange = new DateTimeRange(cardEventDateTime, cardEventDateTime);
            QueryResultList <CardEventRecord> ret = provider.GetItems(con);

            if (ret.Result == ResultCode.Successful && ret.QueryObjects.Count > 0)
            {
                return(ret.QueryObjects[0]);
            }
            return(null);
        }
Exemple #23
0
        public static QueryResultList <ArticleShowData> GetShowItems(QueryRequest <string> query)
        {
            var         result = new QueryResultList <ArticleShowData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("Article_GetShowItems");

            string[] types = query.Body.Split(',');
            for (int i = 0; i < types.Length; i++)
            {
                cmd.SetParameterValue("@ArtType" + (i + 1), types[i]);
            }
            cmd.ReplaceParameterValue("@PageSize", query.PageInfo.PageSize + "");
            result.Body = cmd.ExecuteEntityList <ArticleShowData>();
            //result.TotalCount = (int)cmd.GetParameterValue("@TotalCount");
            return(result);
        }
Exemple #24
0
        public static QueryResultList <MaterialData> GetItems(QueryRequest <MaterialQueryData> query)
        {
            var         result = new QueryResultList <MaterialData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("Material_GetItems");

            cmd.SetParameterValue("@Type", query.Body.Type);
            cmd.ReplaceParameterValue("@PageSize", query.PageInfo.PageSize + "");
            //cmd.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);
            //cmd.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            //cmd.SetParameterValue("@SortType", query.PageInfo.SortType);
            //cmd.SetParameterValue("@SortField", query.PageInfo.SortField);
            result.Body = cmd.ExecuteEntityList <MaterialData>();
            //result.TotalCount = (int)cmd.GetParameterValue("@TotalCount");
            return(result);
        }
Exemple #25
0
        public QueryResultList <CustomerSkillData> GetCustomerSkill(RequestOperation request)
        {
            var result = new QueryResultList <CustomerSkillData>();

            var verify = ValidaQueryString.Valida(request.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = new CustomerBP().GetCustomerSkill(request);
            return(result);
        }
Exemple #26
0
        public static QueryResultList <UserRoleData> GetUserRoles(QueryRequest <UserRoleQueryData> query)
        {
            var         result = new QueryResultList <UserRoleData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("RoleRight_GetUserRoles");

            cmd.SetParameterValue("@UserRoleID", query.Body.UserRoleID);
            cmd.SetParameterValue("@Account", query.Body.Account);

            cmd.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);
            cmd.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            cmd.SetParameterValue("@SortType", query.PageInfo.SortType);
            cmd.SetParameterValue("@SortField", query.PageInfo.SortField);
            result.Body = cmd.ExecuteEntityList <UserRoleData>();
            return(result);
        }
        public QueryResult ExportPayable(PayableQueryFilter request)
        {
            QueryResultList resultList = new QueryResultList();
            int             totalCount;
            DataTable       dtStatistical;
            var             dataTable = ObjectFactory <IPayableQueryDA> .Instance.QueryPayable(request, out totalCount, out dtStatistical);

            dataTable.Columns.Add("OrderIDDesc");
            dataTable.Columns.Add("Remainder");
            foreach (DataRow row in dataTable.Rows.AsParallel())
            {
                string batchnum = "";
                if (!row.IsNull("BatchNumber") && !string.IsNullOrWhiteSpace(row["BatchNumber"].ToString()))
                {
                    batchnum = "-" + row["BatchNumber"].ToString().PadLeft(2, '0');
                }

                if (row["OrderType"].ToString() == "0")
                {
                    row["OrderIDDesc"] = row["OrderID"] + batchnum;
                }
                else if (row["OrderType"].ToString() == "7")
                {
                    row["OrderIDDesc"] = row["OrderSysNo"] + batchnum;
                }
                else if (row["OrderType"].ToString() == "5")
                {
                    row["OrderIDDesc"] = row["OrderID"] + "A";
                }
                else
                {
                    row["OrderIDDesc"] = row["OrderID"];
                }

                if (!row.IsNull("PayableAmt") && !row.IsNull("AlreadyPayAmt"))
                {
                    row["PayableAmt"]    = ((decimal)row["PayableAmt"]).ToString(InvoiceConst.StringFormat.DecimalFormat);
                    row["AlreadyPayAmt"] = ((decimal)row["AlreadyPayAmt"]).ToString(InvoiceConst.StringFormat.DecimalFormat);

                    row["Remainder"] = (((decimal)row["PayableAmt"]) - ((decimal)row["AlreadyPayAmt"])).ToString(InvoiceConst.StringFormat.DecimalFormat);
                }
            }
            return(new QueryResult()
            {
                Data = dataTable,
                TotalCount = totalCount
            });
        }
Exemple #28
0
        public QueryResultList <RoleData> GetRoles(RequestOperation <string> query)
        {
            var result = new QueryResultList <RoleData>();


            var verify = ValidaQueryString.Valida(query.Header);

            if (verify.ErrCode != 0)
            {
                result.ErrCode = verify.ErrCode;
                result.Message = verify.Message;
                return(result);
            }
            result = service.GetRoles(query.Body);
            return(result);
        }
        /// <summary>
        /// 删除卡片某时间的缴费记录
        /// </summary>
        /// <param name="cardid"></param>
        /// <param name="datetime"></param>
        public void DeleteCardPayment(string cardid, DateTime datetime)
        {
            RecordSearchCondition search = new RecordSearchCondition();

            search.CardID = cardid;
            search.RecordDateTimeRange = new DateTimeRange(datetime, datetime);
            QueryResultList <LDB_CardPaymentInfo> records = _Provider.GetItems(search);

            if (records.Result == ResultCode.Successful)
            {
                foreach (LDB_CardPaymentInfo record in records.QueryObjects)
                {
                    _Provider.Delete(record);
                }
            }
        }
Exemple #30
0
        public static QueryResultList <CustomerLawyerShowData> GetShowLawyers(QueryRequest <CustomerQueryData> query)
        {
            var         result = new QueryResultList <CustomerLawyerShowData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("Customer_GetShowLawyers");

            cmd.SetParameterValue("@CustomerType", query.Body.CustomerType);
            cmd.SetParameterValue("@AuditStatus", query.Body.AuditStatus);
            cmd.SetParameterValue("@Mobile", query.Body.Mobile);

            cmd.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);
            cmd.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            cmd.SetParameterValue("@SortType", query.PageInfo.SortType);
            cmd.SetParameterValue("@SortField", query.PageInfo.SortField);
            result.Body = cmd.ExecuteEntityList <CustomerLawyerShowData>();
            return(result);
        }
        public void FindPerson(QueryResultList results)
        {
            QueryResult r = results.Where(x => Id.Contains(x.Person.Id.DatabaseId.ToString()))
                .FirstOrDefault();

            if (r != null)
            {
                // TODO Look up augmentation

                if (r.Person.GeneralEvents.Best.NormalizedPlace != null)
                {
                    PlaceNode node = PlaceAuthorityMemoryIndex.
                        Instance.FindPlaceByPlaceId(r.Person.GeneralEvents.Best.NormalizedPlace.City.Id);

                    //GeoLoc = new Location
                    //	{
                    //		X = node.Places[0].Latitude * 100,
                    //		Y = node.Places[0].Longitude * 100
                    //	};

                    Address = node.Places.First().GetFullHierarchy();
                }
            }

            // Y -122, 174
            //X; 34, 42

            //double hit = CensusHelper.RandomHit();

            //GeoLoc = new Location { X = 34 + (hit * 5), Y = -122 + (hit * 50) };

            foreach (QueryResult result in results)
            {
                if (Father != null && Father.FullName == result.Person.Name)
                {
                    SelectedPersonId = result.Person.Id.Pid.ToString();
                    Father.Selected = true;
                    return;
                }

                if (Mother != null && Mother.FullName == result.Person.Name)
                {
                    SelectedPersonId = result.Person.Id.Pid.ToString();
                    Mother.Selected = true;
                    return;
                }

                foreach (SimplePerson person in Children)
                {
                    if (result.Person.Name == person.FullName)
                    {
                        SelectedPersonId = result.Person.Id.Pid.ToString();
                        person.Selected = true;
                        return;
                    }

                }
            }
        }