Beispiel #1
0
// - code for update
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (tbxGroupItem.Text.Equals(string.Empty))
            {
                showMessageBox _MsgBox = new showMessageBox(this.Page, "Error no item", "Please enter a Group Item Name");
            }
            else
            {
                TrackerDotNet.control.ItemTypeTbl _ITT = new ItemTypeTbl();

                SysDataTbl _SysData = new SysDataTbl();

                _ITT.ItemDesc            = tbxGroupItem.Text;
                _ITT.ItemDetail          = tbxGroupDesc.Text;
                _ITT.ItemEnabled         = true;
                _ITT.ItemsCharacteritics = "Group Item-update";
                _ITT.ItemShortName       = tbxGroupShortName.Text;
                _ITT.ServiceTypeID       = _SysData.GetGroupItemTypeID();
                _ITT.SortOrder           = ItemTypeTbl.CONST_NEEDDESCRIPTION_SORT_ORDER + 5;
                _ITT.ItemTypeID          = Convert.ToInt32(lblGroupItemID.Text);
                bool           _success = _ITT.UpdateItem(_ITT);
                showMessageBox _MsgBox  = new showMessageBox(this.Page, "Status", _success ? "Group item update" : "Error updating group item");
                ReturnToPrevPage();
            }
        }
Beispiel #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (tbxGroupItem.Text.Equals(string.Empty))
            {
                showMessageBox _MsgBox = new showMessageBox(this.Page, "Error no item", "Please enter a Group Item Name");
            }
            else
            {
                TrackerDotNet.control.ItemTypeTbl _ITT = new ItemTypeTbl();

                if (_ITT.GroupOfThisNameExists(tbxGroupItem.Text))
                {
                    showMessageBox _MsgBox = new showMessageBox(this.Page, "name exists", "Group Name: " + tbxGroupItem.Text + " Exists. Please enter a different Group Item Name");
                }
                else
                {
                    SysDataTbl _SysData = new SysDataTbl();

                    _ITT.ItemDesc            = tbxGroupItem.Text;
                    _ITT.ItemDetail          = tbxGroupDesc.Text;
                    _ITT.ItemEnabled         = true;
                    _ITT.ItemsCharacteritics = "Group Item";
                    _ITT.ItemShortName       = tbxGroupShortName.Text;
                    _ITT.ServiceTypeID       = _SysData.GetGroupItemTypeID();
                    _ITT.SortOrder           = ItemTypeTbl.CONST_NEEDDESCRIPTION_SORT_ORDER + 5;

                    bool           _success = _ITT.InsertItem(_ITT);
                    showMessageBox _MsgBox  = new showMessageBox(this.Page, "Status", _success ? "Group item added" : "Error adding group item");
                    ReturnToPrevPage();
                }
            }
        }