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; } }
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; } }
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; } } }
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 rptSDHead_ItemDataBound(object sender, RepeaterItemEventArgs e) { System.Data.DataRowView drv = e.Item.DataItem as System.Data.DataRowView; if (drv == null) { return; } INVCheckStatus status = Cast.Enum <INVCheckStatus>(drv["Status"]); if (status != INVCheckStatus.New) { HtmlInputCheckBox chk = e.Item.FindControl("checkbox") as HtmlInputCheckBox; if (chk == null) { return; } chk.Visible = false; } HtmlAnchor cmd = e.Item.FindControl("cmdDetail") as HtmlAnchor; if (status == INVCheckStatus.New) { cmd.Visible = false; } else { cmd.HRef = "javascript:ondetail('" + Cast.String(drv["OrderNumber"]) + "');"; } Label lblApprStatus = e.Item.FindControl("lblApprStatus") as Label; ApproveStatus apprStatus = Cast.Enum <ApproveStatus>(drv["ApproveResult"]); lblApprStatus.Text = ERPUtil.EnumText <ApproveStatus>(apprStatus); switch (apprStatus) { case ApproveStatus.UnApprove: lblApprStatus.Text = ""; break; case ApproveStatus.Approve: lblApprStatus.ForeColor = System.Drawing.Color.Blue; break; case ApproveStatus.Reject: lblApprStatus.ForeColor = System.Drawing.Color.Red; break; } }
protected void rptSDHead_ItemDataBound(object sender, RepeaterItemEventArgs e) { System.Data.DataRowView drv = e.Item.DataItem as System.Data.DataRowView; if (drv == null) { return; } INVCheckStatus status = Cast.Enum <INVCheckStatus>(drv["Status"]); if (status != INVCheckStatus.New) { HtmlInputCheckBox chk = e.Item.FindControl("checkbox") as HtmlInputCheckBox; if (chk != null) { chk.Visible = false; } } Label lblApprStatus = e.Item.FindControl("lblApprStatus") as Label; ApproveStatus apprStatus = Cast.Enum <ApproveStatus>(drv["ApproveResult"]); lblApprStatus.Text = ERPUtil.EnumText <ApproveStatus>(apprStatus); switch (apprStatus) { case ApproveStatus.UnApprove: lblApprStatus.Text = ""; break; case ApproveStatus.Approve: lblApprStatus.ForeColor = System.Drawing.Color.Blue; break; case ApproveStatus.Reject: lblApprStatus.ForeColor = System.Drawing.Color.Red; break; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.txtInvCheckNumber.Text = WebUtil.Param("ordNum"); this.cmdReturn["Return"].NavigateUrl = WebUtil.Param("return"); this.drpCheckType.Items.Clear(); this.drpCheckType.Items.Add(new ListItem(ERPUtil.EnumText <INVCheckType>(INVCheckType.Explicit), INVCheckType.Explicit.ToString())); this.drpCheckType.Items.Add(new ListItem(ERPUtil.EnumText <INVCheckType>(INVCheckType.Implicit), INVCheckType.Implicit.ToString())); INVCheckHead head = null; using (ISession session = new Session()) { this.LoadLocation(session); if (!this.IsNew) { head = INVCheckHead.Retrieve(session, this.OrderNumber); this.LoadLocation(session); this.SetView(session, head); } } } }