Exemple #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            MaterialCentreGroupMasterModel objGroup = new MaterialCentreGroupMasterModel();

            objGroup.Group        = tbxGroupName.Text.TrimEnd();
            objGroup.Alias        = tbxAliasname.Text == null ? string.Empty : tbxAliasname.Text;
            objGroup.PrimaryGroup = cbxPrimarygroup.SelectedItem.ToString() == "Y" ? true : false;
            if (cbxPrimarygroup.SelectedItem.ToString() == "N")
            {
                objGroup.UnderGroup = cbxUndergroup.SelectedItem.ToString();
            }

            objGroup.CreatedBy = "Admin";
            objGroup.MCG_ID    = MCGId;

            bool isSuccess = MatObj.UpdateMCG(objGroup);

            if (isSuccess)
            {
                MessageBox.Show("Update Successfully!");
                MCGId = 0;
                ClearControls();
                Administration.List.MaterialcentergrpList frmList = new Administration.List.MaterialcentergrpList();
                frmList.StartPosition = FormStartPosition.CenterScreen;

                frmList.ShowDialog();
                FillMaterialGroupInfo();
            }
        }
Exemple #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            MaterialCentreMasterModel objmodel = objMatMasterBl.GetMaterialCenterByGroupname(tbxGroupName.Text.Trim());

            if (objmodel.GroupName != null)
            {
                MessageBox.Show("Can Not Delete Group Name Under Tag With Item Name.." + objmodel.GroupName);
                tbxGroupName.Focus();
            }
            if (objmodel.GroupName == null)
            {
                bool isDelete = MatObj.DeleteMaterialGroupById(MCGId);
                if (isDelete)
                {
                    MessageBox.Show("Delete Successfully!");
                    MCGId = 0;
                    ClearControls();
                    Administration.List.MaterialcentergrpList frmList = new Administration.List.MaterialcentergrpList();
                    frmList.StartPosition = FormStartPosition.CenterScreen;

                    frmList.ShowDialog();
                    FillMaterialGroupInfo();
                }
            }
        }
        private void ListMaterialCengrp_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Administration.List.MaterialcentergrpList frmList = new Administration.List.MaterialcentergrpList();
            frmList.StartPosition = FormStartPosition.CenterScreen;

            frmList.ShowDialog();
        }