示例#1
0
        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", () =>
            {
                return(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);
        }
示例#2
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");
        }
示例#3
0
        public UCGroupEditor()
        {
            InitializeComponent();
            TableName  = "tmo_docgroup";
            PrimaryKey = "group_id";

            DataTable dt = Tmo_FakeEntityClient.Instance.GetData("tmo_function");

            sel.InitData(group_function, dt, "func_id", "func_parent", "func_description", true);
        }
示例#4
0
        public UCDepartmentEditor()
        {
            InitializeComponent();
            TableName  = "tmo_department";
            PrimaryKey = "dpt_id";

            dtSel = 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 + ")");
            if (dtSel == null)
            {
                dtSel = Tmo_FakeEntityClient.Instance.GetTableStruct("tmo_department");
            }
            DataRow dr = dtSel.NewRow();

            sel.InitData(dpt_parent, dtSel, "dpt_id", "dpt_parent", "dpt_name");
        }
示例#5
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);
        }
示例#6
0
        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
        }
示例#7
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();
        }