예제 #1
0
 protected virtual void tsBtnLuu_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.Normal;
     UpdateData();
     EnableItems();
     dgView.Invalidate();
 }
예제 #2
0
        protected override ViewResult View(string viewName, string masterName, object model)
        {
            DisplayFlag displayFlag = 0;

            if (HttpContext.Request["displayFlag"] != null)
            {
                displayFlag = (DisplayFlag)int.Parse(HttpContext.Request["displayFlag"]);
            }
            if (HttpContext.Request["BIARedirectedDialogUrl"] != null)
            {
                HttpContext.Response.AddHeader("BIARedirectedDialogUrl", HttpContext.Request["BIARedirectedDialogUrl"]);
            }

            /* if (HttpContext.Request["DialogRefreshPartialView"] != null)
             * {
             *   viewName = HttpContext.Request["DialogRefreshPartialView"];
             *   return PartialViewConverter.Convert(base.PartialView(viewName, model));
             * }*/
            if ((displayFlag & DisplayFlag.Popup) == DisplayFlag.Popup)
            {
                ViewResult myView = base.View(viewName, masterName, model);
                myView.MasterName = "~/Views/Shared/_Layout_Dialog.cshtml";
                //Request.Add("BIACurrentDialogUrl", Url.Action(viewName));
                return(myView);
            }
            return(base.View(viewName, masterName, model));
        }
예제 #3
0
 protected virtual void tsBtnSua_Click(object sender, EventArgs e)
 {
     if (_displayFlag == DisplayFlag.Update)
     {
         _displayFlag = DisplayFlag.Normal;
     }
     else
     {
         _displayFlag = DisplayFlag.Update;
     }
     EnableItems();
 }
예제 #4
0
        protected override ViewResult View(string viewName, string masterName, object model)
        {
            DisplayFlag displayFlag = 0;

            if (HttpContext.Request["BIANetDialogDisplayFlag"] != null)
            {
                displayFlag = (DisplayFlag)int.Parse(HttpContext.Request["BIANetDialogDisplayFlag"]);
            }
            if (HttpContext.Request["BIANetDialogRedirectedUrl"] != null)
            {
                HttpContext.Response.AddHeader("BIANetDialogRedirectedUrl", HttpContext.Request["BIANetDialogRedirectedUrl"]);
            }
            if (HttpContext.Request["BIANetDialogRedirect"] != null)
            {
                HttpContext.Response.AddHeader("BIANetDialogRedirect", HttpContext.Request["BIANetDialogRedirect"]);
            }

            /* if (HttpContext.Request["DialogRefreshPartialView"] != null)
             * {
             *   viewName = HttpContext.Request["DialogRefreshPartialView"];
             *   return PartialViewConverter.Convert(base.PartialView(viewName, model));
             * }*/
            if (displayFlag == DisplayFlag.Popup)
            {
                ViewResult myView = base.View(viewName, masterName, model);
                myView.MasterName = BIA.Net.Common.BIASettingsReader.GetDialogLayout("Popup");
                //Request.Add("BIACurrentDialogUrl", Url.Action(viewName));
                return(myView);
            }
            else if (displayFlag == DisplayFlag.Content)
            {
                ViewResult myView = base.View(viewName, masterName, model);
                myView.MasterName = Common.BIASettingsReader.GetDialogLayout("Content");
                //Request.Add("BIACurrentDialogUrl", Url.Action(viewName));
                return(myView);
            }
            else if (displayFlag == DisplayFlag.MainPageContent)
            {
                ViewResult myView = base.View(viewName, masterName, model);
                myView.MasterName = Common.BIASettingsReader.GetDialogLayout("MainPageContent");
                //Request.Add("BIACurrentDialogUrl", Url.Action(viewName));
                return(myView);
            }

            return(base.View(viewName, masterName, model));
        }
예제 #5
0
    protected void SectionSprite(DisplayFlag flags)
    {
        serializedObject.Update();
        MadGUI.PropertyField(visible, "Visible");

        if ((flags & DisplayFlag.WithoutMaterial) == 0)
        {
            MadGUI.PropertyField(texture, "Texture", MadGUI.ObjectIsSet);
            MadGUI.Indent(() => {
                MadGUI.PropertyFieldVector2(textureRepeat, "Repeat");
                MadGUI.PropertyFieldVector2(textureOffset, "Offset");
            });
        }

        MadGUI.PropertyField(tint, "Tint");

        if ((flags & DisplayFlag.WithoutSize) == 0)
        {
            if (GUILayout.Button(new GUIContent("Resize To Texture",
                                                "Resizes this sprite to match texture size")))
            {
                var sprite = target as MadSprite;
                MadUndo.RecordObject2(sprite, "Resize To Texture");
                sprite.ResizeToTexture();
                EditorUtility.SetDirty(sprite);
            }
        }

        MadGUI.PropertyField(pivotPoint, "Pivot Point");
        MadGUI.PropertyField(guiDepth, "GUI Depth");

        if ((flags & DisplayFlag.WithoutFill) == 0)
        {
            MadGUI.PropertyField(fillType, "Fill Type");
            EditorGUILayout.Slider(fillValue, 0, 1, "Fill Value");

            if (sprite.fillType == MadSprite.FillType.RadialCCW || sprite.fillType == MadSprite.FillType.RadialCW)
            {
                MadGUI.PropertyFieldSlider(radialFillOffset, -1, 1, "Offset");
                MadGUI.PropertyFieldSlider(radialFillLength, 0, 1, "Length");
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
예제 #6
0
        protected override RedirectToRouteResult RedirectToAction(string actionName, string controllerName, RouteValueDictionary routeValues)
        {
            DisplayFlag displayFlag = 0;

            if (HttpContext.Request["displayFlag"] != null)
            {
                displayFlag = (DisplayFlag)int.Parse(HttpContext.Request["displayFlag"]);
            }
            if (displayFlag != 0)
            {
                //Test if we are returned to parent Page
                string dialogUrlParent = null;
                if (HttpContext.Request["dialogUrlParent"] != null)
                {
                    dialogUrlParent = ((string)HttpContext.Request["dialogUrlParent"]).ToLower();
                }
                if (!string.IsNullOrEmpty(dialogUrlParent))
                {
                    UrlHelper u        = new UrlHelper(this.ControllerContext.RequestContext);
                    string    url      = UniformizeUrl(u.Action(actionName, controllerName, routeValues));
                    string    full_url = UniformizeUrl(HttpContext.Request.Url.Scheme + "://" + HttpContext.Request.Url.Authority + u.Action(actionName, controllerName, routeValues));

                    string[] dialogUrlsParent = dialogUrlParent.Split(';');
                    foreach (string urlPa in dialogUrlsParent)
                    {
                        string uniformizedUrlParent = UniformizeUrl(urlPa);
                        if (url.Equals(uniformizedUrlParent) || full_url.Equals(uniformizedUrlParent))
                        //if (urlPa.Contains(url))
                        {
                            return(base.RedirectToAction("CloseDialog", "DialogBasicAction", null));
                        }
                    }
                }

                //Not parent page continue
                if (routeValues == null)
                {
                    routeValues = new RouteValueDictionary();
                }
                routeValues.Add("displayFlag", (int)displayFlag);
                routeValues.Add("BIARedirectedDialogUrl", Url.Action(actionName, routeValues));
            }
            return(base.RedirectToAction(actionName, controllerName, routeValues));
        }
예제 #7
0
 private void btnPhanQuyen_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.PhanQuyen;
     DisplayItems();
 }
    protected void SectionSprite(DisplayFlag flags)
    {
        serializedObject.Update();
        GUIDepthCheck();

        MadGUI.PropertyField(panel, "Panel", MadGUI.ObjectIsSet);
        EditorGUILayout.Space();

        MadGUI.PropertyField(visible, "Visible");

        if ((flags & DisplayFlag.WithoutMaterial) == 0)
        {
            MadGUI.PropertyFieldEnumPopup(inputType, "Input Type");
            MadGUI.Indent(() => {
                switch (sprite.inputType)
                {
                case MadSprite.InputType.SingleTexture:
                    MadGUI.PropertyField(texture, "Texture", MadGUI.ObjectIsSet);
                    MadGUI.Indent(() => {
                        MadGUI.PropertyFieldVector2(textureRepeat, "Repeat");
                        MadGUI.PropertyFieldVector2(textureOffset, "Offset");
                    });
                    break;

                case MadSprite.InputType.TextureAtlas:
                    MadGUI.PropertyField(textureAtlas, "Texture Atlas", MadGUI.ObjectIsSet);

                    if (sprite.textureAtlas != null)
                    {
                        MadAtlasUtil.AtlasField(textureAtlasSpriteGUID, sprite.textureAtlas, "Sprite", this);
                    }

                    break;

                default:
                    Debug.LogError("Unknown input type: " + sprite.inputType);
                    break;
                }
            });
        }

        MadGUI.PropertyField(hasPremultipliedAlpha, "Has Pre-Alpha");

        MadGUI.PropertyField(tint, "Tint");

        EditorGUILayout.Space();

        if ((flags & DisplayFlag.WithoutSize) == 0)
        {
            EditorGUILayout.Space();
            GUI.backgroundColor = Color.yellow;
            if (GUILayout.Button(new GUIContent("Resize To Texture",
                                                "Resizes this sprite to match texture size")))
            {
                MadUndo.RecordObject2(sprite, "Resize To Texture");
                sprite.ResizeToTexture();
                EditorUtility.SetDirty(sprite);
            }
            GUI.backgroundColor = Color.white;
            EditorGUILayout.Space();
        }

        EditorGUILayout.Space();

        MadGUI.PropertyField(pivotPoint, "Pivot Point");
        if (sprite.pivotPoint == MadSprite.PivotPoint.Custom)
        {
            MadGUI.Indent(() => {
                MadGUI.PropertyFieldVector2(customPivotPoint, "Custom Pivot Point");
            });
        }

        MadGUI.PropertyField(guiDepth, "GUI Depth");

        EditorGUILayout.Space();

        if ((flags & DisplayFlag.WithoutFill) == 0)
        {
            MadGUI.PropertyField(fillType, "Fill Type");
            EditorGUILayout.Slider(fillValue, 0, 1, "Fill Value");

            if (sprite.fillType == MadSprite.FillType.RadialCCW || sprite.fillType == MadSprite.FillType.RadialCW)
            {
                MadGUI.PropertyFieldSlider(radialFillOffset, -1, 1, "Offset");
                MadGUI.PropertyFieldSlider(radialFillLength, 0, 1, "Length");
            }
        }

        if (showLiveBounds)
        {
            GUILayout.Label("Sprite Border", "HeaderLabel");
            EditorGUILayout.Space();
            if (sprite.CanDraw())
            {
                FieldLiveBounds();
            }
            else
            {
                MadGUI.Info("More settings will be available when the sprite texture or atlas is set.");
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
예제 #9
0
 private void btnThongKe_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.ThongKe;
     DisplayForm();
 }
예제 #10
0
 private void btnNhapKho_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.NhapKho;
     DisplayForm();
 }
예제 #11
0
 private void button3_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.DatHang;
     DisplayForm();
 }
예제 #12
0
 private void btnBanHang_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.BanHang;
     DisplayForm();
 }
예제 #13
0
 private void btnLoaiKhacHang_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.LoaiKhachHang;
     DisplayItems();
 }
예제 #14
0
 private void btnDanhMuc_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.DanhMucSP;
     FrmQuanLySanPham_Load(sender, e);
 }
예제 #15
0
 private void btnNhanVien_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.NhanVien;
     DisplayItems();
 }
예제 #16
0
 private void btnPhieuQuaTang_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.PhieuQuaTang;
     DisplayItems();
 }
예제 #17
0
 private void btnTangHangThe_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.NhaCungCap;
     DisplayItems();
 }
예제 #18
0
 private void btnDanhMucSP_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.DanhMucSP;
     SetColorButtons();
     DisplayItems();
 }
예제 #19
0
 private void btnSanPham_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.SanPham;
     SetColorButtons();
     DisplayItems();
 }
예제 #20
0
 private void btnNhomHang_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.NhomHang;
     SetColorButtons();
     DisplayItems();
 }
예제 #21
0
 private void btnNhomHang_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.NhomHang;
     FrmQuanLySanPham_Load(sender, e);
 }
예제 #22
0
 private void btnPhieuChi_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.PhieuChi;
     DisplayForm();
 }
예제 #23
0
 private void btnInMaVach_Click(object sender, EventArgs e)
 {
     _displayFlag = DisplayFlag.InMaVach;
     FrmQuanLySanPham_Load(sender, e);
 }
예제 #24
0
    protected void SectionSprite(DisplayFlag flags) {
        serializedObject.Update();
        GUIDepthCheck();

        MadGUI.PropertyField(panel, "Panel", MadGUI.ObjectIsSet);
        EditorGUILayout.Space();

        MadGUI.PropertyField(visible, "Visible");
    
        if ((flags & DisplayFlag.WithoutMaterial) == 0) {
            MadGUI.PropertyFieldEnumPopup(inputType, "Input Type");
            MadGUI.Indent(() => {
            
                switch (sprite.inputType) {
                    case MadSprite.InputType.SingleTexture:
                        MadGUI.PropertyField(texture, "Texture", MadGUI.ObjectIsSet);
                        MadGUI.Indent(() => {
                            MadGUI.PropertyFieldVector2(textureRepeat, "Repeat");
                            MadGUI.PropertyFieldVector2(textureOffset, "Offset");
                        });
                        break;
                    case MadSprite.InputType.TextureAtlas:
                        MadGUI.PropertyField(textureAtlas, "Texture Atlas", MadGUI.ObjectIsSet);
                        
                        if (sprite.textureAtlas != null) {
                            MadAtlasUtil.AtlasField(textureAtlasSpriteGUID, sprite.textureAtlas, "Sprite");
                        }
                        
                        break;
                    default:
                        Debug.LogError("Unknown input type: " + sprite.inputType);
                        break;
                }
            
            });
            
        }

        MadGUI.PropertyField(hasPremultipliedAlpha, "Has Pre-Alpha");
        
        MadGUI.PropertyField(tint, "Tint");
        
        EditorGUILayout.Space();
        
        if ((flags & DisplayFlag.WithoutSize) == 0) {
            EditorGUILayout.Space();
            GUI.backgroundColor = Color.yellow;
            if (GUILayout.Button(new GUIContent("Resize To Texture",
                "Resizes this sprite to match texture size"))) {
                MadUndo.RecordObject2(sprite, "Resize To Texture");
                sprite.ResizeToTexture();
                EditorUtility.SetDirty(sprite);
            }
            GUI.backgroundColor = Color.white;
            EditorGUILayout.Space();
        }
        
        EditorGUILayout.Space();
        
        MadGUI.PropertyField(pivotPoint, "Pivot Point");
        if (sprite.pivotPoint == MadSprite.PivotPoint.Custom) {
            MadGUI.Indent(() => {
                MadGUI.PropertyFieldVector2(customPivotPoint, "Custom Pivot Point");
            });
        }

        MadGUI.PropertyField(guiDepth, "GUI Depth");
        
        EditorGUILayout.Space();
        
        if ((flags & DisplayFlag.WithoutFill) == 0) {
            MadGUI.PropertyField(fillType, "Fill Type");
            EditorGUILayout.Slider(fillValue, 0, 1, "Fill Value");
            
            if (sprite.fillType == MadSprite.FillType.RadialCCW || sprite.fillType == MadSprite.FillType.RadialCW) {
                MadGUI.PropertyFieldSlider(radialFillOffset, -1, 1, "Offset");
                MadGUI.PropertyFieldSlider(radialFillLength, 0, 1, "Length");
            }
        }

        if (showLiveBounds) {
            GUILayout.Label("Sprite Border", "HeaderLabel");
            EditorGUILayout.Space();
            if (sprite.CanDraw()) {
                FieldLiveBounds();
            } else {
                MadGUI.Info("More settings will be available when the sprite texture or atlas is set.");
            }
        }

        serializedObject.ApplyModifiedProperties();
    }