示例#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
        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();
        }