Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ProcessTransaction pt = new ProcessTransaction();

            pt.OpenConnection();
            pt.BeginTransaction();
            try
            {
                if (!checkValid())
                {
                    return;
                }
                ModuleErrorTypeModel model;
                if (_isAdd)
                {
                    model = new ModuleErrorTypeModel();
                }
                else
                {
                    model = (ModuleErrorTypeModel)ModuleErrorTypeBO.Instance.FindByPK(_id);
                }

                //model.Type = cboType.SelectedIndex;
                model.Type    = 0;
                model.Name    = txtName.Text.Trim();
                model.GroupID = (int)cboGroup.SelectedValue;

                if (_isAdd)
                {
                    pt.Insert(model);
                }
                else
                {
                    pt.Update(model);
                }

                pt.CommitTransaction();

                if (model.GroupID == 0)
                {
                    loadGroup();
                }

                loadTree();

                SetInterface(false);
                ClearInterface();

                _isSaved = true;
            }
            catch (Exception ex)
            {
                TextUtils.ShowError("Lưu trữ không thành công!", ex);
            }
            finally
            {
                pt.CloseConnection();
            }
        }
Example #2
0
        private void btnNN_Click(object sender, EventArgs e)
        {
            DataTable dtNN = TextUtils.GetDistinctDatatable(dt, "F141");

            dtNN.Rows.RemoveAt(0);
            dtNN.Rows.RemoveAt(0);
            foreach (DataRow r in dtNN.Rows)
            {
                ModuleErrorTypeModel model = new ModuleErrorTypeModel();
                model.Name = r["F141"].ToString();
                model.Type = 1;
                ModuleErrorTypeBO.Instance.Insert(model);
            }
        }
Example #3
0
 protected ModuleErrorTypeFacade(ModuleErrorTypeModel model) : base(model)
 {
 }