Example #1
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);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text   = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked     = true;
            this.chkRelease.Checked = true;
            this.chkOpen.Checked    = true;

            using (ISession session = new Session())
            {
                OrderTypeDef typeDef = OrderTypeDef.Retrieve(session, StockInHead.ORD_TYPE_ASSIST_IN);
                if (typeDef != null)
                {
                    this.hidViewUrl.Value = typeDef.ViewURL;
                }

                OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, StockInHead.ORD_TYPE_ASSIST_IN, (int)StockInStatus.New);
                this.chkNew.Text     = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, StockInHead.ORD_TYPE_ASSIST_IN, (int)StockInStatus.Release);
                this.chkRelease.Text = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, StockInHead.ORD_TYPE_ASSIST_IN, (int)StockInStatus.Open);
                this.chkOpen.Text    = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, StockInHead.ORD_TYPE_ASSIST_IN, (int)StockInStatus.Close);
                this.chkClose.Text   = statusDef.StatusText;

                WebUtil.SetMagicPager(magicPagerMain, this.magicPagerMain.PageSize, 1);
                WebUtil.SetMagicPager(magicPagerSub, this.magicPagerMain.PageSize, 1);
                this.RestoreLastQuery(session);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            this.txtDateTo.Text   = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked   = true;
            this.chkOpen.Checked  = true;

            using (ISession session = new Session())
            {
                OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, RCVHead.ORD_TYPE_PUR, (int)ReceiveStatus.New);
                this.chkNew.Text     = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, RCVHead.ORD_TYPE_PUR, (int)ReceiveStatus.Release);
                this.chkRelease.Text = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, RCVHead.ORD_TYPE_PUR, (int)ReceiveStatus.Open);
                this.chkOpen.Text    = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, RCVHead.ORD_TYPE_PUR, (int)ReceiveStatus.Close);
                this.chkClose.Text   = statusDef.StatusText;

                OrderTypeDef typeDef = OrderTypeDef.Retrieve(session, RCVHead.ORD_TYPE_PUR);
                if (typeDef != null)
                {
                    this.hidViewUrl.Value = typeDef.ViewURL;
                }

                this.LoadVendor(session);
                this.RestoreLastQuery(session);
            }
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text   = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked     = true;
            this.chkRelease.Checked = true;
            this.chkOpen.Checked    = true;

            using (ISession session = new Session())
            {
                OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.New);
                this.chkNew.Text     = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Release);
                this.chkRelease.Text = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Open);
                this.chkOpen.Text    = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Close);
                this.chkClose.Text   = statusDef.StatusText;

                this.drpLogis.Items.Clear();
                this.drpLogis.Items.Add(new ListItem("", "0"));
                IList <Logistics> logistics = Logistics.GetEffectiveLogistics(session);
                foreach (Logistics logis in logistics)
                {
                    this.drpLogis.Items.Add(new ListItem(logis.ShortName, logis.LogisticCompID.ToString()));
                }

                this.RestoreLastQuery(session);
            }
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text   = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked     = true;
            this.chkRelease.Checked = true;
            this.chkOpen.Checked    = true;

            using (ISession session = new Session())
            {
                OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.New);
                this.chkNew.Text     = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Release);
                this.chkRelease.Text = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Open);
                this.chkOpen.Text    = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, ReturnHead.ORDER_TYPE_MBR_RTN, (int)ReturnStatus.Close);
                this.chkClose.Text   = statusDef.StatusText;

                this.RestoreLastQuery(session);
            }
        }
    }
Example #6
0
    private void showInfo(ISession session, WHTransferHead head)
    {
        User user;

        if (head != null)
        {
            this.txtOrderNumber.Text = head.OrderNumber;
            this.txtNote.Text        = head.Note;
            if (!string.IsNullOrEmpty(head.FromLocation))
            {
                this.drpFromLocation.SelectedValue = head.FromLocation;
            }
            if (!string.IsNullOrEmpty(head.ToLocation))
            {
                this.drpToLocation.SelectedValue = head.ToLocation;
            }

            OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, head.OrderTypeCode, (int)head.Status);
            if (statusDef != null)
            {
                this.lblStatus.Text = statusDef.StatusText;
            }
            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);
            switch (head.ApproveResult)
            {
            case ApproveStatus.Reject: this.lblApproveResult.ForeColor = System.Drawing.Color.Red; break;

            case ApproveStatus.Approve: this.lblApproveResult.ForeColor = System.Drawing.Color.Blue; break;
            }
            if (head.ApproveResult == ApproveStatus.Approve || head.ApproveResult == ApproveStatus.Reject)
            {
                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;
        }
    }
Example #7
0
    private void showInfo(ISession session, RCVHead head)
    {
        User user;

        if (head != null)
        {
            this.txtOrderNumber.Text = head.OrderNumber;
            this.txtPONumber.Value   = head.RefOrderNumber;
            if (head.ObjectID > 0)
            {
                Vendor ven = Vendor.Retrieve(session, head.ObjectID);
                if (ven != null)
                {
                    this.lblVendor.Text = ven.ShortName;
                }
            }
            this.txtNote.Text = head.Note;
            OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, head.OrderTypeCode, (int)head.Status);
            if (statusDef != null)
            {
                this.lblStatus.Text = statusDef.StatusText;
            }
            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);
            switch (head.ApproveResult)
            {
            case ApproveStatus.Reject: this.lblApproveResult.ForeColor = System.Drawing.Color.Red; break;

            case ApproveStatus.Approve: this.lblApproveResult.ForeColor = System.Drawing.Color.Blue; break;
            }
            if (head.ApproveResult == ApproveStatus.Approve || head.ApproveResult == ApproveStatus.Reject)
            {
                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;
        }
    }
Example #8
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;
            }
        }
    }
Example #9
0
        /// <summary>
        /// 返回单个单据状态的文本描述
        /// </summary>
        /// <param name="session"></param>
        /// <param name="orderTypeCode">单据类型</param>
        /// <param name="status">单据状态,可以是整数值、枚举值</param>
        /// <returns></returns>
        public static string StatusText(ISession session, string orderTypeCode, object status)
        {
            if (status == null)
            {
                return("");
            }
            OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, orderTypeCode, Cast.Int(status));

            if (statusDef == null)
            {
                return("");
            }
            return(statusDef.StatusText);
        }
Example #10
0
    private void showInfo(ISession session, ReturnHead head)
    {
        User user;

        if (head != null)
        {
            this.txtOrderNumber.Text       = head.OrderNumber;
            this.drpLocation.SelectedValue = head.LocationCode;
            this.txtSNNumber.Text          = head.RefOrderNumber;
            this.drpReason.SelectedValue   = head.ReasonID.ToString();
            this.chkIsMalicious.Checked    = head.IsMalicious;
            this.chkHasTransported.Checked = head.HasTransported;
            this.txtNote.Text = head.Note;
            OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, head.OrderTypeCode, (int)head.Status);
            if (statusDef != null)
            {
                this.lblStatus.Text = statusDef.StatusText;
            }
            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);
            switch (head.ApproveResult)
            {
            case ApproveStatus.Reject: this.lblApproveResult.ForeColor = System.Drawing.Color.Red; break;

            case ApproveStatus.Approve: this.lblApproveResult.ForeColor = System.Drawing.Color.Blue; break;
            }
            if (head.ApproveResult == ApproveStatus.Approve || head.ApproveResult == ApproveStatus.Reject)
            {
                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;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text   = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            this.txtDateTo.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            this.chkNew.Checked     = true;
            this.chkRelease.Checked = true;
            log.Debug("PageLoad - 移库单管理");

            using (ISession session = new Session())
            {
                OrderStatusDef statusDef = OrderStatusDef.Retrieve(session, WHTransferHead.ORDER_TYPE_NORMAL, (int)WHTransferStatus.New);
                this.chkNew.Text     = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, WHTransferHead.ORDER_TYPE_NORMAL, (int)ReceiveStatus.Release);
                this.chkRelease.Text = statusDef.StatusText;
                statusDef            = OrderStatusDef.Retrieve(session, WHTransferHead.ORDER_TYPE_NORMAL, (int)ReceiveStatus.Close);
                this.chkClose.Text   = statusDef.StatusText;

                this.RestoreLastQuery(session);
            }
        }
    }