예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            sc  = new wrProducts.Server2Client();
            prd = new wrProducts.wsProducts();
            wrProducts.Category c = new wrProducts.Category();
            c.CategoryID   = CID;
            c.CategoryName = txtCNM.Text.ToUpper();

            if (!IsEdit)
            {
                sc = prd.AddCategory(c);

                if (sc.Message == null)
                {
                    XtraMessageBox.Show("New Category added successfully!");
                }
                else
                {
                    XtraMessageBox.Show(sc.Message);
                }
                txtCNM.Text = "";
                txtCNM.Focus();
            }
            else
            {
                sc = prd.UpdateCategory(c);

                if (sc.Message == null)
                {
                    XtraMessageBox.Show("Category updated successfully!");
                }
                else
                {
                    XtraMessageBox.Show(sc.Message);
                }

                dp.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
            }
            LoadData();
        }