public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
 {
     for (int i = 0; i < SelectedSegmentIDs.Count; i++)
     {
         RenderUtil.RenderAutoCutSegmentOverlay(cameraInfo, SelectedSegmentIDs[i], Color.magenta, true);
     }
 }
    protected void repeatControl_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = e.Item.DataItem as DataRowView;

        if (drv == null)
        {
            return;
        }

        TextBox txt = e.Item.FindControl("txtQty") as TextBox;

        txt.Text = RenderUtil.FormatNumber(drv["CurrentQty"], "#0.##");
        if (this._head.Status != INVCheckStatus.Confirm)
        {
            WebUtil.DisableControl(txt);
        }

        Label lbl = e.Item.FindControl("lblBefQty") as Label;

        if (this._head.CheckType == INVCheckType.Implicit && (this._head.Status == INVCheckStatus.Confirm))
        {
            lbl.Text = "-";
        }
        else
        {
            lbl.Text = RenderUtil.FormatNumber(drv["BeforeQty"], "#0.##");
        }
    }
Ejemplo n.º 3
0
    void Start()
    {
        Texture2D t   = spriteMaterial.mainTexture as Texture2D;
        Texture2D tmp = new Texture2D(t.width, t.height, TextureFormat.ARGB32, true);

        for (int x = 0; x < t.width; x++)
        {
            for (int y = 0; y < t.height; y++)
            {
                int v = x + y;
                if (v % 2 == 0)
                {
                    tmp.SetPixel(x, y, t.GetPixel(x, y));
                }
                else
                {
                    tmp.SetPixel(x, y, new Color(0, 0, 0, 0));
                }
            }
        }
        tmp.Apply();

        Material mt = new Material(spriteMaterial.shader);

        mt.mainTexture = tmp;

        RenderUtil.ShowAllSprite(mt, gameObject);
    }
Ejemplo n.º 4
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;
                }
            }
        }
    }
Ejemplo n.º 5
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"];
        }
    }
Ejemplo n.º 6
0
        /// <summary>
        /// This method is called by <code>Render</code>, directly before
        /// <code>GL.drawElements</code>. It activates the program and sets up
        /// the GL context with the following constants and attributes:
        ///
        /// <code>uMvpMatrix</code> — MVP matrix
        /// <code>aPosition</code> — vertex position (xy)
        /// </summary>
        protected virtual void BeforeDraw()
        {
            Program.Activate(); // create, upload, use program

            //is this the best place for this?
            Gl.BindBuffer(BufferTarget.ArrayBuffer, VertexBufferName);
            Gl.BindBuffer(BufferTarget.ElementArrayBuffer, IndexBufferName);

            uint attribPosition = (uint)Program.Attributes["aPosition"];

            Gl.EnableVertexAttribArray(attribPosition);
            Gl.VertexAttribPointer(attribPosition, 2, VertexAttribType.Float, false, Vertex.Size, (IntPtr)Vertex.PositionOffset);

            int uMvpMatrix = Program.Uniforms["uMvpMatrix"];

            Gl.UniformMatrix4(uMvpMatrix, false, MvpMatrix3D.RawData);

            if (Texture != null)
            {
                uint aTexCoords = (uint)Program.Attributes["aTexCoords"];
                Gl.EnableVertexAttribArray(aTexCoords);
                Gl.VertexAttribPointer(aTexCoords, 2, VertexAttribType.Float, false, Vertex.Size, (IntPtr)Vertex.TextureOffset);
                Gl.ActiveTexture(TextureUnit.Texture0);

                RenderUtil.SetSamplerStateAt(Texture.Base, Texture.NumMipMaps > 0, TextureSmoothing, TextureRepeat);
            }
            // color & alpha are set in subclasses
        }
Ejemplo n.º 7
0
        public void RenderOverlay(RenderManager.CameraInfo cameraInfo)
        {
            if (!IsValid)
            {
                return;
            }
            //Log.Debug("PathConnectWrapper.RenderOverlay() called");
            var a = node1.Get3DPos();
            var b = node2.Get3DPos();

            Singleton <ToolManager> .instance.m_drawCallData.m_overlayCalls++;
            RenderManager.instance.OverlayEffect.DrawSegment(
                cameraInfo, Color.blue,
                new Segment3(a, b),
                node1.GetFinalInfo().m_halfWidth * 2, 1000,
                -1000, +1000, true,
                false);
            Singleton <ToolManager> .instance.m_drawCallData.m_overlayCalls++;
            RenderManager.instance.OverlayEffect.DrawCircle(
                cameraInfo, Color.yellow,
                NodeWrapper.Get3DPos(HitPoint, 0),
                HitSegmentID.ToSegment().Info.m_halfWidth * 2,
                -1000, +1000, true,
                false);
            RenderUtil.DrawCutSegmentEnd(
                cameraInfo,
                endSegmentID,
                0.5f,
                IsStartNode(endSegmentID, endNodeID),
                Color.yellow,
                false);
        }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string snNumber = WebUtil.Param("ordNum");

        if (string.IsNullOrEmpty(snNumber))
        {
            return;
        }

        ExcelTemplate template             = null;
        IDictionary <string, string> items = new Dictionary <string, string>();

        #region 获取数据
        //所有要替换的标签先初始化为空值
        items["$RecipientName$"]    = "";
        items["$RecipientCity$"]    = "";
        items["$RecipientArea$"]    = "";
        items["$RecipientAddress$"] = "";
        items["$RecipientPhone$"]   = "";
        items["$RecipientMobile$"]  = "";
        items["$RecipientZipCode$"] = "";
        items["$AgencyAmt$"]        = "";
        items["$PaidAmt$"]          = "";
        items["$Remark$"]           = "";
        items["$Weight$"]           = "";
        items["$PackageCount$"]     = "";
        using (ISession session = new Session())
        {
            CRMSN sn = CRMSN.Retrieve(session, snNumber);
            if (sn == null)
            {
                return;
            }
            Member mbr = Member.Retrieve(session, sn.MemberID);
            template = ExcelTemplate.Retrieve(session, WebUtil.ParamInt("tid", 0));
            if (template == null)
            {
                return;
            }

            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("(<br.*?>)|(</br>)", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            items["$RecipientName$"]    = sn.Contact;
            items["$RecipientCity$"]    = sn.City;
            items["$RecipientArea$"]    = Cast.String(sn.Province) + " " + Cast.String(sn.City); //省市区,缺少区
            items["$RecipientAddress$"] = sn.Address;
            items["$RecipientCompany$"] = "";
            items["$RecipientPhone$"]   = "'" + sn.Phone;
            items["$RecipientMobile$"]  = "'" + (string.IsNullOrEmpty(sn.Mobile) || sn.Mobile.Trim().Length <= 0 ? mbr.Mobile : sn.Mobile);
            items["$RecipientZipCode$"] = "'" + sn.PostCode;
            items["$AgencyAmt$"]        = RenderUtil.FormatNumber(sn.AgentAmt, "#0.##", "");
            items["$PaidAmt$"]          = "'" + RenderUtil.FormatNumber(sn.PaidAmt, "#0.##", "");
            items["$Remark$"]           = "'" + regex.Replace(Cast.String(sn.Remark), "\r\n");
            items["$Weight$"]           = sn.PackageWeight <= 0 ? "" : ("'" + sn.PackageWeight.ToString("#0.##"));
            items["$PackageCount$"]     = "'" + RenderUtil.FormatNumber(sn.PackageCount, "#0.##", "");
        }
        #endregion

        this.Response.Redirect(DownloadUtil.DownloadXls("SN_" + snNumber + ".xls", "SN", Server.MapPath(template.FileVirtualPath), items));
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtTypeCode.Text = WebUtil.Param("type");
            if (this.txtTypeCode.Text.Trim().Length <= 0)
            {
                this.txtIsNew.Value     = "1";
                this.trNeedAppr.Visible = false;
            }
            else
            {
                this.txtIsNew.Value = "";
                WebUtil.DisableControl(this.txtTypeCode);
            }
            //发货(销售发货和换货发货)由CRM生成,单据编码规则在ERP中不会起作用
            if (this.TypeCode == "SD0" || this.TypeCode == "DL2")
            {
                this.trRule.Visible = false;
            }

            using (ISession session = new Session())
            {
                IList <OrderRuleDef> ruleDefines = session.CreateEntityQuery <OrderRuleDef>()
                                                   .OrderBy("RuleDefineID")
                                                   .List <OrderRuleDef>();
                this.drpRule.Items.Clear();
                this.drpRule.Items.Add(new ListItem("", "0"));
                foreach (OrderRuleDef rule in ruleDefines)
                {
                    this.drpRule.Items.Add(new ListItem(string.IsNullOrEmpty(rule.RuleDefineText) ? " " : rule.RuleDefineText, rule.RuleDefineID.ToString()));
                }

                if (!this.IsNew)
                {
                    OrderTypeDef def = OrderTypeDef.Retrieve(session, this.TypeCode);
                    if (def != null)
                    {
                        this.txtText.Text = def.TypeText;
                        this.txtUrl.Text  = def.ViewURL;
                        if (!def.SupportApprove)
                        {
                            this.trNeedAppr.Visible = false;
                        }
                        else
                        {
                            this.drpNeedAppr.SelectedValue = def.NeedApprove ? "1" : "0";
                        }
                        this.lblSupportAppr.Text = RenderUtil.FormatBool(def.SupportApprove, "是", "否");
                        if (def.RuleDefineID > 0)
                        {
                            this.drpRule.SelectedValue = def.RuleDefineID.ToString();
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 10
0
        public static bool RenderOverlay(
            RenderManager.CameraInfo cameraInfo, Color color, ushort segmentID, Vector3 hitPos)
        {
            Vector3 pos = segmentID.ToSegment().GetClosestPosition(hitPos);
            float   hw  = segmentID.ToSegment().Info.m_halfWidth;

            RenderUtil.DrawOverlayCircle(cameraInfo, color, pos, hw, true);
            return(true);
        }
Ejemplo n.º 11
0
 static void HighlightSegmentEnd(RenderManager.CameraInfo cameraInfo, ushort segmentID, ushort nodeID, Color color)
 {
     RenderUtil.DrawCutSegmentEnd(
         cameraInfo: cameraInfo,
         segmentId: segmentID,
         cut: 0.5f,
         bStartNode: segmentID.ToSegment().IsStartNode(nodeID),
         color: color);
 }
Ejemplo n.º 12
0
        public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
        {
            base.RenderOverlay(cameraInfo);

            if (SelectedSegmentID != 0 && SelectedNodeID != 0)
            {
                HighlightSegmentEnd(cameraInfo, SelectedSegmentID, SelectedNodeID, Color.white);
            }
            else if (SelectedNodeID != 0)
            {
                RenderUtil.DrawNodeCircle(cameraInfo, Color.white, SelectedNodeID, true);
            }
            else if (SelectedSegmentID != 0)
            {
                RenderUtil.RenderSegmnetOverlay(cameraInfo, SelectedSegmentID, Color.white, true);
            }

            if (flagsPanel_ && flagsPanel_.HighlighLaneID != 0)
            {
                var laneData = new LaneData(flagsPanel_.HighlighLaneID);
                RenderUtil.RenderLaneOverlay(cameraInfo, laneData, Color.yellow, false);
            }

            if (!HoverValid)
            {
                return;
            }

            Color color;

            if (Input.GetMouseButton(0))
            {
                color = GetToolColor(true, false);
            }
            else if (HoverHasFlags())
            {
                color = GetToolColor(false, false);
            }
            else
            {
                color = GetToolColor(false, true);
            }

            if (SegmentMode)
            {
                RenderUtil.RenderSegmnetOverlay(cameraInfo, HoveredSegmentID, color, true);
            }
            else if (NodeMode)
            {
                RenderUtil.DrawNodeCircle(cameraInfo, color, HoveredNodeID, true);
            }
            else if (SegmentEndMode)
            {
                HighlightSegmentEnd(cameraInfo, HoveredSegmentID, HoveredNodeID, color);
            }
        }
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            if (IotContext.TestSuiteState.MessageTestStates == null)
            {
                return;
            }

            writer.WriteLine("<h2>Verification Results</h2>");
            writer.WriteLine("<table class=\"grid\">");
            writer.WriteLine("<tr><th>State</th><th>Message Name</th><th>Bytes</th><th>Candidate Bytes</th></tr>");

            int totalItems  = 0;
            int passedItems = 0;

            foreach (MessageTestState item in IotContext.TestSuiteState.MessageTestStates.Values)
            {
                totalItems++;
                writer.WriteLine("<tr>");
                if (item.Result.HasValue)
                {
                    if (item.Result == true)
                    {
                        writer.WriteLine("<td><img src=\"Images\\passed.png\"></td>");
                    }
                    else
                    {
                        writer.WriteLine("<td><img src=\"Images\\failed.png\"></td>");
                    }
                }
                else
                {
                    writer.WriteLine("<td><img src=\"Images\\missing.png\"></td>");
                }
                writer.WriteLine("<td>" + item.MessageName + "</td>");
                if (item.Result.HasValue)
                {
                    if (item.Result == true)
                    {
                        writer.WriteLine("<td colspan=\"2\"></td>");
                        passedItems++;
                    }
                    else
                    {
                        writer.WriteLine("<td class=\"bytes\">" + RenderUtil.RenderByteArray(item.ReferenceBytes, item.DifferenceIndexes, 10) + "</td>");
                        writer.WriteLine("<td class=\"bytes\">" + RenderUtil.RenderByteArray(item.CandidateBytes, item.DifferenceIndexes, 10) + "</td>");
                    }
                }
                else
                {
                    writer.WriteLine("<td colspan=\"2\"></td>");
                }
            }
            writer.WriteLine("</table>");
        }
 public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
 {
     for (int i = 0; i < SelectedSegmentIDs.Count; i++)
     {
         if (HoveredSegmentId == 0 || HoveredSegmentId != SelectedSegmentIDs[i])
         {
             RenderUtil.RenderRawSegmentOverlay(cameraInfo, SelectedSegmentIDs[i], (SelectedSegmentIDs[i].ToSegment().Info.m_halfWidth - 2f), Colors.GameGreen, 0f, 0f, true);
         }
     }
     for (int i = 0; i < SelectedNodeIDs.Count; i++)
     {
         if (HoveredNodeId == 0 || HoveredNodeId != SelectedNodeIDs[i])
         {
             RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameGreen, SelectedNodeIDs[i], true);
         }
     }
     if (HoverValid)
     {
         if (HoveredSegmentId != 0)
         {
             if (SelectedSegmentIDs.Contains(HoveredSegmentId))
             {
                 if (PathManagerExtendedTool.ShiftIsPressed)
                 {
                     RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.OrangeWeb, 0f, 0f, true);
                 }
                 else
                 {
                     RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.GameGreen + new Color(0.15f, 0.15f, 0.15f, 0f), 0f, 0f, true);
                 }
             }
             else
             {
                 RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.GameBlue, 0f, 0f, true);
             }
         }
         if (HoveredNodeId != 0)
         {
             if (SelectedNodeIDs.Contains(HoveredNodeId))
             {
                 if (PathManagerExtendedTool.ShiftIsPressed)
                 {
                     RenderUtil.DrawNodeCircle(cameraInfo, Colors.OrangeWeb, HoveredNodeId, true);
                 }
                 else
                 {
                     RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameGreen + new Color(0.15f, 0.15f, 0.15f, 0f), HoveredNodeId, true);
                 }
             }
             else
             {
                 RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameBlue, HoveredNodeId, true);
             }
         }
     }
 }
Ejemplo n.º 15
0
 void FixedUpdate()
 {
     CheckMouse();
     if (bOnTimer)
     {
         m_BlockWall.OnTimer();
         RenderUtil.UpdateBlockWall(m_BlockWall, m_Sprites);
         bOnTimer = false;
     }
 }
Ejemplo n.º 16
0
        /// <summary>
        /// 设置医嘱打印中医嘱内容 content_or_prn
        /// </summary>
        /// <param name="ordDataDTO">医嘱数据对象</param>
        private void setOrdPrintContent(OrdPrintDataDTO ordDataDTO, bool isSubOr)
        {
            // 获取当前打印数据对应的格式化字符串
            string format = cfgViewModel.GetRenderStr(ordDataDTO.Fg_long, ordDataDTO.Sd_srvtp);

            // 将OrdPrintDataDTO中属性按照格式化字符串进行数据转换
            string renderResult = RenderUtil.Render(format, ordDataDTO);

            ordDataDTO.Content_or_prn = (isSubOr ? "---" : "") + renderResult;
        }
Ejemplo n.º 17
0
    void Start()
    {
        Shader    s = Shader.Find("Unlit/Texture");
        Material  spriteMaterial = new Material(s);
        Texture2D t = GenerateTexture();

        spriteMaterial.mainTexture = t;

        RenderUtil.ShowAllSprite(spriteMaterial, gameObject);
    }
Ejemplo n.º 18
0
    protected void repeatControl_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = e.Item.DataItem as DataRowView;

        if (drv == null)
        {
            return;
        }

        DropDownList drp = e.Item.FindControl("drpArea") as DropDownList;

        if (this.GetAreas() != null)
        {
            drp.Items.Clear();
            drp.Items.Add(new ListItem("", ""));
            foreach (WHArea area in this.GetAreas())
            {
                drp.Items.Add(new ListItem(area.AreaCode, area.AreaCode));
            }
            string selectedArea = Cast.String(drv["AreaCode"]).Trim();
            if (!string.IsNullOrEmpty(selectedArea))
            {
                drp.SelectedValue = selectedArea;
            }
        }
        if (this._head != null && this._head.Status != StockInStatus.New)
        {
            WebUtil.DisableControl(drp);
        }

        TextBox txt;

        txt      = e.Item.FindControl("txtSection") as TextBox;
        txt.Text = Cast.String(drv["SectionCode"]);
        if (this._head != null && this._head.Status != StockInStatus.New)
        {
            WebUtil.DisableControl(txt);
        }
        txt      = e.Item.FindControl("txtQualifiedQty") as TextBox;
        txt.Text = RenderUtil.FormatNumber(drv["Quantity"], "#0.##");
        if (this._head != null && this._head.Status != StockInStatus.New)
        {
            WebUtil.DisableControl(txt);
            HtmlInputCheckBox chk = e.Item.FindControl("checkbox") as HtmlInputCheckBox;
            chk.Visible = false;
        }
        txt      = e.Item.FindControl("txtPrice") as TextBox;
        txt.Text = RenderUtil.FormatNumber(drv["Price"], "#0.##");
        if (this._head != null && this._head.Status != StockInStatus.New)
        {
            WebUtil.DisableControl(txt);
        }
    }
Ejemplo n.º 19
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;
        }
    }
Ejemplo n.º 20
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;
        }
    }
Ejemplo n.º 21
0
        public void WriteToHttpResponse(HttpContext context)
        {
            if (string.IsNullOrEmpty(this.VirtualPath))
            {
                this.VirtualPath = context.Request.FilePath;
            }
            context.Response.ContentType = "text/html";
            string html = RenderUtil.RenderAspx(context, VirtualPath, Model);

            context.Response.Write(html);
            context.Response.End();
        }
Ejemplo n.º 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int skuid = WebUtil.ParamInt("sku", 0);
         if (skuid <= 0)
         {
             this.divMsg.InnerText = "无效的SKU";
             return;
         }
         using (ISession session = new Session())
         {
             ItemSpec spec = ItemSpec.Retrieve(session, skuid);
             if (spec == null)
             {
                 this.divMsg.InnerText = "SKU " + skuid.ToString() + "不存在";
                 return;
             }
             //显示sku信息
             this.lblItemCode.Text = spec.ItemCode;
             this.lblSize.Text     = spec.SizeCode;
             ItemMaster master = ItemMaster.Retrieve(session, spec.ItemCode);
             this.lblItemName.Text = master == null ? "" : master.ItemName;
             ItemColor color = ItemColor.Retrieve(session, spec.ColorCode);
             this.lblColor.Text  = spec.ColorCode + " " + (color == null ? "" : color.ColorText);
             this.lblOVSQty.Text = spec.EnableOS ? RenderUtil.FormatNumber(spec.OSQty, "#0.##", "0") : "0";
             //现有库存
             StockSummary sto = StockSummary.Retrieve(session, skuid);
             this.lblStockQty.Text  = sto == null ? "0" : RenderUtil.FormatNumber(sto.StockQty, "#0.##");
             this.lblFrozenQty.Text = sto == null ? "0" : RenderUtil.FormatNumber(sto.FrozenQty, "#0.##");
             //在途采购记录
             IList <POLine> lines = POHead.PipelineInvQuery(session, skuid);
             this.repeater.DataSource = lines;
             this.repeater.DataBind();
             decimal pipelineStockQty = 0M;
             //计算汇总在途量
             foreach (POLine line in lines)
             {
                 pipelineStockQty += (line.PurchaseQty - line.ReceiveQty);
             }
             this.lblPipelineStock.Text = RenderUtil.FormatNumber(pipelineStockQty, "#0.##");
             if (lines.Count <= 0)
             {
                 this.divMsg.InnerText = "该SKU没有在途采购";
             }
             else
             {
                 this.divMsg.InnerText = "";
             }
         }
     }
 }
Ejemplo n.º 23
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;
            }
        }
    }
Ejemplo n.º 24
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;
        }
    }
Ejemplo n.º 25
0
        private Program()
        {
            SuspendLayout();

            // イベント
            PreviewKeyDown += Form_KeyDown;
            MouseDown      += Form_MouseDown;
            MouseMove      += Form_MouseMove;
            MouseUp        += Form_MouseUp;

            // Looks and Feel
            StartPosition   = FormStartPosition.Manual;
            FormBorderStyle = FormBorderStyle.None;
            BackColor       = Color.Black;
            Cursor          = Cursors.Cross;
            ShowInTaskbar   = false;
            ControlBox      = false;
            TopMost         = true;

            // コンテキストメニュー
            var contextMenu = new ContextMenuStrip();

            contextMenu.Items.Add(doUpload = new ToolStripMenuItem("アップロード (Shift)"));
            contextMenu.Items.Add(doSave   = new ToolStripMenuItem("ファイルに保存 (Ctrl)"));

            doUpload.Click += toggle;
            doSave.Click   += toggle;

            void toggle(object sender, EventArgs _)
            {
                ((ToolStripMenuItem)sender).Checked = !((ToolStripMenuItem)sender).Checked;
            }

            ContextMenuStrip = contextMenu;

            // 最大化
            Location = new Point(region.X, region.Y);
            Size     = region.Size;

            // 透明化
            var margins = new int[] { 0, 0, Width, Height };

            RenderUtil.DwmExtendFrameIntoClientArea(Handle, ref margins);

            // レンダリング最適化
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);

            ResumeLayout(false);
        }
Ejemplo n.º 26
0
        public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
        {
            base.RenderOverlay(cameraInfo);
            var info = GetHoveredNetInfo();

            if (!info)
            {
                return;
            }

            bool  exempt = DCRConfig.Config.Exemptions.Contains(info.name);
            Color color  = exempt ? Color.red : Color.green;

            RenderUtil.RenderSegmnetOverlay(cameraInfo, HoveredSegmentID, color);
        }
Ejemplo n.º 27
0
    protected void repeatControl_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = e.Item.DataItem as DataRowView;

        if (drv == null)
        {
            return;
        }

        Label lbl = e.Item.FindControl("lblFreeQty") as Label;

        lbl.Text = RenderUtil.FormatNumber(Cast.Decimal(drv["StockQty"]) - Cast.Decimal(drv["FrozenQty"]), "#0.##");
        TextBox txt = e.Item.FindControl("txtQty") as TextBox;

        txt.Text = RenderUtil.FormatNumber(drv["Qty"], "#0.##");
    }
Ejemplo n.º 28
0
            public ClipPath(Sector sector, PathUtil.PathType borderPathType)
            {
                float[] edgex, edgey;
                RenderUtil.HexEdges(borderPathType, out edgex, out edgey);

                Rectangle    bounds = sector.Bounds;
                List <Point> clip   = new List <Point>();

                clip.AddRange(Util.Sequence(1, Astrometrics.SectorWidth).Select(x => new Point(x, 1)));
                clip.AddRange(Util.Sequence(2, Astrometrics.SectorHeight).Select(y => new Point(Astrometrics.SectorWidth, y)));
                clip.AddRange(Util.Sequence(Astrometrics.SectorWidth - 1, 1).Select(x => new Point(x, Astrometrics.SectorHeight)));
                clip.AddRange(Util.Sequence(Astrometrics.SectorHeight - 1, 1).Select(y => new Point(1, y)));

                for (int i = 0; i < clip.Count; ++i)
                {
                    Point pt = clip[i];
                    pt.Offset(bounds.Location);
                    clip[i] = pt;
                }

                PathUtil.ComputeBorderPath(clip, edgex, edgey, out clipPathPoints, out clipPathPointTypes);

                PointF min = clipPathPoints[0];
                PointF max = clipPathPoints[0];

                for (int i = 1; i < clipPathPoints.Length; ++i)
                {
                    PointF pt = clipPathPoints[i];
                    if (pt.X < min.X)
                    {
                        min.X = pt.X;
                    }
                    if (pt.Y < min.Y)
                    {
                        min.Y = pt.Y;
                    }
                    if (pt.X > max.X)
                    {
                        max.X = pt.X;
                    }
                    if (pt.Y > max.Y)
                    {
                        max.Y = pt.Y;
                    }
                }
                this.bounds = new RectangleF(min, new SizeF(max.X - min.X, max.Y - min.Y));
            }
Ejemplo n.º 29
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;
        }
    }
Ejemplo n.º 30
0
    protected void repeatControl_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = e.Item.DataItem as DataRowView;

        if (drv == null)
        {
            return;
        }

        TextBox txt = e.Item.FindControl("txtPrice") as TextBox;

        txt.Text = RenderUtil.FormatNumber(drv["Price"], "#0.#0");
        if (this._head == null || this._head.Status != StockInStatus.Confirm)
        {
            WebUtil.DisableControl(txt);
        }
    }