コード例 #1
0
        //显示打印页面中的所有数据
        protected void DataView()
        {
            Transaction_operationDC           transaction_operationdc    = new Transaction_operationDC();
            List <ModelTransaction_operation> modelTransaction_operation = new List <ModelTransaction_operation>();
            WorkSheetInDC worksheetindc = new WorkSheetInDC();

            string transaction_type = "workSheetIn";

            modelTransaction_operation = transaction_operationdc.getTransactionByTransaction_qty(transaction_type, int.Parse(select_text2.Value));

            transaction_time.Value        = modelTransaction_operation[0].Transaction_time.ToLongDateString();
            transaction_create_user.Value = modelTransaction_operation[0].Create_user;

            try
            {
                //绑定Repeater中数据
                DataSet dataset = new DataSet();
                dataset = worksheetindc.getSomeByWo_no(select_text.Value);

                printStorageListRepeater.DataSource = dataset;
                printStorageListRepeater.DataBind();
            }
            catch (Exception e)
            {
                PageUtil.showToast(this, "数据库中没有对应数据,请重新输入需要入庫的工單號");
            }
        }
コード例 #2
0
        /// <summary>
        /// 编辑出货单单头信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Top_Edit(object sender, EventArgs e)
        {
            string strShip_key = edit_ship_key.Value;

            string strEdit_customer = edit_customer.Value;

            string strEdit_part_no = edit_part_no.Value;

            string strEdit_request_qty = Top_request_qty.Value;

            string strEdit_picked_qty = Top_picked_qty.Value;

            string ship_no = edit_ship_no.Value;

            int ship_key    = 0;
            int request_qty = 0;
            int picked_qty  = 0;
            int customer_id = 0;
            int part_no     = 0;

            try
            {
                ship_key = int.Parse(strShip_key);
                CustomersDC customerDc = new CustomersDC();
                customer_id = customerDc.getCustomeridByname(strEdit_customer);
                if (customer_id == -1)
                {
                    PageUtil.showToast(this, "该客户不存在,请检查数据!");
                    return;
                }
                request_qty = int.Parse(strEdit_request_qty);
                if (request_qty < 0)
                {
                    PageUtil.showToast(this, "数据格式错误,请输入数字!");
                    return;
                }
                picked_qty = int.Parse(strEdit_picked_qty);
                if (picked_qty < 0)
                {
                    PageUtil.showToast(this, "数据格式错误,请输入数字!");
                    return;
                }
                else if (picked_qty > 0)
                {
                    PageUtil.showToast(this, "该出货单已进行过出货操作,暂不支持修改!");
                    return;
                }
                PnDC pndc = new PnDC();
                part_no = pndc.getItem_idByItem_name(strEdit_part_no);
                if (part_no == -1)
                {
                    PageUtil.showToast(this, "该料号不存在!");
                    return;
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "数据异常!");
                return;
            }
            Transaction_operationDC trandc = new Transaction_operationDC();
            DataSet tds = trandc.getTransactionBySome("shipping", strEdit_part_no, ship_no);

            if (tds == null)
            {
                PageUtil.showToast(this, "数据异常!");
                return;
            }
            else if (tds.Tables[0].Rows.Count > 0)
            {
                PageUtil.showToast(this, "该出货单已进行过出货操作,暂不支持修改!");
                return;
            }
            try
            {
                DataSet ds = ship_dc.updateShip(ship_key, customer_id, part_no, request_qty, picked_qty);
                if (ds != null)
                {
                    updateTop_GridView(ds);
                    PageUtil.showToast(this, "修改成功!");
                }
                else
                {
                    PageUtil.showToast(this, "修改失败!");
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "修改失败!");
            }
        }