示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitColumns();//初始列
            InitData();//初始数据
            if (this.Site != null) return;

            btGdsList.Edit = DicTypeHelper.GdsDic;
            btGdsList.EditValueChanged += new EventHandler(btGdsList_EditValueChanged);
            if (MainHelper.UserOrg != null && MainHelper.UserOrg.OrgType == "1")
            {//如果是供电所人员,则锁定
                btGdsList.EditValue = MainHelper.UserOrg.OrgCode;
                btGdsList.Edit.ReadOnly = true;
            }
            RepositoryItem reItem;
            IList<DicType> dictypeList = new List<DicType>();
            int year = DateTime.Now.Year;
            for (int i = year; i > year-50; i--)
            {
                dictypeList.Add(new DicType(i.ToString(), i.ToString()));
            }
            reItem = new LookUpDicType(dictypeList);
            barsj.Edit = reItem;
        }
示例#2
0
        private void InitCombox()
        {
            string sqlxl = "select distinct xlmc from xxgx_ycjc  where rtrim(ltrim(xlmc))<>'' order by xlmc";
            string sqljhdmc = "select distinct jldmc from xxgx_ycjc  where rtrim(ltrim(jldmc))<>'' order by jldmc";
            IList<string> xlList= Client.ClientHelper.PlatformSqlMap.GetList<string>("SelectOneStr", sqlxl);
            IList<string> jhdmcList = Client.ClientHelper.PlatformSqlMap.GetList<string>("SelectOneStr", sqljhdmc);

            RepositoryItem rItemxl;
            IList<DicType> xlDicList = new List<DicType>();
            foreach (string xlmc in xlList)
            {
                xlDicList.Add(new DicType(xlmc, xlmc));
            }
            rItemxl = new LookUpDicType(xlDicList);
            barxl.Edit = rItemxl;

            RepositoryItem rItemjhdmc;
            IList<DicType> jhdDicList = new List<DicType>();
            foreach (string jhdmc in jhdmcList)
            {
                jhdDicList.Add(new DicType(jhdmc, jhdmc));
            }
            rItemjhdmc = new LookUpDicType(jhdDicList);
            barjldmc.Edit = rItemjhdmc;
        }
示例#3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitColumns();//初始列
            InitData();//初始数据
            if (this.Site != null) return;
            RepositoryItem gdsDic2=new RepositoryItem ();
            IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>(" where 1=1 order by OrgCode");
                IList<DicType> dic = new List<DicType>();
                dic.Add(new DicType("0", "所有单位"));
                foreach (mOrg gds in list)
                {
                    dic.Add(new DicType(gds.OrgCode, gds.OrgName));
                }
                gdsDic2 = new LookUpDicType(dic);
            btGdsList.Edit = gdsDic2;
            btGdsList.EditValueChanged += new EventHandler(btGdsList_EditValueChanged);
            if (MainHelper.UserOrg != null && MainHelper.UserOrg.OrgType == "1")
            {//如果是供电所人员,则锁定
                btGdsList.EditValue = MainHelper.UserOrg.OrgCode;
                btGdsList.Edit.ReadOnly = true;
            }
            repositoryItemComboBox1.Items.Clear();
            IList strlist = Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select  UserName  from mUser where   1=1");
            repositoryItemComboBox1.Items.AddRange (strlist);

        }
示例#4
0
        void btGdsList_EditValueChanged(object sender, EventArgs e)
        {
            barxl.EditValue = null;
            barxl.Edit = null;
            IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + btGdsList.EditValue + "'");
            mOrg org=null;
            if (list.Count > 0)
                org = list[0];
            if (org != null)
            {
                //frm.ParentID = org.OrgCode;
                ParentObj = org;
                if (SelectGdsChanged != null)
                    SelectGdsChanged(this, org);
                RepositoryItem gdsDic;
                IList<sd_xl> xllist = Client.ClientHelper.PlatformSqlMap.GetList<sd_xl>("where orgcode='"+org.OrgCode+"' and parentid='0'");
                IList<DicType> dic = new List<DicType>();
                foreach (sd_xl xl in xllist)
                {
                    dic.Add(new DicType(xl.LineCode,xl.LineName));
                }
                gdsDic = new LookUpDicType(dic);
                this.barxl.Edit = gdsDic;
            }
            

        }
示例#5
0
        /// <summary>
        /// 初始化列,
        /// </summary>
        public void InitColumns()
        {

            //需要隐藏列时在这写代码
            DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit linkEdit = new DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit();
            linkEdit.SingleClick = true;
            linkEdit.Click += new EventHandler(linkEdit_Click);

            DevExpress.XtraEditors.Repository.RepositoryItem colEditState;
            List<DicType> dicList = new List<DicType>();
            dicList.Add(new DicType("0", "未注册"));
            dicList.Add(new DicType("1", "已注册"));
            colEditState = new LookUpDicType(dicList);


            gridView1.Columns["c1"].Caption = "查看";
            gridView1.Columns["c1"].ColumnEdit = linkEdit;
            gridView1.Columns["device_serial"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_type"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_model"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_expire"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_desc"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_state"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_state"].ColumnEdit = colEditState;
            gridView1.Columns["device_made_date"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["software_version"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["system_version"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["last_modify"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["device_owner"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["phone_number"].OptionsColumn.AllowEdit = false;
            gridView1.Columns["sim_id"].OptionsColumn.AllowEdit = false;
            hideColumn("carrier_id");
            hideColumn("c2");
            hideColumn("c3");
        }
示例#6
0
        void btlineList_EditValueChanged(object sender, EventArgs e)
        {
            RepositoryItem sdxlvolDic;
            IList<DicType> volDicList = new List<DicType>();
            ICollection list = Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", string.Format("select distinct lineVol from sd_xl where   LineCode='{0}' ", btlineList.EditValue));
            foreach(string s in list)
            {
                volDicList.Add(new DicType(s, s));
            }
            sdxlvolDic = new LookUpDicType(volDicList);
            btLinevolList.Edit = sdxlvolDic;
            
            IList<sd_xl> xllist = Client.ClientHelper.PlatformSqlMap.GetList<sd_xl>("where LineCode='" + btlineList.EditValue + "'");
            sd_xl xl = null;
            if (list.Count > 0)
                xl = xllist[0];

            if (xl != null)
            {
                ParentObj = xl;
            }
        }
示例#7
0
        void btGdsList_EditValueChanged(object sender, EventArgs e)
        {

            RepositoryItem sdxlDic;
            IList<sd_xl> xllist = Client.ClientHelper.PlatformSqlMap.GetList<sd_xl>("where orgcode='"+btGdsList.EditValue+"'");
            IList<DicType> dic = new List<DicType>();
            foreach (sd_xl gds in xllist)
            {
                dic.Add(new DicType(gds.LineCode, gds.LineName));
            }
            sdxlDic = new LookUpDicType(dic);
            btlineList.Edit = sdxlDic;
        }