Ejemplo n.º 1
0
        void SaveGroupPart()
        {
            if (!radioButton1.Checked)
            {
                return;
            }
            if (ValidationUtility.FieldNotAllowNull(groupGroupPart) == false)
            {
                return;
            }
            Model.GroupPart grouppart = _request.groupPart;
            CoverObjectUtility.GetAutoBindingData(groupGroupPart, grouppart);
            try
            {
                using (IUnitOfWork uow = new UnitOfWork())
                {
                    uow.GroupPartBaseRepository.Update(grouppart);
                    uow.Commit();
                }

                Close();
            }
            catch
            {
                lblNotify1.SetText(UI.createfailed, ToolBoxCS.LabelNotify.EnumStatus.Failed);
            }
        }
Ejemplo n.º 2
0
        private void btnSave_Click_1(object sender, EventArgs e)
        {
            if (ValidationUtility.FieldNotAllowNull(this) == false)
            {
                return;
            }

            Model.GroupPart cate = new Model.GroupPart();
            cate.GroupPartName = txtName.Text;
            cate.GroupPartCode = txtCode.Text;
            cate.Note          = txtNote.Text;
            cate.CreateBy      = UserManagement.UserSession.UserName;
            cate.CreateDate    = DateTime.Now;
            cate.ModifyDate    = DateTime.Now;
            cate.ModifyBy      = UserManagement.UserSession.UserName;
            try
            {
                int Id = 0;
                using (IUnitOfWork uow = new UnitOfWork())
                {
                    Id = uow.GroupPartBaseRepository.AddandGetRequestPaymentId(cate);
                    uow.Commit();
                }
                TreeTagPart treeTag = new TreeTagPart();
                treeTag.NodeTye        = TreeTagPart.Types.GroupPart;
                treeTag.GroupPartIDTag = Id;
                TreeNode node = new TreeNode(cate.GroupPartName);
                node.Tag = treeTag;
                if (AddNode != null)
                {
                    AddNode(node);
                }

                lblNotify1.SetText(UI.createsuccess, ToolBoxCS.LabelNotify.EnumStatus.Success);
                Close();
            }
            catch
            {
                lblNotify1.SetText(UI.createfailed, ToolBoxCS.LabelNotify.EnumStatus.Failed);
            }
        }