//批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("store_waiting", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.StoreWaitingGoods bll = new BLL.StoreWaitingGoods();
            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("store_waiting.aspx", "customer_id={0}&goods_id={1}&beginTime={2}&endTime={3}",
                                                                                        this.customer_id.ToString(), this.goods_id.ToString(), this.beginTime.ToString(), this.endTime));
        }
Beispiel #2
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("store_waiting", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.StoreWaitingGoods bll = new BLL.StoreWaitingGoods();
     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("store_waiting.aspx", "customer_id={0}&goods_id={1}&beginTime={2}&endTime={3}",
         this.customer_id.ToString(), this.goods_id.ToString(), this.beginTime.ToString(), this.endTime));
 }
Beispiel #3
0
        private bool DoAdd()
        {
            bool result = false;

            if (string.IsNullOrWhiteSpace(txtStoringTime.Text))
            {
                JscriptMsg("计划入库时间不能为空!", "");
                return(false);
            }
            Model.StoreWaitingGoods model = new Model.StoreWaitingGoods();
            BLL.StoreWaitingGoods   bll   = new BLL.StoreWaitingGoods();

            model.GoodsId     = int.Parse(ddlGoods.SelectedValue);
            model.StoringTime = 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 StoreInGoodsVehicle(vehicleId, vehicleRemark[i], count));
                    }
                }
            }


            string[] fileNames    = Request.Form.GetValues("hid_attach_filename");
            string[] filePaths    = Request.Form.GetValues("hid_attach_filepath");
            string[] attachRemark = Request.Form.GetValues("txt_attach_remark");
            if (fileNames != null && filePaths != null && attachRemark != null &&
                fileNames.Length > 0 && filePaths.Length > 0 && attachRemark.Length > 0)
            {
                for (int i = 0; i < fileNames.Length; i++)
                {
                    model.AddAttach(new Attach(filePaths[i], fileNames[i], attachRemark[i]));
                }
            }

            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加待入库货物:" + model.GoodsId); //记录日志
                result = true;
            }
            return(result);
        }
Beispiel #4
0
        private void ShowInfo(int _id)
        {
            BLL.StoreWaitingGoods   bll   = new BLL.StoreWaitingGoods();
            Model.StoreWaitingGoods model = bll.GetModel(_id);

            ddlGoods.SelectedValue = model.GoodsId.ToString();
            txtStoringTime.Text    = model.StoringTime.ToString("yyyy-MM-dd");
            txtAdmin.Text          = model.Admin;
            txtRemark.Text         = model.Remark;

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

            this.rptGoodsVehicleList.DataSource = goodsVehicleDT;
            this.rptGoodsVehicleList.DataBind();

            BLL.Attach attachBLL = new BLL.Attach();
            DataTable  attachDT  = attachBLL.GetList(" StoreWaitingGoodsId = " + _id + "").Tables[0];

            this.rptAttachList.DataSource = attachDT;
            this.rptAttachList.DataBind();
        }
        private void RptBind(string _strWhere, string _goodsby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.customer_id > 0)
            {
                this.ddlCustomer.SelectedValue = this.customer_id.ToString();
            }
            if (this.goods_id > 0)
            {
                this.ddlGoods.SelectedValue = this.goods_id.ToString();
            }
            txtBeginTime.Text = this.beginTime;
            txtEndTime.Text   = this.endTime;
            BLL.StoreWaitingGoods bll = new BLL.StoreWaitingGoods();
            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_store_waiting_goods_list.aspx", "customer_id={0}&goods_id={1}&beginTime={2}&endTime={3}&page={4}",
                                              this.customer_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 void RptBind(string _strWhere, string _goodsby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.customer_id > 0)
            {
                this.ddlCustomer.SelectedValue = this.customer_id.ToString();
            }
            if (this.goods_id > 0)
            {
                this.ddlGoods.SelectedValue = this.goods_id.ToString();
            }
            txtBeginTime.Text = this.beginTime;
            txtEndTime.Text = this.endTime;
            BLL.StoreWaitingGoods bll = new BLL.StoreWaitingGoods();
            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_store_waiting_goods_list.aspx", "customer_id={0}&goods_id={1}&beginTime={2}&endTime={3}&page={4}",
                this.customer_id.ToString(), this.goods_id.ToString(), this.beginTime.ToString(), this.endTime, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }