private bool DoEdit(int _id)
        {
            bool result = false;

            if (string.IsNullOrWhiteSpace(txtAllotTime.Text))
            {
                JscriptMsg("调拨时间不能为空!", "");
                return(false);
            }
            BLL.AllotOrder   bll   = new BLL.AllotOrder();
            Model.AllotOrder model = bll.GetModel(_id);

            model.AllotTime = DateTime.Parse(txtAllotTime.Text);
            model.Admin     = txtAdmin.Text;
            model.Remark    = txtRemark.Text;

            string[] storeInOrderIds = Request.Form.GetValues("StoreInOrderId");
            string[] storeInGoodsIds = Request.Form.GetValues("StoreInGoodsId");
            string[] sourceStoreIds  = Request.Form.GetValues("SourceStoreId");
            string[] purposeStoreIds = Request.Form.GetValues("PurposeStoreId");
            string[] allotCounts     = Request.Form.GetValues("AllotCount");
            string[] allotRemarks    = Request.Form.GetValues("AllotRemark");
            if (storeInOrderIds != null && storeInGoodsIds != null && sourceStoreIds != null &&
                purposeStoreIds != null && allotCounts != null && allotRemarks != null &&
                storeInOrderIds.Length > 0 && storeInGoodsIds.Length > 0 && sourceStoreIds.Length > 0 &&
                purposeStoreIds.Length > 0 && allotCounts.Length > 0 && allotRemarks.Length > 0)
            {
                for (int i = 0; i < storeInOrderIds.Length; i++)
                {
                    decimal allotCount;
                    int     storeInOrderId, storeInGoodsId, sourceStoreId, purposeStoreId;
                    if (int.TryParse(storeInOrderIds[i], out storeInOrderId) &&
                        int.TryParse(storeInGoodsIds[i], out storeInGoodsId) &&
                        int.TryParse(sourceStoreIds[i], out sourceStoreId) &&
                        int.TryParse(purposeStoreIds[i], out purposeStoreId) &&
                        decimal.TryParse(allotCounts[i], out allotCount))
                    {
                        model.AddAllotGoods(new AllotGoods(storeInOrderId, storeInGoodsId, sourceStoreId, purposeStoreId, allotCount, allotRemarks[i]));
                    }
                }
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改调拨货物信息:" + model.Id); //记录日志
                result = true;
            }
            return(result);
        }
        private void ShowInfo(int _id)
        {
            BLL.AllotOrder   bll   = new BLL.AllotOrder();
            Model.AllotOrder model = bll.GetModel(_id);

            txtAllotTime.Text = model.AllotTime.ToString("yyyy-MM-dd");
            txtAdmin.Text     = model.Admin;
            txtRemark.Text    = model.Remark;

            BLL.AllotGoods goodsVehicleBLL = new BLL.AllotGoods();
            DataTable      goodsVehicleDT  = goodsVehicleBLL.GetList(" and A.AllotOrderId = " + _id + "").Tables[0];

            this.rptAllotGoodsList.DataSource = goodsVehicleDT;
            this.rptAllotGoodsList.DataBind();
        }
Exemplo n.º 3
0
        private void ShowInfo(int _id)
        {
            BLL.AllotOrder bll = new BLL.AllotOrder();
            Model.AllotOrder model = bll.GetModel(_id);

            txtAllotTime.Text = model.AllotTime.ToString("yyyy-MM-dd");
            txtAdmin.Text = model.Admin;
            txtRemark.Text = model.Remark;

            BLL.AllotGoods goodsVehicleBLL = new BLL.AllotGoods();
            DataTable goodsVehicleDT = goodsVehicleBLL.GetList(" and A.AllotOrderId = " + _id + "").Tables[0];
            this.rptAllotGoodsList.DataSource = goodsVehicleDT;
            this.rptAllotGoodsList.DataBind();
        }
Exemplo n.º 4
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            if (string.IsNullOrWhiteSpace(txtAllotTime.Text))
            {
                JscriptMsg("调拨时间不能为空!", "");
                return false;
            }
            BLL.AllotOrder bll = new BLL.AllotOrder();
            Model.AllotOrder model = bll.GetModel(_id);

            model.AllotTime = DateTime.Parse(txtAllotTime.Text);
            model.Admin = txtAdmin.Text;
            model.Remark = txtRemark.Text;

            string[] storeInOrderIds = Request.Form.GetValues("StoreInOrderId");
            string[] storeInGoodsIds = Request.Form.GetValues("StoreInGoodsId");
            string[] sourceStoreIds = Request.Form.GetValues("SourceStoreId");
            string[] purposeStoreIds = Request.Form.GetValues("PurposeStoreId");
            string[] allotCounts = Request.Form.GetValues("AllotCount");
            string[] allotRemarks = Request.Form.GetValues("AllotRemark");
            if (storeInOrderIds != null && storeInGoodsIds != null && sourceStoreIds != null
                && purposeStoreIds != null && allotCounts != null && allotRemarks != null
                && storeInOrderIds.Length > 0 && storeInGoodsIds.Length > 0 && sourceStoreIds.Length > 0
                && purposeStoreIds.Length > 0 && allotCounts.Length > 0 && allotRemarks.Length > 0)
            {
                for (int i = 0; i < storeInOrderIds.Length; i++)
                {
                    decimal allotCount;
                    int storeInOrderId, storeInGoodsId, sourceStoreId, purposeStoreId;
                    if (int.TryParse(storeInOrderIds[i], out storeInOrderId)
                        && int.TryParse(storeInGoodsIds[i], out storeInGoodsId)
                        && int.TryParse(sourceStoreIds[i], out sourceStoreId)
                        && int.TryParse(purposeStoreIds[i], out purposeStoreId)
                        && decimal.TryParse(allotCounts[i], out allotCount))
                    {
                        model.AddAllotGoods(new AllotGoods(storeInOrderId, storeInGoodsId, sourceStoreId, purposeStoreId, allotCount, allotRemarks[i]));
                    }
                }
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改调拨货物信息:" + model.Id); //记录日志
                result = true;
            }
            return result;
        }