Exemplo n.º 1
0
        public void Create(ERP_C001_CodeDictionary ERP_C001_CodeDictionary)
        {
            ERP_C001_CodeDictionary.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_C001_CodeDictionary.CreateUser = tempUser.UserName;
            ERP_C001_CodeDictionary.CompCode   = tempUser.CompCode;
            ERP_C001_CodeDictionary.Validate();
            this.ERP_C001_CodeDictionaryRepository.Add(ERP_C001_CodeDictionary);
            this.runtimeService.Commit();
        }
Exemplo n.º 2
0
        public void Update(ERP_C001_CodeDictionary ERP_C001_CodeDictionary)
        {
            ERP_C001_CodeDictionary.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ERP_C001_CodeDictionary.ModifyUser = tempUser.UserName;
            ERP_C001_CodeDictionary.Validate();
            var existstb_Sys_Menu = this.GetById(ERP_C001_CodeDictionary.Id);

            this.ERP_C001_CodeDictionaryRepository.SetValues(ERP_C001_CodeDictionary, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Exemplo n.º 3
0
        public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // MessageBox.Show(e.Item.Caption);
            //新增
            if (e.Item.Caption == BtnCommandEnum.Add)
            {
                ERP_C001_CodeDictionary codeDic = this.eRPC001CodeDictionaryBindingSource.Current as ERP_C001_CodeDictionary;
                if (codeDic == null)
                {
                    throw new AppException("请先选择类别");
                }
                eRPC001CodeBindingSource.AddNew();
                ERP_C001_Code temp = eRPC001CodeBindingSource.Current as ERP_C001_Code;
                temp.CodeID     = codeDic.Code;
                temp.CodeIDDesc = codeDic.FullName;
                // temp.CodeID = treeCodeType.FocusedNode[treeColumnCodeID] == null ? null : treeCodeType.FocusedNode[treeColumnCodeID].ToStr();
                //temp.CodeIDDesc = treeCodeType.FocusedNode[treeColumnCodeIDDesc] == null ? null : treeCodeType.FocusedNode[treeColumnCodeIDDesc].ToStr();

                EditForm("基础代号新增", BtnCommandEnum.Add);
                InitData();
            }
            else if (e.Item.Caption == BtnCommandEnum.Edit)
            {
                EditForm("基础代号修改", BtnCommandEnum.Edit);
            }
            else if (e.Item.Caption == BtnCommandEnum.Delete)
            {
                if (ERPHelper.Instance.MessageDel())
                {
                    var temp = eRPC001CodeBindingSource.Current as ERP_C001_Code;
                    if (temp == null)
                    {
                        throw new AppException("请先选择要删除的数据");
                    }
                    codeService.Delete(temp.Id);
                    eRPC001CodeBindingSource.RemoveCurrent();
                }
            }
            else if (e.Item.Caption == BtnCommandEnum.AddCodeDic)
            {
                eRPC001CodeDictionaryBindingSource.AddNew();
                ERP_C001_CodeDictionary temp = this.eRPC001CodeDictionaryBindingSource.Current as ERP_C001_CodeDictionary;
                temp.ParentId = "0";
                EditDicForm("类型新增", BtnCommandEnum.AddCodeDic);
            }
            else if (e.Item.Caption == BtnCommandEnum.EditCodeDic)
            {
                EditDicForm("类型修改", BtnCommandEnum.EditCodeDic);
            }
        }
Exemplo n.º 4
0
        private void EditDicForm(string formText, string btnCommand)
        {
            ERP_C001_CodeDictionary temp = this.eRPC001CodeDictionaryBindingSource.Current as ERP_C001_CodeDictionary;
            CodeDicEditForm         edit = new CodeDicEditForm(codeDicService, temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                eRPC001CodeDictionaryBindingSource.CancelEdit();
            }
            else
            {
                InitData();
            }
        }
Exemplo n.º 5
0
        void treeCodeType_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            ERP_C001_CodeDictionary temp = this.eRPC001CodeDictionaryBindingSource.Current as ERP_C001_CodeDictionary;

            eRPC001CodeBindingSource.DataSource = codeService.GetListByCodeID(temp.Code).OrderBy(a => a.Code).ToList();
        }
Exemplo n.º 6
0
 public CodeDicEditForm(IERP_C001_CodeDictionaryService codeDicService, ERP_C001_CodeDictionary tempData)
 {
     InitializeComponent();
     this.tempData       = tempData;
     this.codeDicService = codeDicService;
 }