Exemple #1
0
        private void LinkDel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ImageComboBoxItem selItem = lbType.SelectedItem as ImageComboBoxItem;

            if (selItem != null)
            {
                var    drs    = _intelibType.Select("type_id=" + selItem.Value);
                string doc_id = drs[0]["doc_id"].ToString();
                if (doc_id == TmoComm.login_docInfo.doc_id.ToString())
                {
                    DXMessageBox.btnOKClick += (_sender, _e) =>
                    {
                        bool del = Tmo_FakeEntityClient.Instance.DeleteData("tmo_intervenelibtype", "type_id", selItem.Value.ToString());
                        if (del)
                        {
                            DXMessageBox.Show("干预库类型删除成功!", true);
                            _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                            TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
                        }
                    };
                    DXMessageBox.ShowQuestion(string.Format("确定要删除干预库类型【{0}】吗?", selItem.Description));
                }
                else
                {
                    DXMessageBox.ShowWarning("没有权限(非创建者)!\n创建者ID[" + doc_id + "]");
                }
            }
        }
Exemple #2
0
        private void LinkEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ImageComboBoxItem selItem = lbType.SelectedItem as ImageComboBoxItem;

            if (selItem != null)
            {
                var    drs    = _intelibType.Select("type_id=" + selItem.Value);
                string doc_id = drs[0]["doc_id"].ToString();
                if (doc_id == TmoComm.login_docInfo.doc_id.ToString())
                {
                    UCIntervenelibTypeEditor typeEditor = new UCIntervenelibTypeEditor()
                    {
                        Title = "修改干预库类型", PrimaryKeyValue = selItem.Value.ToString(), DbOperaType = DBOperateType.Update
                    };
                    if (typeEditor.ShowDialog() == DialogResult.OK)
                    {
                        DXMessageBox.Show("干预库类型修改成功!", true);
                        _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                        TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
                    }
                    typeEditor.Dispose();
                }
                else
                {
                    DXMessageBox.ShowWarning("没有权限(非创建者)!\n创建者ID[" + doc_id + "]");
                }
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            #region GridControl中特殊字段绑定
            DataTable dicDpt = Tmo_FakeEntityClient.Instance.GetData("tmo_department", new[] { "dpt_id", "dpt_name", "dpt_parent" }, "dpt_id in (" + TmoComm.login_docInfo.children_department + "," + TmoComm.login_docInfo.doc_department + ")");
            DataRow   dr1    = dicDpt.NewRow();
            dr1["dpt_id"] = -1; dr1["dpt_name"] = "无部门";
            dicDpt.Rows.Add(dr1);
            TSCommon.BindRepositoryImageComboBox(rp_doc_department, dicDpt, "dpt_name", "dpt_id");

            DataTable dicGroup   = MemoryCacheHelper.GetCacheItem <DataTable>("tmo_docgroup", () => Tmo_FakeEntityClient.Instance.GetData("tmo_docgroup", new[] { "group_id", "group_name" }, "group_level>=" + TmoComm.login_docInfo.doc_group_level), DateTime.Now.AddMinutes(5));
            DataTable dicGroupCp = dicGroup.Copy();
            DataRow   dr2        = dicGroupCp.NewRow();
            dr2["group_id"] = -1; dr2["group_name"] = "无群组";
            dicGroupCp.Rows.Add(dr2);
            TSCommon.BindRepositoryImageComboBox(rp_doc_group, dicGroupCp, "group_name", "group_id");
            #endregion

            #region 查询条件绑定
            UCTreeListSelector selCheck = new UCTreeListSelector(false);
            DataRow[]          drs      = dicDpt.Select("dpt_id=" + TmoComm.login_docInfo.doc_department);
            for (int i = 0; i < drs.Length; i++)
            {
                dicDpt.Rows.Remove(drs[i]);
            }
            selCheck.InitData(doc_department, dicDpt, "dpt_id", "dpt_parent", "dpt_name", true);

            TSCommon.BindImageComboBox(doc_group, dicGroup, "", "group_name", "group_id", true);
            #endregion

            base.OnLoad(e);
        }
Exemple #4
0
        void UCUserEditor_Load(object sender, EventArgs e)
        {
            //读取民族数据
            DataTable dicNation = MemoryCacheHelper.GetCacheItem <DataTable>("nationality", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_nationality", new[] { "code", "name" }));
            }, DateTime.Now.AddHours(24)); //由于民族数据基本不变 24小时过期

            TSCommon.BindImageComboBox(nation, dicNation, null, "name", "code", true);

            birthday.EditValue = DateTime.Now.Date;
            //绑定婚姻状况
            DataTable dicMarital = MemoryCacheHelper.GetCacheItem <DataTable>("marital", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_marital"));
            }, DateTime.Now.AddHours(24));

            TSCommon.BindImageComboBox(marital, dicMarital, null, "name", "code", true);

            //绑定省数据
            DataTable dicProvincecode = MemoryCacheHelper.GetCacheItem <DataTable>("provincecode", () => Tmo_FakeEntityClient.Instance.GetData("tmo_provincecode"), DateTime.Now.AddHours(24));

            province_id.SelectedValueChanged += (object sender0, EventArgs e0) =>
            {//绑定市数据
                city_id.Enabled = province_id.EditValue != null;
                DataTable dicCitycode = MemoryCacheHelper.GetCacheItem <DataTable>("citycode", () => Tmo_FakeEntityClient.Instance.GetData("tmo_citycode"), DateTime.Now.AddHours(24));
                TSCommon.BindImageComboBox(city_id, dicCitycode, "province_id='" + province_id.EditValue + "'", "city_name", "city_id", true);
            };
            city_id.SelectedValueChanged += (object sender0, EventArgs e0) =>
            {//绑定区数据
                eare_id.Enabled = city_id.EditValue != null;
                DataTable dicAreacode = MemoryCacheHelper.GetCacheItem <DataTable>("areacode", () => Tmo_FakeEntityClient.Instance.GetData("tmo_areacode"), DateTime.Now.AddHours(24));
                TSCommon.BindImageComboBox(eare_id, dicAreacode, "city_id='" + city_id.EditValue + "'", "area_name", "area_id", true);
            };
            TSCommon.BindImageComboBox(province_id, dicProvincecode, null, "province_name", "province_id", true);

            //绑定职业类型
            DataTable dicOccupation = MemoryCacheHelper.GetCacheItem <DataTable>("occupation", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_occupation"));
            }, DateTime.Now.AddHours(24));

            TSCommon.BindImageComboBox(occupation, dicOccupation, null, "name", "code", true);

            //绑定文化程度
            DataTable dicEducation = MemoryCacheHelper.GetCacheItem <DataTable>("education", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_education"));
            }, DateTime.Now.AddHours(24));

            TSCommon.BindImageComboBox(education, dicEducation, null, "name", "code", true);

            InitValidationRules();

            DataTable dicDpt = Tmo_FakeEntityClient.Instance.GetData("tmo_department", new[] { "dpt_id", "dpt_name", "dpt_parent" }, "dpt_id in (" + TmoComm.login_docInfo.children_department + ")");

            selCheck.InitData(dpt_id, dicDpt, "dpt_id", "dpt_parent", "dpt_name");
        }
Exemple #5
0
 private void UCInterveneEditor_Load(object sender, EventArgs e)
 {
     InitValidationRules();
     dteIntePlantime.DateTime = DateTime.Today;
     teIntePlantime.Time      = DateTime.Now;
     _intelibType             = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
     TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
     user_id_Click(null, null);
     if (DbOperaType == DBOperateType.Update || !TmoComm.login_docInfo.doc_function_list.Contains("funSaveInterveneLib"))
     {
         groupControl2.Enabled = false;
     }
 }
Exemple #6
0
        private void LinkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            UCIntervenelibTypeEditor typeEditor = new UCIntervenelibTypeEditor()
            {
                Title = "新建干预库类型", DbOperaType = DBOperateType.Add
            };

            if (typeEditor.ShowDialog() == DialogResult.OK)
            {
                DXMessageBox.Show("干预库类型创建成功!", true);
                _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
            }
            typeEditor.Dispose();
        }
Exemple #7
0
        protected override void OnLoad(EventArgs e)
        {
            #region 绑定数据
            DataTable dicDpt = Tmo_FakeEntityClient.Instance.GetData("tmo_department", new[] { "dpt_id", "dpt_name", "dpt_parent" }, "dpt_id in (" + TmoComm.login_docInfo.children_department + ")");
            selCheck.InitData(doc_department, dicDpt, "dpt_id", "dpt_parent", "dpt_name");

            DataTable dicGroup = MemoryCacheHelper.GetCacheItem <DataTable>("tmo_docgroup", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_docgroup", new[] { "group_id", "group_name" }, "group_level>=" + TmoComm.login_docInfo.doc_group_level));
            }, DateTime.Now.AddMinutes(5));
            TSCommon.BindImageComboBox(doc_group, dicGroup, "", "group_name", "group_id", true);
            #endregion
            InitValidationRules();
            //doc_loginid.ReadOnly = doc_pwd.ReadOnly = DbOperaType == DBOperateType.Update;  //登录账号和密码禁止编辑
            doc_department.ReadOnly = PrimaryKeyValue == TmoComm.login_docInfo.doc_id.ToString();
            base.OnLoad(e);
        }
        private void FrmPushMsg_Load(object sender, EventArgs e)
        {
            string codeVal = Tmo_FakeEntityClient.Instance.GetData("tmo_docinfo", new[] { "doc_department" }, null, "doc_id", TmoComm.login_docInfo.doc_id.ToString()).Rows[0][0].ToString();

            children = Tmo_CommonClient.Instance.GetChildrenNodeFromTable("tmo_department", "dpt_id", "dpt_parent", codeVal);
            //Where = fixWhere = string.Format(" doc_department in ({0}) ", children);
            //fixWhere += " and ";
            #region GridControl中特殊字段绑定
            DataTable dicDpt = Tmo_FakeEntityClient.Instance.GetData("tmo_department", new[] { "dpt_id", "dpt_name", "dpt_parent" }, "dpt_id in (" + children + ")");
            DataRow   dr1    = dicDpt.NewRow();
            dr1["dpt_id"] = -1; dr1["dpt_name"] = "无部门";
            dicDpt.Rows.Add(dr1);

            DataTable dicGroup = MemoryCacheHelper.GetCacheItem <DataTable>("tmo_docgroup", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_docgroup", new[] { "group_id", "group_name" }));
            }, DateTime.Now.AddMinutes(5));
            DataRow dr2 = dicGroup.NewRow();
            dr2["group_id"] = -1; dr2["group_name"] = "无群组";
            dicGroup.Rows.Add(dr2);
            DataTable dicdocs = MemoryCacheHelper.GetCacheItem <DataTable>("tmo_docinfo", () =>
            {
                return(Tmo_FakeEntityClient.Instance.GetData("tmo_docinfo", new[] { "doc_loginid", "doc_name" }));
            }, DateTime.Now.AddMinutes(5));
            DataRow dr3 = dicdocs.NewRow();
            dr3["doc_loginid"] = -1; dr3["doc_name"] = "请选择..";
            dicdocs.Rows.Add(dr3);
            #endregion

            #region 查询条件绑定
            UCTreeListSelector selCheck = new UCTreeListSelector(false);
            selCheck.InitData(doc_department, dicDpt, "dpt_id", "dpt_parent", "dpt_name", true);

            TSCommon.BindImageComboBox(doc_group, dicGroup, "", "group_name", "group_id", true);
            TSCommon.BindImageComboBox(docinfo, dicdocs, "", "doc_name", "doc_loginid", true);
            #endregion
        }
 private void UCInterveneLibEditor_Load(object sender, EventArgs e)
 {
     InitValidationRules();
     _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
     TSCommon.BindImageComboBox(intelb_type, _intelibType, null, "type_name", "type_id");
 }
Exemple #10
0
        protected override void OnFirstLoad()
        {
            #region GridControl中特殊字段绑定

            //读取民族数据
            DataTable dicNation = MemoryCacheHelper.GetCacheItem <DataTable>("nationality",
                                                                             () => { return(Tmo_FakeEntityClient.Instance.GetData("tmo_nationality", new[] { "code", "name" })); },
                                                                             DateTime.Now.AddHours(24)); //由于民族数据基本不变 24小时过期
            TSCommon.BindRepositoryImageComboBox(rp_nation, dicNation, "name", "code");
            //绑定职业类型
            DataTable dicOccupation = MemoryCacheHelper.GetCacheItem <DataTable>("occupation",
                                                                                 () => { return(Tmo_FakeEntityClient.Instance.GetData("tmo_occupation")); }, DateTime.Now.AddHours(24));
            TSCommon.BindRepositoryImageComboBox(rp_occupagtion, dicOccupation, "name", "code");
            //绑定文化程度
            DataTable dicEducation = MemoryCacheHelper.GetCacheItem <DataTable>("education",
                                                                                () => { return(Tmo_FakeEntityClient.Instance.GetData("tmo_education")); }, DateTime.Now.AddHours(24));
            TSCommon.BindRepositoryImageComboBox(rp_education, dicEducation, "name", "code");
            //绑定婚姻状况
            DataTable dicMarital = MemoryCacheHelper.GetCacheItem <DataTable>("marital", () => { return(Tmo_FakeEntityClient.Instance.GetData("tmo_marital")); },
                                                                              DateTime.Now.AddHours(24));
            TSCommon.BindRepositoryImageComboBox(rp_marital, dicMarital, "name", "code");

            #endregion

            #region 查询条件绑定

            //绑定省数据
            DataTable dicProvincecode = MemoryCacheHelper.GetCacheItem <DataTable>("provincecode",
                                                                                   () => Tmo_FakeEntityClient.Instance.GetData("tmo_provincecode"), DateTime.Now.AddHours(24));
            province_id.SelectedValueChanged += (object sender0, EventArgs e0) =>
            {
                //绑定市数据
                city_id.Enabled = province_id.EditValue != null;
                DataTable dicCitycode = MemoryCacheHelper.GetCacheItem <DataTable>("citycode", () => Tmo_FakeEntityClient.Instance.GetData("tmo_citycode"),
                                                                                   DateTime.Now.AddHours(24));
                TSCommon.BindImageComboBox(city_id, dicCitycode, "province_id='" + province_id.EditValue + "'", "city_name", "city_id", true);
            };
            city_id.SelectedValueChanged += (object sender0, EventArgs e0) =>
            {
                //绑定区数据
                eare_id.Enabled = city_id.EditValue != null;
                DataTable dicAreacode = MemoryCacheHelper.GetCacheItem <DataTable>("areacode", () => Tmo_FakeEntityClient.Instance.GetData("tmo_areacode"),
                                                                                   DateTime.Now.AddHours(24));
                TSCommon.BindImageComboBox(eare_id, dicAreacode, "city_id='" + city_id.EditValue + "'", "area_name", "area_id", true);
            };
            TSCommon.BindImageComboBox(province_id, dicProvincecode, null, "province_name", "province_id", true);

            dteBirthdayBegin.DateTime  = TmoShare.TodayBegin;
            dteBirthdayEnd.DateTime    = TmoShare.TodayEnd;
            dteInputTimeBegin.DateTime = TmoShare.TodayBegin;
            dteInputTimeEnd.DateTime   = TmoShare.TodayEnd;
            ckInputTime_CheckedChanged(null, null);
            ckBirthday_CheckedChanged(null, null);

            #endregion

            DataTable dicDpt = Tmo_FakeEntityClient.Instance.GetData("tmo_department", new[] { "dpt_id", "dpt_name", "dpt_parent" },
                                                                     "dpt_id in (" + TmoComm.login_docInfo.children_department + ")");
            selCheck.InitData(dpt_id, dicDpt, "dpt_id", "dpt_parent", "dpt_name", true);

            base.OnFirstLoad();
        }