コード例 #1
0
        private void btnCategorySave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (obj == null)
            {
                obj = new Model.CATEGORY();

                obj.CATEGORY_NAME = edtCategoryName.Text;
                obj.DESCRIPTION   = edtCategoryDescription.Text;
                obj.RECORD_STATUS = "A";

                preCategory.saveCategory(obj);
            }
            else
            {
                obj.CATEGORY_NAME = edtCategoryName.Text;
                obj.DESCRIPTION   = edtCategoryDescription.Text;
                obj.RECORD_STATUS = "A";

                preCategory.updateCategory(obj);
            }

            this.beforeForm.WindowState = FormWindowState.Maximized;
            this.beforeForm.Activate();
            //Close();
        }
コード例 #2
0
        public frmAddCategory(CategoryPresenter preCategory, Model.CATEGORY obj)
        {
            this.preCategory = preCategory;
            this.obj         = obj;
            InitializeComponent();

            edtCategoryName.Text        = obj.CATEGORY_NAME;
            edtCategoryDescription.Text = obj.DESCRIPTION;
        }
コード例 #3
0
ファイル: frmCategory.cs プロジェクト: jceation/ushop
        private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            GridView gridView = gridCategory.FocusedView as GridView;

            Model.CATEGORY obj = new Model.CATEGORY();

            obj.CATEGORY_ID   = Convert.ToInt32(gridView.GetFocusedRowCellValue("CATEGORY_ID").ToString());
            obj.CATEGORY_NAME = gridView.GetFocusedRowCellValue("CATEGORY_NAME").ToString();
            obj.DESCRIPTION   = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString();

            frmAddCategory frmAdd = new frmAddCategory(preCategory, obj);

            frmAdd.ShowDialog();
        }
コード例 #4
0
        private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            GridView gridView = gridCategory.FocusedView as GridView;

            Model.CATEGORY obj = new Model.CATEGORY();

            obj.CATEGORY_ID   = Convert.ToInt32(gridView.GetFocusedRowCellValue("CATEGORY_ID").ToString());
            obj.CATEGORY_NAME = gridView.GetFocusedRowCellValue("CATEGORY_NAME").ToString();
            obj.DESCRIPTION   = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString();

            //frmAddCategory frmAdd = new frmAddCategory(preCategory, obj);
            //frmAdd.ShowDialog();
            Form frmAdd = new frmAddCategory(preCategory, obj, this);

            frmAdd.WindowState     = FormWindowState.Maximized;
            frmAdd.FormBorderStyle = FormBorderStyle.None;
            frmAdd.MdiParent       = this.MdiParent;
            frmAdd.Dock            = DockStyle.Fill;
            frmAdd.Show();
        }
コード例 #5
0
        private void btnCategorySave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (obj == null)
            {
                obj = new Model.CATEGORY();

                obj.CATEGORY_NAME = edtCategoryName.Text;
                obj.DESCRIPTION   = edtCategoryDescription.Text;
                obj.RECORD_STATUS = "A";

                preCategory.saveCategory(obj);
            }
            else
            {
                obj.CATEGORY_NAME = edtCategoryName.Text;
                obj.DESCRIPTION   = edtCategoryDescription.Text;
                obj.RECORD_STATUS = "A";

                preCategory.updateCategory(obj);
            }

            Close();
        }