示例#1
0
        public void BtnAdd_OnClick(object sender, EventArgs e)
        {
            var deliveryInfo = new DeliveryInfo
            {
                SiteId = _siteId
            };

            deliveryInfo.Id = DeliveryDao.Insert(deliveryInfo);
            Response.Redirect(PageDeliveryAdd.GetRedirectUrl(_siteId, deliveryInfo.Id));
        }
示例#2
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var deliveryInfo = (DeliveryInfo)e.Item.DataItem;

            var ltlDeliveryName   = (Literal)e.Item.FindControl("ltlDeliveryName");
            var ltlDeliveryType   = (Literal)e.Item.FindControl("ltlDeliveryType");
            var ltlStartStandards = (Literal)e.Item.FindControl("ltlStartStandards");
            var ltlStartFees      = (Literal)e.Item.FindControl("ltlStartFees");
            var ltlAddStandards   = (Literal)e.Item.FindControl("ltlAddStandards");
            var ltlAddFees        = (Literal)e.Item.FindControl("ltlAddFees");
            var rptAreas          = (Repeater)e.Item.FindControl("rptAreas");
            var ltlActions        = (Literal)e.Item.FindControl("ltlActions");

            ltlDeliveryName.Text = deliveryInfo.DeliveryName;
            ltlDeliveryType.Text = deliveryInfo.DeliveryType;

            ltlStartStandards.Text = deliveryInfo.StartStandards.ToString();
            ltlStartFees.Text      = deliveryInfo.StartFees.ToString("N2");
            ltlAddStandards.Text   = deliveryInfo.AddStandards.ToString();
            ltlAddFees.Text        = deliveryInfo.AddFees.ToString("N2");

            rptAreas.DataSource     = AreaDao.GetAreaInfoList(deliveryInfo.Id);
            rptAreas.ItemDataBound += RptAreas_ItemDataBound;
            rptAreas.DataBind();

            ltlActions.Text =
                $@"<a class=""m-r-10"" href=""{PageDeliveryAdd.GetRedirectUrl(_siteId, deliveryInfo.Id)}"">编 辑</a>
                    <a class=""m-r-10"" href=""{GetRedirectUrl(_siteId)}&up={true}&deliveryId={deliveryInfo.Id}"">上 升</a>
                    <a class=""m-r-10"" href=""{GetRedirectUrl(_siteId)}&down={true}&deliveryId={deliveryInfo.Id}"">下 降</a>
                    <a class=""m-r-10"" href=""javascript:;"" onclick=""{Utils.SwalWarning("删除运费",
                    $"此操作将删除运费“{deliveryInfo.DeliveryName}”,确定吗?", "取 消", "删 除",
                    $"location.href='{GetRedirectUrl(_siteId)}&delete={true}&deliveryId={deliveryInfo.Id}'")};return false;"">删 除</a>";
        }