Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Init Data
            //Init Controls Data before do query
            EnumUtil.BindEnumData2ListControl <MessageAccessibility>(rdlAccessibility, false);
            EnumUtil.BindEnumData2ListControl <MessageStatus>(rdlStatus, false);

            using (_session = new Session())
            {
                this.ddlMsgTypeId.Items.Add("");
                EnumUtil.BindEntity2ListControl <MessageType>(_session, this.ddlMsgTypeId, "TypeName", "MsgTypeId");

                this.txtCreateTime.Text = RenderUtil.FormatDatetime(DateTime.Now);
                this.txtSendTime.Text   = this.txtCreateTime.Text;
                this.txtCreateBy.Text   = SecuritySession.CurrentUser.UserName;

                _actionMode = WebUtil.GetActionMode(this);
                if (_actionMode == Mode.Edit)
                {
                    LoadData();
                }
            }
        }
        if (Request["return"] != null)
        {
            this.toolbarup["Return"].NavigateUrl     = Request["return"];
            this.toolbarbottom["Return"].NavigateUrl = Request["return"];
        }
    }
Пример #2
0
    private void RetrieveUserData(ISession session)
    {
        int userId = WebUtil.ParamInt("id", -1);

        if (userId > 0)
        {
            User user = Magic.Sys.User.Retrieve(session, userId);
            if (user != null)
            {
                this.txtUserId.Value           = user.UserId.ToString();
                this.txtPassword.Text          = user.Password;
                this.txtUserName.Text          = user.UserName;
                this.txtFullName.Text          = user.FullName;
                this.txtEmail.Text             = user.Email;
                this.ddlUserType.SelectedValue = user.UserType.ToString();
                this.rblStatus.SelectedValue   = user.Status.ToString();
                this.txtExt.Text           = user.Ext;
                this.txtLastLogonTime.Text = RenderUtil.FormatDatetime(user.LastLogonTime);
                this.txtOrgId.Text         = user.OrgId.ToString();
                Org org = Org.Retrieve(session, user.OrgId); //加载组织的描述
                if (org != null)
                {
                    txtOrgDesc.Text = org.OrgName;
                }
            }
        }
    }
Пример #3
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;
        }
    }
Пример #4
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;
        }
    }
Пример #5
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;
            }
        }
    }
Пример #6
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;
        }
    }
Пример #7
0
    private void LoadData()
    {
        txtMessageId.Value = WebUtil.Param("messageId");
        int messageId = Cast.Int(WebUtil.Param("messageId"));

        Message message = null;

        message = Message.Retrieve(_session, messageId);

        if (message != null)
        {
            ddlMsgTypeId.SelectedValue = message.MsgTypeId.ToString();
            ChangeMsgTypeId(_session);

            ddlTmplCode.SelectedValue = message.TmplCode;

            txtTitle.Text    = message.Title;
            txtContent.Value = message.Content;
            rdlAccessibility.SelectedValue = message.Accessibility.ToString();
            txtCreateTime.Text             = RenderUtil.FormatDatetime(message.CreateTime);
            txtViewEntry.Text        = message.ViewEntry;
            txtSendTime.Text         = RenderUtil.FormatDatetime(message.SendTime);
            txtExpireTime.Text       = RenderUtil.FormatDatetime(message.ExpireTime);
            txtCreateBy.Text         = message.CreateBy;
            txtLastResponseTime.Text = RenderUtil.FormatDatetime(message.LastResponseTime);
            rdlStatus.SelectedValue  = message.Status.ToString();
            txtResponseEntry.Text    = message.ResponseEntry;
            txtSource.Text           = message.Source;
            txtDestination.Text      = message.Destination;

            this.ddlMsgTypeId.Enabled                = false;
            this.ddlTmplCode.Enabled                 = false;
            this.txtContent.Disabled                 = true;
            this.txtTitle.Enabled                    = false;
            this.rdlAccessibility.Enabled            = false;
            this.rdlStatus.Enabled                   = false;
            this.txtCreateBy.Enabled                 = false;
            this.txtCreateTime.Enabled               = false;
            this.txtDestination.Enabled              = false;
            this.txtExpireTime.Enabled               = false;
            this.txtLastResponseTime.Enabled         = false;
            this.txtSendTime.Enabled                 = false;
            this.txtSource.Enabled                   = false;
            this.toolbarup.Items["Save"].Enabled     = false;
            this.toolbarbottom.Items["Save"].Enabled = false;
        }
    }
    private void LoadData()
    {
        txtSubscriberId.Value = WebUtil.Param("subscriberId");
        int subscriberId = Cast.Int(WebUtil.Param("subscriberId"));

        MsgSubscriber msgSubscriber = null;

        msgSubscriber = MsgSubscriber.Retrieve(_session, subscriberId);

        if (msgSubscriber != null)
        {
            txtTmplCode.Text      = msgSubscriber.TmplCode;
            txtUserId.Text        = msgSubscriber.UserId.ToString();
            txtGroupId.Text       = msgSubscriber.GroupId.ToString();
            txtIsGroup.Text       = msgSubscriber.IsGroup.ToString();
            txtSubscribeTime.Text = RenderUtil.FormatDatetime(msgSubscriber.SubscribeTime);
        }
    }
Пример #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Magic.Sys.User user = null;
     using (ISession session = new Session())
     {
         user = Magic.Sys.User.Retrieve(session, this.UserId);
     }
     if (user != null)
     {
         this.txtUserName.Value   = user.UserName;
         this.txtFullName.Value   = user.FullName;
         this.txtLoginTime.Value  = RenderUtil.FormatDatetime(user.LastLogonTime);
         this.txtCreateTime.Value = RenderUtil.FormatDatetime(user.CreateTime);
     }
     else
     {
         WebUtil.ShowMsg(this, "请重新登陆");
     }
 }
Пример #10
0
    private void LoadData()
    {
        hidDashpageId.Value = WebUtil.Param("dashpageId");
        int dashpageId = Cast.Int(WebUtil.Param("dashpageId"));

        DashPage dashPage = null;

        dashPage = DashPage.Retrieve(_session, dashpageId);

        if (dashPage != null)
        {
            txtTitle.Text           = dashPage.Title;
            rdlLayout.SelectedValue = dashPage.Layout.ToString();
            rdlType.SelectedValue   = dashPage.Type.ToString();
            txtHelpLink.Text        = dashPage.HelpLink;
            txtDescription.Text     = dashPage.Description;
            rdlStatus.SelectedValue = dashPage.Status.ToString();
            txtCreateTime.Text      = RenderUtil.FormatDatetime(dashPage.CreateTime);
            txtCreateBy.Text        = Magic.Sys.User.GetUserName(dashPage.CreateBy);
        }
    }
Пример #11
0
    private void LoadData()
    {
        hidLogId.Value = WebUtil.Param("logId");
        int logId = Cast.Int(WebUtil.Param("logId"));

        OpLog opLog = null;

        opLog = OpLog.Retrieve(_session, logId);

        if (opLog != null)
        {
            ddlOpObjectType.SelectedValue = opLog.OpObjectType;
            txtOpObjectId.Text            = opLog.OpObjectId;
            txtOpContent.Text             = opLog.OpContent;
            ddlOpType.SelectedValue       = opLog.OpType;
            txtOpTime.Text                = RenderUtil.FormatDatetime(opLog.OpTime);
            txtOperatorName.Text          = opLog.OperatorName;
            ddlOperatorType.SelectedValue = opLog.OperatorType.ToString();
            txtIP.Text = opLog.IP;
        }
    }