Esempio n. 1
0
        protected override void EditObject()
        {
            if (this.MatCodeTreeList.FocusedNode == null)
            {
                return;
            }

            CodeEditWindow form = new CodeEditWindow(2, CharacterCasing.Upper, false);

            form.Code        = this.MatCodeTreeList.FocusedNode.GetValue("Code").ToString();
            form.Desc        = this.MatCodeTreeList.FocusedNode.GetValue("Desc").ToString();
            form.FormClosed += (o, e) =>
            {
                T_CodeType codeType = new T_CodeType()
                {
                    Code     = form.Code,
                    Desc     = form.Desc,
                    Id       = Convert.ToInt16(this.MatCodeTreeList.FocusedNode.GetValue("Id")),
                    ParentId = Convert.ToInt16(this.MatCodeTreeList.FocusedNode.GetValue("ParentId"))
                };

                _Proxy.UpdateCodeType(codeType);

                this.MatCodeTreeList.FocusedNode.SetValue("Code", codeType.Code);
                this.MatCodeTreeList.FocusedNode.SetValue("Desc", codeType.Desc);
            };

            form.ShowDialog();
        }
Esempio n. 2
0
        protected override void AddObject()
        {
            CodeEditWindow form = new CodeEditWindow(2, CharacterCasing.Upper, false);

            form.FormClosed += (o, e) =>
            {
                if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    T_CodeType codeType = new T_CodeType()
                    {
                        Code = form.Code, Desc = form.Desc
                    };

                    if (this.MatCodeTreeList.DataSource != null)
                    {
                        List <T_CodeType> codeList = this.MatCodeTreeList.DataSource as List <T_CodeType>;
                        codeType.Id = codeList.Select(t => t.Id).Max() + 1;
                    }
                    else
                    {
                        codeType.Id = 0;
                    }

                    if (this.MatCodeTreeList.FocusedNode == null)
                    {
                        codeType.ParentId = -1;
                    }
                    else
                    {
                        codeType.ParentId = Convert.ToInt16(this.MatCodeTreeList.FocusedNode.GetValue("Id"));
                    }

                    //_Proxy.AddCodeType(codeType);

                    this.MatCodeTreeList.BeginUnboundLoad();
                    DevExpress.XtraTreeList.Nodes.TreeListNode node = this.MatCodeTreeList.AppendNode(codeType, this.MatCodeTreeList.FocusedNode);
                    node.SetValue("Id", codeType.Id);
                    node.SetValue("Code", codeType.Code);
                    node.SetValue("Desc", codeType.Desc);
                    this.MatCodeTreeList.EndUnboundLoad();
                }
            };

            form.ShowDialog();
        }
Esempio n. 3
0
        protected override void AddObject()
        {
            CodeEditWindow form = new CodeEditWindow(2, CharacterCasing.Upper, false);

            form.FormClosed += (o, e) =>
            {
                if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    T_MaterailMode matMode = new T_MaterailMode()
                    {
                        Code = form.Code, Desc = form.Desc
                    };
                    _Proxy.AddMatMode(matMode);
                    this.gvCode.RefreshData();
                }
            };

            form.ShowDialog();
        }
Esempio n. 4
0
        protected override void AddObject()
        {
            CodeEditWindow form = new CodeEditWindow(10, CharacterCasing.Lower, false);

            form.FormClosed += (o, e) =>
            {
                if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    T_Unit unit = new T_Unit()
                    {
                        Code = form.Code, Desc = form.Desc
                    };
                    _Proxy.AddUnit(unit);
                    this.gvUnit.RefreshData();
                }
            };

            form.ShowDialog();
        }
Esempio n. 5
0
        protected override void EditObject()
        {
            if (this.gvCode.GetFocusedRow() == null)
            {
                return;
            }

            T_MaterailMode matMode = this.gvCode.GetFocusedRow() as T_MaterailMode;

            CodeEditWindow form = new CodeEditWindow(2, CharacterCasing.Upper, true);

            form.Code        = matMode.Code;
            form.Desc        = matMode.Desc;
            form.FormClosed += (o, e) =>
            {
                matMode.Desc = form.Desc;

                _Proxy.UpdateMatMode(matMode);
                this.gvCode.RefreshData();
            };

            form.ShowDialog();
        }
Esempio n. 6
0
        protected override void EditObject()
        {
            if (this.gvUnit.GetFocusedRow() == null)
            {
                return;
            }

            T_Unit unit = this.gvUnit.GetFocusedRow() as T_Unit;

            CodeEditWindow form = new CodeEditWindow(10, CharacterCasing.Lower, true);

            form.Code        = unit.Code;
            form.Desc        = unit.Desc;
            form.FormClosed += (o, e) =>
            {
                unit.Desc = form.Desc;

                _Proxy.UpdateUnit(unit);
                this.gvUnit.RefreshData();
            };

            form.ShowDialog();
        }