//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("storeout_waiting_manage", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除待出库成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("storeout_waiting_goods.aspx", "storein_order_id={0}&goods_id={1}&beginTime={2}&endTime={3}", this.storein_order_id.ToString(), this.goods_id.ToString(), this.beginTime.ToString(), this.endTime)); }
private bool DoEdit(int _id) { bool result = false; if (string.IsNullOrWhiteSpace(txtStoringTime.Text)) { JscriptMsg("计划出库时间不能为空!", ""); return(false); } BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); Model.StoreOutWaitingGoods model = bll.GetModel(_id); string[] ids = ddlStoreInGoods.SelectedValue.Split('|'); model.GoodsId = int.Parse(ids[1]); model.StoreInOrderId = int.Parse(ddlStoreInOrder.SelectedValue); model.StoreInGoodsId = int.Parse(ids[0]); model.StoringOutTime = DateTime.Parse(txtStoringTime.Text); model.Admin = txtAdmin.Text; model.Remark = txtRemark.Text; model.Status = 0; model.CreateTime = DateTime.Now; string[] vehicleIds = Request.Form.GetValues("VehicleId"); string[] vehicleCount = Request.Form.GetValues("Count"); string[] vehicleRemark = Request.Form.GetValues("GoodsVehicleRemark"); if (vehicleIds != null && vehicleCount != null && vehicleRemark != null && vehicleIds.Length > 0 && vehicleCount.Length > 0 && vehicleRemark.Length > 0) { for (int i = 0; i < vehicleIds.Length; i++) { decimal count; int vehicleId; if (int.TryParse(vehicleIds[i], out vehicleId) && decimal.TryParse(vehicleCount[i], out count)) { model.AddGoodsVehicle(new StoreOutGoodsVehicle(vehicleId, vehicleRemark[i], count)); } } } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改待出库货物信息:" + model.GoodsId); //记录日志 result = true; } return(result); }
private void ShowInfo(int _id) { BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); Model.StoreOutWaitingGoods model = bll.GetModel(_id); ddlStoreInOrder.SelectedValue = model.StoreInOrderId.ToString(); StoreInGoodsBind(model.StoreInOrderId); ddlStoreInGoods.SelectedValue = model.StoreInGoodsId.ToString() + "|" + model.GoodsId.ToString(); txtStoringTime.Text = model.StoringOutTime.ToString("yyyy-MM-dd"); txtAdmin.Text = model.Admin; txtRemark.Text = model.Remark; BLL.StoreOutGoodsVehicle goodsVehicleBLL = new BLL.StoreOutGoodsVehicle(); DataTable goodsVehicleDT = goodsVehicleBLL.GetList(" and A.StoreOutWaitingGoodsId = " + _id + "").Tables[0]; this.rptGoodsVehicleList.DataSource = goodsVehicleDT; this.rptGoodsVehicleList.DataBind(); }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.storein_order_id > 0) { this.ddlStoreInOrder.SelectedValue = this.storein_order_id.ToString(); } if (this.storein_goods_id > 0) { this.ddlStoreInGoods.SelectedValue = this.storein_goods_id.ToString(); } txtBeginTime.Text = this.beginTime; txtEndTime.Text = this.endTime; BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("dialog_storeout_waiting_goods.aspx", "storein_order_id={0}&storein_goods_id={1}&beginTime={2}&endTime={3}&page={4}", this.storein_order_id.ToString(), this.storein_goods_id.ToString(), this.beginTime.ToString(), this.endTime, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.storein_order_id > 0) { this.ddlStoreInOrder.SelectedValue = this.storein_order_id.ToString(); } if (this.goods_id > 0) { this.ddlGoods.SelectedValue = this.goods_id.ToString(); } txtBeginTime.Text = this.beginTime; txtEndTime.Text = this.endTime; BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("storeout_waiting_goods.aspx", "storein_order_id={0}&goods_id={1}&beginTime={2}&endTime={3}&page={4}", this.storein_order_id.ToString(), this.goods_id.ToString(), this.beginTime.ToString(), this.endTime, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { bool result = false; if (string.IsNullOrWhiteSpace(txtStoringTime.Text)) { JscriptMsg("计划出库时间不能为空!", ""); return false; } Model.StoreOutWaitingGoods model = new Model.StoreOutWaitingGoods(); BLL.StoreOutWaitingGoods bll = new BLL.StoreOutWaitingGoods(); string[] ids = ddlStoreInGoods.SelectedValue.Split('|'); model.GoodsId = int.Parse(ids[1]); model.StoreInOrderId = int.Parse(ddlStoreInOrder.SelectedValue); model.StoreInGoodsId = int.Parse(ids[0]); model.StoringOutTime = DateTime.Parse(txtStoringTime.Text); model.Admin = txtAdmin.Text; model.Remark = txtRemark.Text; model.Status = 0; model.CreateTime = DateTime.Now; string[] vehicleIds = Request.Form.GetValues("VehicleId"); string[] vehicleCount = Request.Form.GetValues("Count"); string[] vehicleRemark = Request.Form.GetValues("GoodsVehicleRemark"); if (vehicleIds != null && vehicleCount != null && vehicleRemark != null && vehicleIds.Length > 0 && vehicleCount.Length > 0 && vehicleRemark.Length > 0) { for (int i = 0; i < vehicleIds.Length; i++) { decimal count; int vehicleId; if (int.TryParse(vehicleIds[i], out vehicleId) && decimal.TryParse(vehicleCount[i], out count)) { model.AddGoodsVehicle(new StoreOutGoodsVehicle(vehicleId, vehicleRemark[i], count)); } } } if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加待出库货物:" + model.GoodsId); //记录日志 result = true; } return result; }