Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtAction.Value = WebUtil.Param("mode");
            this.txtId.Value     = WebUtil.Param("ordNumber");

            ReturnHead head = null;
            using (ISession session = new Session())
            {
                IList <WHLocation> locations = WHLocation.EffectiveList(session);
                this.drpLocation.Items.Clear();
                foreach (WHLocation loc in locations)
                {
                    this.drpLocation.Items.Add(new ListItem(loc.Name, loc.LocationCode));
                }
                IList <ReturnReason> resons = ReturnReason.EffectiveList(session);
                this.drpReason.Items.Clear();
                this.drpReason.Items.Add(new ListItem(" ", "0"));
                foreach (ReturnReason rs in resons)
                {
                    this.drpReason.Items.Add(new ListItem(rs.ReasonText, rs.ReasonID.ToString()));
                }

                if (!this.IsNew)
                {
                    head = ReturnHead.Retrieve(session, this.OrderNumber);
                    this.showInfo(session, head);
                }
            }
            this.setView(head);
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtAction.Value = WebUtil.Param("mode");
            this.txtId.Value     = WebUtil.Param("ordNumber");

            this.setView(null);

            using (ISession session = new Session())
            {
                IList <WHLocation> locations = WHLocation.EffectiveList(session);
                this.drpFromLocation.Items.Clear();
                this.drpToLocation.Items.Clear();
                foreach (WHLocation loc in locations)
                {
                    this.drpFromLocation.Items.Add(new ListItem(loc.Name, loc.LocationCode));
                    this.drpToLocation.Items.Add(new ListItem(loc.Name, loc.LocationCode));
                }

                if (!this.IsNew)
                {
                    WHTransferHead head = WHTransferHead.Retrieve(session, this.OrderNumber);
                    this.setView(head);
                    this.showInfo(session, head);
                    log.DebugFormat("PageLoad - {0}移库单: ordNum={1}, return={2}", head.Status == WHTransferStatus.New ? "编辑" : "查看", this.OrderNumber, this.ReturnUrl);
                }
                else
                {
                    log.Debug("PageLoad-新增移库单: return=" + WebUtil.Param("return"));
                }
            }
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtBeginDate.Text  = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            this.txtEndDate.Text    = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked     = true;
            this.chkRelease.Checked = true;

            using (ISession session = new Session())
            {
                this.ddlLocation.Items.Clear();
                this.ddlLocation.Items.Add(new ListItem(" ", ""));
                foreach (WHLocation loc in WHLocation.EffectiveList(session))
                {
                    this.ddlLocation.Items.Add(new ListItem(loc.Name, loc.LocationCode));
                }

                OrderStatusDef def = OrderStatusDef.Retrieve(session, INVCheckHead.ORDER_TYPE_ADJ, (int)INVCheckStatus.New);
                this.chkNew.Text = def.StatusText;
                def = OrderStatusDef.Retrieve(session, INVCheckHead.ORDER_TYPE_ADJ, (int)INVCheckStatus.Release);
                this.chkRelease.Text = def.StatusText;
                def = OrderStatusDef.Retrieve(session, INVCheckHead.ORDER_TYPE_ADJ, (int)INVCheckStatus.Close);
                this.chkClose.Text = def.StatusText;

                WebUtil.SetMagicPager(magicPagerMain, magicPagerMain.PageSize, 1);
                WebUtil.SetMagicPager(magicPagerSub, magicPagerMain.PageSize, 1);

                RestoreLastQuery(session);
            }
        }
    }
Exemplo n.º 4
0
    private void SetView(ISession session, INVCheckHead head)
    {
        if (!this.IsNew)
        {
            WebUtil.DisableControl(this.drpLocation);
        }
        if (head != null)
        {
            if (!string.IsNullOrEmpty(head.LocationCode) && head.LocationCode.Trim().Length > 0)
            {
                WHLocation location = WHLocation.Retrieve(session, head.LocationCode);
                this.drpLocation.Items.Clear();
                this.drpLocation.Items.Add(new ListItem(location.Name, location.LocationCode));
            }
            this.drpCheckType.SelectedValue = head.CheckType.ToString();
            this.txtMemo.Text = head.Note;
            OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, INVCheckHead.ORDER_TYPE_CHK, (int)head.Status);
            if (statusDef != null)
            {
                this.lblStatus.Text = statusDef.StatusText;
            }
            Magic.Sys.User user = null;
            if (head.CreateUser > 0)
            {
                user = Magic.Sys.User.Retrieve(session, head.CreateUser);
                if (user != null)
                {
                    this.lblUser.Text = user.FullName;
                }
            }
            this.lblCreateTime.Text    = RenderUtil.FormatDatetime(head.CreateTime);
            this.lblApproveResult.Text = ERPUtil.EnumText <ApproveStatus>(head.ApproveResult);
            if (head.ApproveUser > 0)
            {
                user = Magic.Sys.User.Retrieve(session, head.ApproveUser);
                if (user != null)
                {
                    this.lblApproveUser.Text = user.FullName;
                }
            }
            this.lblApproveTime.Text = RenderUtil.FormatDatetime(head.ApproveTime);
            this.txtApproveNote.Text = head.ApproveNote;

            if (head.Status != INVCheckStatus.New)
            {
                WebUtil.DisableControl(this.txtMemo);
                WebUtil.DisableControl(this.drpCheckType);
                this.cmdSave.Visible = false;
            }
        }
    }