public async Task <List <F_PublishFoodResultDto> > GetDataListToMoblieAsync(ConditionDTO input)
        {
            Expression <Func <F_PublishFood, F_FoodInfo, F_ShopInfoSet, F_PublishFoodResultDto> > select = (a, b, c) => new F_PublishFoodResultDto
            {
                Sorce     = b.Score,
                BeginTime = c.OrderBeginDate,
                EndTime   = c.OrderBeginEnd
            };

            select = select.BuildExtendSelectExpre();
            var q = from a in GetIQueryable().AsExpandable()
                    join b in Service.GetIQueryable <F_FoodInfo>() on a.ShopInfoId equals b.Id into ab
                    from b in ab.DefaultIfEmpty()
                    join c in Service.GetIQueryable <F_ShopInfoSet>() on a.ShopInfoId equals c.ShopInfoId into ac
                    from c in ac.DefaultIfEmpty()
                    select @select.Invoke(a, b, c);

            var where = LinqHelper.True <F_PublishFoodResultDto>();
            var toDay = DateTime.Now.Date;

            where = where.And(a => a.PublishDate >= toDay && a.PublishDate < toDay.AddDays(1));
            var userInfo = Service.GetIQueryable <F_UserInfo>().Where(a => a.WeCharUserId == operators.UserId)?.FirstOrDefault();

            if (userInfo == null)
            {
                throw new BusException("获取用户信息失败!");
            }
            if (!string.IsNullOrEmpty(operators.WeChatProperty.ShopInfoId))
            {
                where = where.And(a => a.ShopInfoId == userInfo.ShopInfoId);
            }
            return(await q.Where(where).OrderBy(x => x.Id).ToListAsync());
        }
Example #2
0
        public async Task <List <IF_OrderInfoResultDto> > GetDataListNoPageAsync(ConditionDTO input)
        {
            Expression <Func <F_OrderInfo, F_PublishFood, IF_OrderInfoResultDto> > select = (a, b) => new IF_OrderInfoResultDto
            {
                FoodName = b.FoodName
            };

            select = select.BuildExtendSelectExpre();
            var q = from a in GetIQueryable().AsExpandable()
                    join b in Service.GetIQueryable <F_PublishFood>() on a.PublishFoodId equals b.Id into ab
                    from b in ab.DefaultIfEmpty()
                    select @select.Invoke(a, b);

            var where = LinqHelper.True <IF_OrderInfoResultDto>();
            var search = input;

            //筛选
            if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty())
            {
                var newWhere = DynamicExpressionParser.ParseLambda <IF_OrderInfoResultDto, bool>(
                    ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword);
                where = where.And(newWhere);
            }
            return(await q.Where(where).ToListAsync());
        }
Example #3
0
        public async Task SumExcelToExport(ConditionDTO input)
        {
            var bytes = await _f_OrderBus.SumExcelToExport(input);

            Response.ContentType = "application/vnd.ms-excel";
            await Response.Body.WriteAsync(bytes);
        }
        public async Task <List <D_SupplierContacts> > GetDataListByIdAsync(ConditionDTO input)
        {
            var q = GetIQueryable();

            var where = LinqHelper.True <D_SupplierContacts>();
            var search = input;

            where = where.And(a => a.SupplierId == input.Keyword);

            return(await q.Where(where).ToListAsync());
        }
Example #5
0
        public Guid AddAppraisalRuleCondition(Guid appraisalRuleId, ConditionDTO conditionDto)
        {
            AppraisalRule existingRule = null;

            findExistingAppraisalRule(appraisalRuleId, out existingRule);
            if (existingRule != null)
            {
                var condition = Condition.Parse(conditionDto.Condition);
                existingRule.Conditions = existingRule.Conditions.Add(condition);
                return(condition.Id);
            }
            return(Guid.Empty);
        }
Example #6
0
        public static ConditionEN Convert(ConditionDTO dto)
        {
            ConditionEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new ConditionEN();



                    if (dto.PatientProfile_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IPatientProfileCAD patientProfileCAD = new MoSIoTGenNHibernate.CAD.MosIoT.PatientProfileCAD();

                        newinstance.PatientProfile = patientProfileCAD.ReadOIDDefault(dto.PatientProfile_oid);
                    }
                    newinstance.Id          = dto.Id;
                    newinstance.Description = dto.Description;
                    if (dto.Disabilities_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IDisabilityCAD disabilityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DisabilityCAD();

                        newinstance.Disabilities = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.DisabilityEN>();
                        foreach (int entry in dto.Disabilities_oid)
                        {
                            newinstance.Disabilities.Add(disabilityCAD.ReadOIDDefault(entry));
                        }
                    }
                    newinstance.ClinicalStatus = dto.ClinicalStatus;
                    newinstance.Disease        = dto.Disease;
                    if (dto.Goal_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IGoalCAD goalCAD = new MoSIoTGenNHibernate.CAD.MosIoT.GoalCAD();

                        newinstance.Goal = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.GoalEN>();
                        foreach (int entry in dto.Goal_oid)
                        {
                            newinstance.Goal.Add(goalCAD.ReadOIDDefault(entry));
                        }
                    }
                    newinstance.Name = dto.Name;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
Example #7
0
        public AddOrEditConditionForm(AppraisalRulesVM appraisalRulesVm, ConditionDTO conditionToEdit = null)
        {
            InitializeComponent();

            _appraisalRulesVM   = appraisalRulesVm;
            _conditionToEditDTO = conditionToEdit;

            if (conditionToEdit != null)
            {
                this.Text = Resources.EditConditionEventFormTitle;
                this.addOrEditButton.Text = Resources.UpdateButtonLabel;
                this.textBoxEvent.Text    = conditionToEdit.Condition;
            }
        }
Example #8
0
        public void RemoveAppraisalRuleCondition(Guid appraisalRuleId, ConditionDTO conditionDto)
        {
            AppraisalRule existingRule;

            findExistingAppraisalRule(appraisalRuleId, out existingRule);
            if (existingRule != null)
            {
                var condition = existingRule.Conditions.FirstOrDefault(c => c.Id == conditionDto.Id);
                if (condition != null)
                {
                    existingRule.Conditions = existingRule.Conditions.Remove(condition);
                }
            }
        }
Example #9
0
        public async Task <List <IF_OrderInfoResultDto> > GetDataListToMoblieAsync(ConditionDTO input)
        {
            Expression <Func <F_OrderInfo, F_PublishFood, IF_OrderInfoResultDto> > select = (a, b) => new IF_OrderInfoResultDto
            {
                FoodName     = b.FoodName,
                Price        = b.Price,
                ImageUrl     = b.ImgUrl,
                FoodDesc     = b.FoodDesc,
                SupplierName = b.SupplierName
            };

            select = select.BuildExtendSelectExpre();
            var q = from a in GetIQueryable().AsExpandable()
                    join b in Service.GetIQueryable <F_PublishFood>() on a.PublishFoodId equals b.Id into ab
                    from b in ab.DefaultIfEmpty()
                    select @select.Invoke(a, b);

            var where = LinqHelper.True <IF_OrderInfoResultDto>();
            var search = input;

            where = where.And(a => a.OrderCode == input.Keyword);

            return(await q.Where(where).ToListAsync());
        }
Example #10
0
        private void addOrEditButton_Click_1(object sender, EventArgs e)
        {
            try
            {
                var newCondition = new ConditionDTO
                {
                    Condition = textBoxEvent.Text
                };
                if (_conditionToEditDTO != null)
                {
                    _appraisalRulesVM.UpdateCondition(_conditionToEditDTO, newCondition);
                }
                else
                {
                    _appraisalRulesVM.AddCondition(newCondition);
                }

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #11
0
        public async Task <byte[]> SumExcelToExport(ConditionDTO input)
        {
            Expression <Func <F_Order, F_UserInfo, F_PublishFood, IF_OrderResultDTO> > select = (a, b, c) =>
                                                                                                new IF_OrderResultDTO
            {
                UserName          = b.UserName,
                DepartmentName    = b.FullDepartment,
                FoodName          = c.FoodName,
                TakeFoodCode      = a.TakeFoodCode,
                TakeFoodName      = a.TakeFoodName,
                OldDepartmentName = Service.GetIQueryable <Base_DepartmentRelation>()
                                    .FirstOrDefault(d => d.Department == b.FullDepartment).OldDepartment
            };

            select = select.BuildExtendSelectExpre();
            var q = from a in GetIQueryable().AsExpandable()
                    join b in Service.GetIQueryable <F_UserInfo>() on a.UserInfoId equals b.Id into ab
                    from b in ab.DefaultIfEmpty()
                    join c in Service.GetIQueryable <F_OrderInfo>() on a.OrderCode equals c.OrderCode
                    join d in Service.GetIQueryable <F_PublishFood>() on c.PublishFoodId equals d.Id
                    select @select.Invoke(a, b, d);

            var where = LinqHelper.True <IF_OrderResultDTO>();
            var search = input;

            //筛选
            if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty())
            {
                where = where.And(a =>
                                  a.CreateTime >= input.Keyword.ToDateTime().Date&& a.CreateTime <
                                  input.Keyword.ToDateTime().Date.AddDays(1) &&
                                  a.Status != 4);
            }
            //增加按照部门排序
            var       orderResultList = q.Where(where).OrderBy(a => a.OldDepartmentName).ToList();
            DataTable dt = orderResultList.OrderBy(a => a.TakeFoodCode.ToInt()).GroupBy(a => new { DepartmentName = a.OldDepartmentName ?? a.DepartmentName, a.FoodName }).
                           Select(a => new
            {
                TakeFoodCode   = "A" + a.FirstOrDefault().TakeFoodCode,
                DepartmentName = a.Key.DepartmentName,
                FoodName       = a.Key.FoodName,
                Count          = a.Count(),
                TakeFoodName   = a.FirstOrDefault().TakeFoodName,
            }
                                  ).ToDataTable();

            if (dt != null && dt.Rows.Count == 0)
            {
                throw new BusException("无下载数据!");
            }
            if (dt.Columns.Contains("TakeFoodCode"))
            {
                dt.Columns["TakeFoodCode"].ColumnName = "取餐码";
            }
            if (dt.Columns.Contains("DepartmentName"))
            {
                dt.Columns["DepartmentName"].ColumnName = "部门名称";
            }
            if (dt.Columns.Contains("FoodName"))
            {
                dt.Columns["FoodName"].ColumnName = "菜品";
            }
            if (dt.Columns.Contains("Count"))
            {
                dt.Columns["Count"].ColumnName = "数量";
            }
            if (dt.Columns.Contains("TakeFoodName"))
            {
                dt.Columns["TakeFoodName"].ColumnName = "领餐人";
            }
            await Task.CompletedTask;

            return(AsposeOfficeHelper.DataTableToExcelBytes(dt));
        }
Example #12
0
 public async Task <List <D_SupplierContacts> > GetDataListById(ConditionDTO input)
 {
     return(await _d_SupplierContactsBus.GetDataListByIdAsync(input));
 }
 public async Task <List <IF_OrderInfoResultDto> > GetDataListToMoblie(ConditionDTO input)
 {
     return(await _f_OrderInfoBus.GetDataListToMoblieAsync(input));
 }
Example #14
0
 public async Task <List <F_PublishFoodResultDto> > GetDataListToMobile(ConditionDTO input)
 {
     return(await _f_PublishFoodBus.GetDataListToMoblieAsync(input));
 }
 public void AddCondition(ConditionDTO newCondition)
 {
     _emotionalAppraisalAsset.AddAppraisalRuleCondition(SelectedRuleId, newCondition);
     RefreshData();
 }
 public void UpdateCondition(ConditionDTO oldCondition, ConditionDTO updatedCondition)
 {
     _emotionalAppraisalAsset.RemoveAppraisalRuleCondition(SelectedRuleId, oldCondition);
     _emotionalAppraisalAsset.AddAppraisalRuleCondition(SelectedRuleId, updatedCondition);
     RefreshData();
 }
Example #17
0
 public Guid AddAppraisalRuleCondition(Guid appraisalRuleId, ConditionDTO conditionDTO)
 {
     return(m_appraisalDerivator.AddAppraisalRuleCondition(appraisalRuleId, conditionDTO));
 }
Example #18
0
 public void RemoveAppraisalRuleCondition(Guid appraisalRuleId, ConditionDTO conditionDTO)
 {
     m_appraisalDerivator.RemoveAppraisalRuleCondition(appraisalRuleId, conditionDTO);
 }
Example #19
0
        public async Task <byte[]> ExcelToExport(ConditionDTO input)
        {
            Expression <Func <F_Order, F_UserInfo, IF_OrderResultDTO> > select = (a, b) => new IF_OrderResultDTO
            {
                UserName       = b.UserName,
                DepartmentName = b.Department,
                FoodName       = string.Join(",", (from c in Service.GetIQueryable <F_OrderInfo>()
                                                   join d in Service.GetIQueryable <F_PublishFood>() on c.PublishFoodId equals d.Id
                                                   where c.OrderCode == a.OrderCode
                                                   select d.FoodName)),
                SupplierName = string.Join(",", (from c in Service.GetIQueryable <F_OrderInfo>()
                                                 join d in Service.GetIQueryable <F_PublishFood>() on c.PublishFoodId equals d.Id
                                                 where c.OrderCode == a.OrderCode
                                                 select d.SupplierName)),
                OldDepartmentName = Service.GetIQueryable <Base_DepartmentRelation>().FirstOrDefault(c => c.Department == b.FullDepartment).OldDepartment
            };

            select = select.BuildExtendSelectExpre();
            var q = from a in GetIQueryable().AsExpandable()
                    join b in Service.GetIQueryable <F_UserInfo>() on a.UserInfoId equals b.Id into ab
                    from b in ab.DefaultIfEmpty()
                    select @select.Invoke(a, b);

            var where = LinqHelper.True <IF_OrderResultDTO>();
            var search = input;

            //筛选
            if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty())
            {
                where = where.And(a =>
                                  a.CreateTime >= input.Keyword.ToDateTime().Date&& a.CreateTime < input.Keyword.ToDateTime().Date.AddDays(1) &&
                                  a.Status != 4);
            }
            //增加按照部门排序
            DataTable dt = q.Where(where).OrderBy(a => a.OldDepartmentName).Select(a => new
            {
                OldDepartmentName = a.OldDepartmentName,
                UserName          = a.UserName,
                SupplierName      = a.SupplierName,
                FoodName          = a.FoodName,
                OrderCount        = a.OrderCount,
                Price             = a.Price,
                OrderCode         = a.OrderCode,
                CreateTime        = a.CreateTime
            }).ToList().ToDataTable();

            if (dt != null && dt.Rows.Count == 0)
            {
                throw new BusException("无下载数据!");
            }
            if (dt.Columns.Contains("UserName"))
            {
                dt.Columns["UserName"].ColumnName = "用户名";
            }
            if (dt.Columns.Contains("SupplierName"))
            {
                dt.Columns["SupplierName"].ColumnName = "商户名称";
            }
            if (dt.Columns.Contains("FoodName"))
            {
                dt.Columns["FoodName"].ColumnName = "菜品名称";
            }
            if (dt.Columns.Contains("DepartmentName"))
            {
                dt.Columns["DepartmentName"].ColumnName = "部门名称";
            }
            if (dt.Columns.Contains("OldDepartmentName"))
            {
                dt.Columns["OldDepartmentName"].ColumnName = "部门名称";
            }
            if (dt.Columns.Contains("OrderCount"))
            {
                dt.Columns["OrderCount"].ColumnName = "数量";
            }
            if (dt.Columns.Contains("Price"))
            {
                dt.Columns["Price"].ColumnName = "价格";
            }
            if (dt.Columns.Contains("OrderCode"))
            {
                dt.Columns["OrderCode"].ColumnName = "订单编号";
            }
            if (dt.Columns.Contains("CreateTime"))
            {
                dt.Columns["CreateTime"].ColumnName = "下单时间";
            }
            await Task.CompletedTask;

            return(AsposeOfficeHelper.DataTableToExcelBytes(dt));
        }