예제 #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     using (PEContext context = new PEContext())
     {
         dgPostsUser.ItemsSource = context.Users.ToList();
     }
 }
예제 #2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            List <Post> Res    = new List <Post>();
            List <Post> FinRes = new List <Post>();

            using (PEContext context = new PEContext())
            {
                foreach (var item in context.Posts)
                {
                    if (item.Name.Contains(tbSearchName.Text))
                    {
                        Res.Add(item);
                    }
                }

                foreach (var item in Res)
                {
                    if (FromDate.SelectedDate <= item.DataOfCreate && ToDate.SelectedDate >= item.DataOfCreate)// додумати))
                    {
                        FinRes.Add(item);
                    }
                }
                dgPostsUser.ItemsSource = FinRes;
            }
        }
 protected string ReplaceOrderInfo(string content)
 {
     content = content.Replace("{$OrderID}", this.m_OrderInfo.OrderId.ToString());
     content = content.Replace("{$OrderNum}", this.m_OrderInfo.OrderNum);
     content = content.Replace("{$ContacterName}", this.m_OrderInfo.ContacterName);
     content = content.Replace("{$MoneyTotal}", this.m_OrderInfo.MoneyTotal.ToString());
     content = content.Replace("{$MoneyReceipt}", this.m_OrderInfo.MoneyReceipt.ToString());
     content = content.Replace("{$MoneyNeedPay}", Convert.ToString((decimal)(this.m_OrderInfo.MoneyTotal - this.m_OrderInfo.MoneyReceipt)));
     content = content.Replace("{$InputTime}", this.m_OrderInfo.InputTime.ToString());
     content = content.Replace("{$UserName}", this.m_OrderInfo.UserName);
     content = content.Replace("{$Address}", this.m_OrderInfo.Address);
     content = content.Replace("{$ZipCode}", this.m_OrderInfo.ZipCode);
     content = content.Replace("{$Mobile}", this.m_OrderInfo.Mobile);
     content = content.Replace("{$Phone}", this.m_OrderInfo.Phone);
     content = content.Replace("{$Email}", this.m_OrderInfo.Email);
     content = content.Replace("{$Charge_Deliver}", this.m_OrderInfo.ChargeDeliver.ToString());
     content = content.Replace("{$PresentMoney}", this.m_OrderInfo.PresentMoney.ToString());
     content = content.Replace("{$PresentExp}", this.m_OrderInfo.PresentExp.ToString());
     content = content.Replace("{$PresentPoint}", this.m_OrderInfo.PresentPoint.ToString());
     content = content.Replace("{$Discount_Payment}", this.m_OrderInfo.DiscountPayment.ToString());
     content = content.Replace("{$PaymentType}", GetPaymentType(this.m_OrderInfo.PaymentType));
     content = content.Replace("{$DeliverType}", GetDeliverType(this.m_OrderInfo.DeliverType));
     content = content.Replace("{$OrderStatus}", PEContext.EnumToHtml <OrderStatus>(this.m_OrderInfo.Status));
     content = content.Replace("{$PayStatus}", GetPayStatus(this.m_OrderInfo.MoneyTotal, this.m_OrderInfo.MoneyReceipt));
     content = content.Replace("{$DeliverStatus}", PEContext.EnumToHtml <DeliverStatus>(this.m_OrderInfo.DeliverStatus));
     content = content.Replace("{$OrderInfo}", this.OrderDetail);
     return(content);
 }
        protected static string GetGlobalString(string resourceKey, string defaultValue)
        {
            string globalString = PEContext.GetGlobalString("EnumResources", resourceKey);

            if (string.IsNullOrEmpty(globalString))
            {
                globalString = defaultValue;
            }
            return(globalString);
        }
 private static string GetPayStatus(decimal moneyTotal, decimal moneyReceipt)
 {
     if (moneyTotal > moneyReceipt)
     {
         if (moneyReceipt > 0M)
         {
             return(PEContext.EnumToHtml <PayStatus>(PayStatus.ReceivedEarnest));
         }
         return(PEContext.EnumToHtml <PayStatus>(PayStatus.WaitForPay));
     }
     return(PEContext.EnumToHtml <PayStatus>(PayStatus.Payoff));
 }
예제 #6
0
        /// <summary>
        /// 判断用户在否在所属的权限范围内
        /// </summary>
        /// <param name="roleIdList"></param>
        /// <returns></returns>
        private static bool IsInRole(IList <string> roleIdList)
        {
            PEContext current = PEContext.Current;

            foreach (string str in roleIdList)
            {
                if (current.Admin.IsInRole(str.ToString()))
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #7
0
        private static bool CheckRole(IList <int> groupIdList)
        {
            PEContext current = PEContext.Current;

            foreach (int num in groupIdList)
            {
                if (current.User.IsInRole(num.ToString(CultureInfo.CurrentCulture)))
                {
                    return(true);
                }
            }
            return(false);
        }
 public ProizvodsController(PEContext context)
 {
     _context = context;
 }
예제 #9
0
 public InspekcijskoTijeloesController(PEContext context)
 {
     _context = context;
 }
 public InspekcijskaKontrolasController(PEContext context)
 {
     _context = context;
 }