コード例 #1
0
 public SalesStaffCtrl(SalesInfo info)
     : this()
 {
     this.Load -= SalesStaffCtrl_Load;
     this.Load += SalesStaffCtrl_Load2;
     _info      = info;
 }
コード例 #2
0
 public int SalesOrderManage(out string errText, SalesInfo salesInfo, List <SalesDetailInfo> details)
 {
     errText = "";
     if (salesInfo == null || details == null || details.Count == 0)
     {
         errText = "信息不足,销售单保存失败!";
         return(0);
     }
     foreach (var commodity in details)
     {
         var warehouse = commodity.WarehouseId;
         var list      = _stockDetailInfoDal.GetEntityList(out errText, warehouse, commodity.CommodityId);
         if (list == null || list.Count == 0)
         {
             errText = "没有库存信息!";
             return(0);
         }
         var stock = list[0];
         if (stock.Count < commodity.Count)
         {
             errText = string.Format("商品{0}库存不足,当前库存{1}", commodity.CommodityId, stock.Count);
             return(0);
         }
     }
     foreach (var commodity in details)
     {
         var i = SaveSalesStockInfo(out errText, commodity.WarehouseId, commodity.CommodityId, commodity.Count, commodity.Remark);
         if (i <= 0)
         {
             return(i);
         }
     }
     return(1);
 }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProductId,Count,Cost")] SalesInfo salesInfo)
        {
            if (id != salesInfo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salesInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalesInfoExists(salesInfo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(salesInfo));
        }
コード例 #4
0
ファイル: SalesController.cs プロジェクト: Joost96/B1HF
        public ActionResult Export(int?id)
        {
            if (id != null)
            {
                SalesInfo info = new SalesInfo();
                foreach (EventType type in Enum.GetValues(typeof(EventType)))
                {
                    if (type != EventType.JazzPass)
                    {
                        AddToInfo(type, info);
                    }
                }
                switch (id)
                {
                case 0:
                    return(new CsvActionResult <KeyValuePair <string, int> >
                               (info.ActivitySales, "ActivitySales.csv", new string[] { "Activty", "Amount" }));

                case 1:
                    return(new CsvActionResult <KeyValuePair <string, int> >
                               (info.Timeslots, "TimeslotSales.csv", new string[] { "Timeslot", "Amount" }));

                case 2:
                    return(new CsvActionResult <KeyValuePair <string, int> >
                               (info.CountryCount, "CountrySales.csv", new string[] { "Country", "Amount" }));

                case 3:
                    return(new CsvActionResult <KeyValuePair <string, int> >
                               (info.DailySales, "DailySales.csv", new string[] { "Day", "Amount" }));
                }
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }
コード例 #5
0
        protected async Task UpdateSalesInfo(SalesOrder obj, SalesInfo _data)
        {
            if (_data == null)
            {
                currentErrors.AddValidationError(Messages.SalesRequired, obj.SalesOrderId);
                return;
            }
            obj.TerritoryObject = _data.TerritoryId == null ? null :
                                  await ctx.FindEntityAsync <SalesTerritory>(currentErrors, _data.TerritoryId);

            obj.SalesPersonObject = _data.SalesPersonId == null ? null :
                                    await ctx.FindEntityAsync <SalesPerson>(currentErrors, _data.SalesPersonId);

            // remove sales reason that are not in the provided list
            obj.ReasonObjectList.Where(r => _data.SalesReason == null || !_data.SalesReason.Contains(r.SalesReasonId))
            .ToList().ForEach(r => obj.ReasonObjectList.Remove(r));
            if (_data.SalesReason != null)
            {
                // add sales reasons from provided list that don't exist yet
                _data.SalesReason.Where(rId => obj.ReasonObjectList.Where(r => r.SalesReasonId == rId).ToList().Count == 0)
                .ToList().ForEach(rId => obj.ReasonObjectList.Add(new SalesOrderReason()
                {
                    SalesOrderId  = obj.SalesOrderId,
                    SalesReasonId = rId,
                    ModifiedDate  = DateTime.Now
                }));
            }
        }
コード例 #6
0
 // Return the SalesInfo if successed with nothing gone wrong
 public TokenHandleResult(SalesInfo salesInfo, string insurer)
 {
     this._insurer   = insurer;
     this._successed = true;
     this._salesInfo = salesInfo;
     this.StatusCode = "200";
 }
コード例 #7
0
        internal void InsertSalesInfo(SalesInfo instance)
        {
            base.com.CommandText = "spInsertSalesInfoByCustomer";
            base.com.Parameters.AddWithValue("_InvNo", instance.InvNo);
            base.com.Parameters.AddWithValue("_CustName", instance.CustName);
            base.com.Parameters.AddWithValue("_Address", instance.Address);
            base.com.Parameters.AddWithValue("_EmailAdd", instance.EmailAdd);
            base.com.Parameters.AddWithValue("_ContactNumber", instance.ContactNo);
            base.com.Parameters.AddWithValue("_CustNo", instance.CustNo);
            base.com.Parameters.AddWithValue("_TotalAmount", instance.TotalAmount);
            base.com.Parameters.AddWithValue("_EmpID", instance.EmpID);
            base.com.Parameters.AddWithValue("_Status", instance.Status);
            base.com.Parameters.AddWithValue("_Remarks", instance.Remarks);
            base.com.Parameters.AddWithValue("_KioskID", instance.KioskID);
            base.com.Parameters.AddWithValue("_TakenBy", instance._TakenBy);

            try{
                int res = Convert.ToInt32(base.com.ExecuteScalar());
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            finally
            {
                closeConnection();
            }
        }
コード例 #8
0
 protected void UpdateSales(AdventureWorksEntities ctx, SalesOrder obj, SalesInfo _data)
 {
     obj.TerritoryIdObject = ctx.SalesTerritory.Find(_data.TerritoryId);
     if (_data.TerritoryId != null && obj.TerritoryIdObject == null)
     {
         ErrorList.Current.AddError("Cannot find Sales Territory with ID {0}.", _data.TerritoryId);
     }
     obj.SalesPersonIdObject = ctx.SalesPerson.Find(_data.SalesPersonId);
     if (_data.SalesPersonId != null && obj.SalesPersonIdObject == null)
     {
         ErrorList.Current.AddError("Cannot find Sales Person with ID {0}.", _data.SalesPersonId);
     }
     // remove sales reason that are not in the provided list
     obj.ReasonObjectList.Where(r => _data.SalesReason == null || !_data.SalesReason.Contains(r.SalesReasonId))
     .ToList().ForEach(r => obj.ReasonObjectList.Remove(r));
     if (_data.SalesReason != null)
     {
         // add sales reasons from provided list that don't exist yet
         _data.SalesReason.Where(rId => obj.ReasonObjectList.Where(r => r.SalesReasonId == rId).ToList().Count == 0)
         .ToList().ForEach(rId => obj.ReasonObjectList.Add(new SalesOrderReason()
         {
             SalesOrderObject = obj,
             SalesReasonId    = rId,
             ModifiedDate     = DateTime.Now
         }));
     }
 }
コード例 #9
0
        private object GetSampleSalesData(HttpRequest request, HotcakesApplication hccApp)
        {
            var info = new SalesInfo
            {
                ChartLabels =
                    new List <string>(new[]
                                      { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }),
                ChartData =
                    new List <decimal>(new decimal[]
                {
                    1040000, 1700000, 700000, 1400000, 1400000, 1700000, 1200000, 1400000, 1700000, 1700000, 1360000,
                    1020000
                }),
                OrdersCount     = 30,
                OrdersCompleted = 10,
                OrdersTotalSum  = 16300000,
                OrdersSuccessfulTransactions = 27000,
                SalesByDesktopCount          = 14000,
                SalesByDesktopPercent        = 70,
                SalesByDesktopPercentPrev    = 80,
                SalesByTabletCount           = 4000,
                SalesByTabletPercent         = 20,
                SalesByTabletPercentPrev     = 10,
                SalesByPhoneCount            = 2000,
                SalesByPhonePercent          = 10,
                SalesByPhonePercentPrev      = 10
            };

            return(new SalesInfoJson(info, Localization));
        }
コード例 #10
0
 void ListView1DoubleClick(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         SalesInfo t = infos[listView1.SelectedItems[0].Index];
         WorkbenchSingleton.AddChild(new SalesInfoForm(t), "Edit Sales Information");
     }
 }
コード例 #11
0
ファイル: SalesInfoForm.cs プロジェクト: anoozz/nbooks
 public SalesInfoForm(SalesInfo info)
 {
     InitializeComponent();
     this.SalesInfo                 = info;
     addToolStripMenuItem.Click    += delegate { buttonAdd.PerformClick(); };
     modifyToolStripMenuItem.Click += delegate { ListView1DoubleClick(this, null); };
     listView1.Resize              += delegate { columnHeader2.Width = listView1.Width - 22 - (columnHeader1.Width + columnHeader3.Width + columnHeader4.Width); };
 }
コード例 #12
0
        /// <summary>
        /// 销售还款
        /// </summary>
        /// <param name="userContext"></param>
        /// <param name="salesId"></param>
        /// <param name="money"></param>
        /// <param name="remark"></param>
        /// <param name="sendsms"></param>
        /// <returns></returns>
        public int SalesRepayment(UserContext userContext, int salesId, decimal money, string remark, int sendsms,
                                  int operatorID)
        {
            var salesInfo = _salesDapperRepository.Find(x => x.saleID == salesId && x.accID == userContext.AccId);

            if (salesInfo == null)
            {
                return(-1);
            }
            else if (salesInfo.UnpaidMoney <= 0)
            {
                return(-2);
            }
            else
            {
                var updateSalesInfo = new SalesInfo();
                updateSalesInfo.accID       = userContext.AccId;
                updateSalesInfo.saleID      = salesId;
                updateSalesInfo.UnpaidMoney = salesInfo.UnpaidMoney - money;
                updateSalesInfo.CashMoney   = salesInfo.CashMoney + money;

                bool result = _salesDapperRepository.Update <SalesInfo>(updateSalesInfo,
                                                                        item => new { item.UnpaidMoney, item.CashMoney });

                if (result)
                {
                    var logModel = new SaleLogInfo
                    {
                        accID       = userContext.AccId,
                        saleID      = salesId,
                        saleListID  = 0,
                        logType     = 3,
                        itemType    = 0,
                        OriginalVal = salesInfo.UnpaidMoney,
                        EditVal     = money
                    };
                    logModel.FinalVal      = logModel.OriginalVal - logModel.EditVal;
                    logModel.LogTime       = DateTime.Now;
                    logModel.operatorTime  = DateTime.Now;
                    logModel.operatorID    = userContext.Operater;
                    logModel.operatorIP    = userContext.IpAddress;
                    logModel.addedLgUserId = operatorID == 0 ? userContext.Operater : operatorID;
                    logModel.Remark        = remark;
                    logModel.Flag          = "";

                    _salesLogDapperRepository.Insert(logModel);

                    if (sendsms == 1)
                    {
                        //TODO 接统一短信接口
                    }
                }

                return(result ? 1 : 0);
            }
        }
コード例 #13
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SalesInfo GetSalesInfoModel(int SalesID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 SalesID,StoresID,ProductsID,sNum,sPrice,sDateTime,sAppendTime,sIsYH,sStoresName,sProductsName,(select sName from tbStoresInfo where StoresID=tbSalesInfo.StoresID) as StoresName,(select pName from tbProductsInfo where ProductsID=tbSalesInfo.ProductsID) as ProductsName from tbSalesInfo ");
            strSql.Append(" where SalesID=@SalesID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SalesID", SqlDbType.Int, 4)
            };
            parameters[0].Value = SalesID;

            SalesInfo model = new SalesInfo();
            DataSet   ds    = DbHelper.ExecuteDataset(CommandType.Text, strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["SalesID"].ToString() != "")
                {
                    model.SalesID = int.Parse(ds.Tables[0].Rows[0]["SalesID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StoresID"].ToString() != "")
                {
                    model.StoresID = int.Parse(ds.Tables[0].Rows[0]["StoresID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ProductsID"].ToString() != "")
                {
                    model.ProductsID = int.Parse(ds.Tables[0].Rows[0]["ProductsID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sNum"].ToString() != "")
                {
                    model.sNum = int.Parse(ds.Tables[0].Rows[0]["sNum"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sPrice"].ToString() != "")
                {
                    model.sPrice = decimal.Parse(ds.Tables[0].Rows[0]["sPrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sDateTime"].ToString() != "")
                {
                    model.sDateTime = DateTime.Parse(ds.Tables[0].Rows[0]["sDateTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sAppendTime"].ToString() != "")
                {
                    model.sAppendTime = DateTime.Parse(ds.Tables[0].Rows[0]["sAppendTime"].ToString());
                }
                model.StoresName   = ds.Tables[0].Rows[0]["StoresName"].ToString();
                model.ProductsName = ds.Tables[0].Rows[0]["ProductsName"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #14
0
        public async Task <IActionResult> Create([Bind("ProductId,Count,Cost, SalesInvoiceId")] SalesInfo salesInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index), "SalesInfos", new { id = salesInfo.SalesInvoiceId }));
            }
            return(View(salesInfo));
        }
コード例 #15
0
 void DeleteToolStripMenuItemClick(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         foreach (ListViewItem li in listView1.SelectedItems)
         {
             SalesInfo s = infos[li.Index];
             DeleteSalesInfo(s, null);
         }
         OnActivated(null);
     }
 }
コード例 #16
0
        protected SalesInfo GetSalesInfo(SalesOrder obj)
        {
            SalesInfo res = new SalesInfo()
            {
                SalesPersonId = obj.SalesPersonObject?.BusinessEntityId,
                TerritoryId   = obj.TerritoryObject?.TerritoryId,
                // select a list of sales reason IDs from the child list
                SalesReason = obj.ReasonObjectList?.Select(r => r.SalesReasonId).ToList()
            };

            return(res);
        }
コード例 #17
0
ファイル: MainWindow.xaml.cs プロジェクト: Emi007M/Brewery
        private async void TabItem_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
        {
            await GetData();

            SalesList.ItemsSource = Sales;
            SalesList.Items.Refresh();

            try
            {
                SalesInfos = (await SalesInfo.CreateSalesInfo(Beers, Sales)).ToList();
            }
            catch { }
        }
コード例 #18
0
 private SearchResult GetSearchResult(SalesInfo entity)
 {
     if (entity != null)
     {
         // Get the SalesInfo if successed
         return(new SearchResult(entity));
     }
     else
     {
         // No SalesInfo to get if the searching failed
         return(new SearchResult());
     }
 }
コード例 #19
0
    public void AddSales(string Name, string Company, int Price)
    {
        TechValue.RecipeInfo RecipeInfo = CompanyManagerCall.GetCompanyValue(Company).GetTechValue().GetComponent <TechValue>().GetRecipe(Name);

        foreach (var SalesItem in SalesItemArray)
        {
            if (SalesItem.RecipeInfo.Recipe == RecipeInfo.Recipe)
            {
                if (SalesItem.Seller == Company)
                {
                    ModifySales(Name, Price);
                    return;
                }
                else
                {
                    return;
                }
            }
        }

        SalesInfo newContent = new SalesInfo();

        newContent.RecipeInfo        = RecipeInfo;
        newContent.Seller            = Company;
        newContent.QualityEvaluation = 1f;
        newContent.Price             = Price;
        newContent.UploadDate        = TimeManagerCall.TimeValue;
        newContent.SoldCount         = 0;
        newContent.SoldCountList     = new List <int>();
        newContent.ContractList      = new List <ContractInfo>();

        SalesItemArray.Add(newContent);

        UpdateItemCount(Company, Name);

        if (PanelControllerCall.CurrentSidePanel != null)
        {
            if (PanelControllerCall.CurrentSidePanel.name == "ContractPanel")
            {
                ContractPanelController PanelComponent = PanelControllerCall.CurrentSidePanel.GetComponent <ContractPanelController>();
                if (PanelComponent.CurrentCategory == newContent.RecipeInfo.Recipe.Type)
                {
                    PanelComponent.UpdateList(true);
                }
                else
                {
                    PanelComponent.UpdateList(false);
                }
            }
        }
    }
コード例 #20
0
    public bool CheckContractExist(SalesInfo Info, string CompanyName)
    {
        bool result = false;

        foreach (var Contract in Info.ContractList)
        {
            if (Contract.CompanyName == CompanyName)
            {
                result = true;
            }
        }

        return(result);
    }
コード例 #21
0
    public int GetContractIndex(SalesInfo Info, string CompanyName)
    {
        int result = -1;

        for (int i = 0; i < Info.ContractList.Count; i++)
        {
            if (Info.ContractList[i].CompanyName == CompanyName)
            {
                result = i;
            }
        }

        return(result);
    }
コード例 #22
0
    public ContractInfo GetContractInfo(SalesInfo Info, string CompanyName)
    {
        ContractInfo result = null;

        foreach (var Contract in Info.ContractList)
        {
            if (Contract.CompanyName == CompanyName)
            {
                result = Contract;
            }
        }

        return(result);
    }
コード例 #23
0
ファイル: SalesController.cs プロジェクト: Joost96/B1HF
        // GET: Sales
        public ActionResult Index()
        {
            SalesInfo info = new SalesInfo();

            foreach (EventType type in Enum.GetValues(typeof(EventType)))
            {
                if (type != EventType.JazzPass)
                {
                    AddToInfo(type, info);
                }
            }
            info.GetTop10();
            return(View(info));
        }
コード例 #24
0
ファイル: SalesController.cs プロジェクト: Joost96/B1HF
        public void AddToInfo(EventType type, SalesInfo info)
        {
            List <TimeSlot> timeslots = activityRepository.GetTimeslots(type).ToList();
            //amount sold
            int total = timeslots.Sum(ts => ts.TotalSeats);
            int sold  = timeslots.Sum(ts => ts.OccupiedSeats);

            info.AddAmountSold(type, sold, total);

            //country stats
            List <OrderHasTickets> ohts = orderRepository.getOrdersFromEvent(type).ToList();

            var countries = ohts
                            .GroupBy(oht => oht.Order.Customer.Country)
                            .Select(x => new { Country = x.Key, count = x.Count(), amount = x.Average(y => y.Amount) })
                            .OrderByDescending(x => x.count);

            foreach (var country in countries)
            {
                info.AddCountry(country.Country, (int)Math.Floor(country.count * country.amount));
            }

            //activity sales
            var Activities = timeslots
                             .GroupBy(ts => ts.Activity)
                             .Select(x => new { activity = x.Key.Name, count = x.Count(), amount = x.Average(y => y.OccupiedSeats) })
                             .OrderByDescending(x => x.count);

            foreach (var activity in Activities)
            {
                info.AddActivity(activity.activity, (int)Math.Floor(activity.count * activity.amount));
            }

            //DailySales
            for (int i = 0; i < (DateTime.Now - DateTime.Parse("01/01/18 00:00")).TotalDays; i++)
            {
                DateTime date   = DateTime.Now.AddDays(-i);
                DateTime date2  = date.AddDays(1);
                int      amount = ohts.Where(oht => oht.Order.Date <= date2 && oht.Order.Date >= date).Sum(x => x.Amount);

                info.AddDailySale(date, amount);
            }

            //timeslots
            foreach (TimeSlot ts in timeslots)
            {
                info.AddTimeslot(ts, ts.OccupiedSeats);
            }
        }
コード例 #25
0
        // =========================================================================
        // Sub Functions
        // =========================================================================
        private void InsertInvoice()
        {
            string  invno     = Request["invno"];
            string  custname  = Request["custname"];
            string  address   = Request["address"];
            string  emailadd  = Request["emailadd"];
            string  contactno = Request["contactno"];
            string  custno    = Request["custno"];
            decimal total     = Convert.ToDecimal(Request["total"]);
            string  empid     = Request["empid"];
            string  status    = Request["status"];
            string  remarks   = Request["remarks"];
            string  kioskid   = Request["kioskid"];
            string  takenby   = Request["takenby"];

            //
            SalesInfo instance = new SalesInfo();

            instance.InvNo       = invno;
            instance.CustName    = custname;
            instance.Address     = address;
            instance.EmailAdd    = emailadd;
            instance.ContactNo   = contactno;
            instance.CustNo      = custno;
            instance.TotalAmount = total;
            instance.EmpID       = empid;
            instance.Status      = status;
            instance.Remarks     = remarks;
            instance.KioskID     = Convert.ToInt32(kioskid);
            instance._TakenBy    = takenby;
            //
            bool isInserted         = true;
            JsonBridge <String> ins = new JsonBridge <String>();

            try
            {
                SalesInfo.InsertSalesInfo(instance);
            }
            catch (Exception)
            {
                isInserted = false;
            }

            ins.Valid = isInserted == true ? 1 : 0;

            string output = JsonConvert.SerializeObject(ins);

            Response.Write(output);
        }
コード例 #26
0
ファイル: SalesController.cs プロジェクト: Joost96/B1HF
 // GET : Event
 public ActionResult Event(int?id)
 {
     if (id != null)
     {
         if (Enum.IsDefined(typeof(EventType), id))
         {
             EventType type = (EventType)id;
             SalesInfo info = new SalesInfo();
             AddToInfo(type, info);
             info.GetTop10();
             info.PageName = type.ToString();
             return(View(info));
         }
     }
     return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
 }
コード例 #27
0
        protected SalesInfo GetSalesInfo(SalesOrder obj)
        {
            SalesInfo res = new SalesInfo();

            if (obj.SalesPersonIdObject != null)
            {
                res.SalesPersonId = obj.SalesPersonIdObject.BusinessEntityId;
            }
            if (obj.TerritoryIdObject != null)
            {
                res.TerritoryId = obj.TerritoryIdObject.TerritoryId;
            }
            // select a list of sales reason IDs from the child list
            res.SalesReason = obj.ReasonObjectList.Select(r => r.SalesReasonId).ToList();
            return(res);
        }
コード例 #28
0
 void CloseToolStripMenuItemClick(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         using (AdminPasswordForm f = new AdminPasswordForm()) {
             if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK)
             {
                 foreach (ListViewItem li in listView1.SelectedItems)
                 {
                     SalesInfo s = infos[li.Index];
                     CloseSalesInfo(s, null);
                 }
                 OnActivated(null);
             }
         }
     }
 }
コード例 #29
0
        private void SalesReport()
        {
            string from  = Request["from"];
            string to    = Request["to"];
            string empid = Request["empid"];

            var collection = SalesInfo.GetSalesByDateRange(from, to, empid);
            JsonBridge <SalesInfo> jsonFeed = new JsonBridge <SalesInfo>();

            jsonFeed.Valid      = collection.Count != 0 ? 1 : 0;
            jsonFeed.collection = collection;

            //
            string output = JsonConvert.SerializeObject(jsonFeed);

            Response.Write(output);
        }
コード例 #30
0
        private void SalesKiosk()
        {
            int    kioskid = Convert.ToInt32(Request["kioskid"]);
            string from    = Request["from"];
            string to      = Request["to"];

            var collection = SalesInfo.GetSalesByKioskDateRange(from, to, kioskid);
            JsonBridge <SalesInfo> jsonFeed = new JsonBridge <SalesInfo>();

            jsonFeed.Valid      = collection.Count != 0 ? 1 : 0;
            jsonFeed.collection = collection;

            //
            string output = JsonConvert.SerializeObject(jsonFeed);

            Response.Write(output);
        }