Beispiel #1
0
        public frmAddEditDocActionTree(string category, Models.Actions item, MethodType methodType)
        {
            InitializeComponent();
            this.category   = category;
            this.item       = item;
            this.methodType = methodType;


            txtParent.Properties.DataSource = new BindingList <Models.Actions>(new UnitOfWork().ActionsRepo.Get());
            detail();
            addNewInit();
        }
Beispiel #2
0
 void add()
 {
     try
     {
         UnitOfWork unitOfWork = new UnitOfWork();
         item           = new Actions();
         item.Value     = txtValue.Text;
         item.ItemOrder = txtOrder.EditValue?.ToInt();
         item.ParentId  = txtParent.EditValue?.ToInt();
         item.Category  = category;
         unitOfWork.ActionsRepo.Insert(item);
         unitOfWork.Save();
     }
     catch (Exception e)
     {
     }
 }