Esempio n. 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            //  获取数据
            BDictSystem       system       = this.ucSystem1.GetData();
            List <BDictRole>  roles        = this.ucSystem1.GetRoles();
            List <DataEmpDir> emps         = this.ucSystem1.GetEmps();
            SystemWithRight   systemToSave = new SystemWithRight();

            systemToSave.RoleList = roles;
            systemToSave.EmpList  = emps;


            if (_IsNew)
            {
                bool common = false;
                if (EmpInfo.IsCenterAdmin)
                {
                    if (MessageHelper.ShowYesNoAndQuestion("是否加入到公共系统?") == DialogResult.Yes)
                    {
                        common = true;
                    }
                }
                int             new_id = 0;
                CustomException ce     = null;
                //  获取下一个系统ID,common为true时在10000以内找,否则在 机构ID + [0001-9999] 找
                if (common)
                {
                    new_id = HttpDataHelper.GetWithInfo <int>("BASE", "/setup/newsysidcenter", out ce);
                }
                else
                {
                    var parmList = new List <KeyValuePair <string, string> >
                    {
                        new KeyValuePair <string, string>("branchId", EnvInfo.BranchId.ToString())
                    };
                    new_id = HttpDataHelper.GetWithInfo <int>("BASE", "/setup/newsysid", out ce, parmList);
                }
                if (new_id == -1)
                {
                    MessageHelper.ShowError("可用的机构ID已满!");
                    return;
                }
                systemToSave.SystemInfo = system;
                system.Id = new_id;
                String str = StringHelper.SerializeObject <SystemWithRight>(systemToSave);

                // 加入数据
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/systemadd", out ce, str);
            }
            else
            {
                systemToSave.SystemInfo = system;
                String str = StringHelper.SerializeObject <SystemWithRight>(systemToSave);
                // 保存数据
                CustomException ce = null;
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/systemset", out ce, str);
            }

            this.DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            //  获取数据
            BDictMenu         menu       = this.ucMenu1.GetData();
            List <BDictRole>  roles      = this.ucMenu1.GetRoles();
            List <DataEmpDir> emps       = this.ucMenu1.GetEmps();
            MenuWithRight     menuToSave = new MenuWithRight();

            menuToSave.MenuInfo = menu;
            menuToSave.RoleList = roles;
            menuToSave.EmpList  = emps;

            //  保存数据
            String          str = StringHelper.SerializeObject <MenuWithRight>(menuToSave);
            CustomException ce  = null;

            if (_IsNew)
            {
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/menuadd", out ce, str);
            }
            else
            {
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/menuset", out ce, str);
            }


            this.DialogResult = DialogResult.OK;
        }
        private void btnOk_Click(object sender, EventArgs e)
        {
            // 保存修改数据
            BDictParameterEmp para = new BDictParameterEmp();

            if (string.IsNullOrEmpty(this.teValue.Text))
            {
                MessageHelper.ShowWarning("参数值不可为空!");
                return;
            }
            para.EmpId    = m_EmpId;
            para.Name     = this.teName.Text;
            para.Value    = this.teValue.Text;
            para.NameChn  = string.IsNullOrEmpty(this.teNameChn.Text) ? "" : this.teNameChn.Text;
            para.Describe = string.IsNullOrEmpty(this.meDescribe.Text) ? "" : this.meDescribe.Text;

            string          json = StringHelper.SerializeObject <BDictParameterEmp>(para);
            CustomException ce   = null;

            HttpDataHelper.HttpPostWithInfo("BASE", "/setup/paramempset", out ce, json);
            if (ce == null)
            {
                MessageHelper.ShowInfo("人员参数设置完成!");
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageHelper.ShowWarning("人员参数设置不成功!\r\n" + ce.InnerMessage);
                return;
            }
        }
Esempio n. 4
0
        private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // 保存修改数据
            BDictParameter para = this.gvParameterList.GetFocusedRow() as BDictParameter;

            if (string.IsNullOrEmpty(this.teValue.Text))
            {
                MessageHelper.ShowWarning("参数值不可为空!");
                return;
            }
            para.Value    = this.teValue.Text;
            para.NameChn  = string.IsNullOrEmpty(this.teNameChn.Text) ? "" : this.teNameChn.Text;
            para.Describe = string.IsNullOrEmpty(this.meDescribe.Text) ? "" : this.meDescribe.Text;

            string          json = StringHelper.SerializeObject <BDictParameter>(para);
            CustomException ce   = null;

            HttpDataHelper.HttpPostWithInfo("BASE", "/setup/paramset", out ce, json);
            if (ce == null)
            {
                this.gvParameterList.SetFocusedRowCellValue("Value", this.teValue.Text);
                this.gvParameterList.SetFocusedRowCellValue("NameChn", this.teNameChn.Text);
                this.gvParameterList.SetFocusedRowCellValue("Describe", this.meDescribe.Text);
                this.SetStatus(false);
            }
            else
            {
                MessageHelper.ShowError("保存参数失败!\r\n" + ce.Info);
            }
        }
Esempio n. 5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.DataObjectList = gcObject.DataSource as List <CDictObject>;
            if (this.DataObjectList != null || this.DataObjectList.Count > 0)
            {
                CustomException ce = null;
                // 加入数据处理
                String json = StringHelper.SerializeObject <List <CDictObject> >(this.DataObjectList);
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/objectadd", out ce, json);

                this.DialogResult = DialogResult.OK;
            }
        }
Esempio n. 6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //  保存数据
            this.DataModule = this.ucSysModule1.GetData();
            if (this.DataModule != null)
            {
                String          str = StringHelper.SerializeObject <CDictModule>(this.DataModule);
                CustomException ce  = null;
                HttpDataHelper.HttpPostWithInfo("BASE", "/setup/moduleset", out ce, str);

                this.DialogResult = DialogResult.OK;
            }
        }
Esempio n. 7
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     //  保存数据
     this.DataObject = this.ucSysObject1.GetData();
     if (this.DataObject != null)
     {
         String          str    = StringHelper.SerializeObject <CDictObject>(this.DataObject);
         CustomException ce     = null;
         String          result = HttpDataHelper.HttpPostWithInfo("BASE", "/setup/objectset", out ce, str);
         if (result == "1")
         {
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             MessageHelper.ShowError("保存失败");
         }
     }
 }
        private void bbiSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            List <DataEmpDir> emps   = this.gcEmp.DataSource as List <DataEmpDir>;
            List <BDictRole>  roles  = this.gcRole.DataSource as List <BDictRole>;
            string            fpCode = this.teCode.Text;
            //  保存数据处理, 1.清除本机构该功能点人员、角色, 2. 加入功能点人员、角色
            FunctionPointWithRight fpr = new FunctionPointWithRight();

            fpr.FpCode   = this.teCode.Text;
            fpr.EmpList  = emps;
            fpr.RoleList = roles;
            String          json = StringHelper.SerializeObject <FunctionPointWithRight>(fpr);
            CustomException ce;

            HttpDataHelper.HttpPostWithInfo("BASE", "/setup/fprightset", out ce, json);
            if (ce != null)
            {
                throw ce;
            }

            this.setStatus(false);
        }