Ejemplo n.º 1
0
        /// <summary>
        /// 获取原始表单控件信息
        /// </summary>
        /// <param name="qnCtlFiledId"></param>
        /// <returns></returns>
        public List <EntityCtrlLocation> GetQnCtrlLocation(string qnCtlFiledId, decimal qnId)
        {
            if (string.IsNullOrEmpty(qnCtlFiledId))
            {
                return(null);
            }
            List <EntityCtrlLocation> data = null;

            SqlHelper svc = new SqlHelper(EnumBiz.onlineDB);
            string    Sql = string.Empty;

            Sql = @"select * from dicQnCtlLocation a where a.qnCtlFiledId = ? and a.qnId = ?";
            IDataParameter[] param = svc.CreateParm(2);
            param[0].Value = qnCtlFiledId;
            param[1].Value = qnId;
            DataTable dt = svc.GetDataTable(Sql, param);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityCtrlLocation>();
                EntityCtrlLocation vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    string      xml = dr["xmlData"].ToString();
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(xml);
                    XmlNodeList nodelist = doc["eflayout"].GetElementsByTagName("ctrl");
                    if (nodelist != null && nodelist.Count > 0)
                    {
                        foreach (XmlNode node in nodelist)
                        {
                            vo           = new EntityCtrlLocation();
                            vo.name      = node.Attributes["ctrlname"].Value;
                            vo.text      = node.Attributes["ctrlText"].Value;
                            vo.width     = Function.Int(node.Attributes["width"].Value);
                            vo.height    = Function.Int(node.Attributes["height"].Value);
                            vo.locationX = Function.Int(node.Attributes["locationX"].Value);
                            vo.locationY = Function.Int(node.Attributes["locationY"].Value);
                            string type = node.Attributes["ctrltype"].Value;
                            if (type.Contains("LabelControl"))
                            {
                                vo.type = 1;
                            }
                            if (type.Contains("CheckEdit"))
                            {
                                vo.type = 2;
                            }

                            data.Add(vo);
                        }
                    }
                }
            }
            return(data.OrderBy(r => r.name).ToList());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// AddQuestCtrl
        /// </summary>
        void AddQuestCtrl(EntityQnRecord qnRecord)
        {
            try
            {
                if (qnRecord != null)
                {
                    if (!string.IsNullOrEmpty(qnRecord.xmlData))
                    {
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(qnRecord.xmlData);
                        XmlNodeList list = document["FormData"].ChildNodes;
                        xmlData = list[9].OuterXml;
                        dicData = Function.ReadXML(xmlData);
                    }
                }
                using (ProxyHms proxy = new ProxyHms())
                {
                    lstCtrlLocation = proxy.Service.GetQnCtrlLocation(lstQuest[8], qnRecord.qnId);
                    lstTopic        = new List <EntityDicQnSetting>();
                    lstItems        = new List <EntityDicQnSetting>();
                    proxy.Service.GetQnCustom(1, out lstTopic, out lstItems);
                }

                int locationX = 0;
                int locationY = 0;

                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        if (clVo.name.Contains("FM"))
                        {
                            DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                            lblTopic.Name = clVo.name;
                            lblTopic.Text = clVo.text;
                            if (clVo.name == "FM0902" || clVo.name == "FM0903")
                            {
                                lblTopic.Font      = new System.Drawing.Font("宋体", 9.5F);
                                lblTopic.ForeColor = System.Drawing.Color.Red;
                                lblTopic.WidthF    = clVo.width + 10;
                            }
                            else
                            {
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                            }
                            locationX         = clVo.locationX;
                            locationY         = clVo.locationY;
                            lblTopic.WidthF   = clVo.width;
                            lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                            this.Detail.Controls.Add(lblTopic);
                        }
                    }
                }

                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];
                        if (item.questName == lstQuest[8])
                        {
                            if (string.IsNullOrEmpty(item.parentFieldId))
                            {
                                DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                                lblTopic.Name = item.fieldId;
                                lblTopic.Text = item.fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.Find(r => r.name == item.fieldId);
                                locationX       = ctrLocat.locationX;
                                locationY       = ctrLocat.locationY;
                                lblTopic.WidthF = ctrLocat.width;
                                //lblTopic.HeightF = ctrLocat.height;
                                lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                                this.Detail.Controls.Add(lblTopic);

                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == item.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        if (childVo.typeId != "3")
                                        {
                                            DevExpress.XtraReports.UI.XRCheckBox chkAns = new DevExpress.XtraReports.UI.XRCheckBox();
                                            string strEndWith = childVo.fieldId.Substring(4, 2);
                                            chkAns.Text = childVo.fieldName;
                                            chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                            chkAns.Name = childVo.fieldId;
                                            EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                            locationX    = ctrLocatChild.locationX;
                                            locationY    = ctrLocatChild.locationY;
                                            chkAns.Width = ctrLocatChild.width;
                                            //chkAns.Height = ctrLocatChild.height;
                                            chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                            if (dicData.ContainsKey(childVo.fieldId))
                                            {
                                                string value = dicData[childVo.fieldId];
                                                chkAns.Checked = value == "0" ? false : true;
                                            }
                                            this.Detail.Controls.Add(chkAns);
                                        }
                                        else
                                        {
                                            DevExpress.XtraReports.UI.XRLabel txtAns = new DevExpress.XtraReports.UI.XRLabel();
                                            string strEndWith = childVo.fieldId.Substring(4, 2);
                                            txtAns.Text = childVo.fieldName;
                                            txtAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                            txtAns.Name = childVo.fieldId;
                                            EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                            locationX    = ctrLocatChild.locationX;
                                            locationY    = ctrLocatChild.locationY;
                                            txtAns.Width = ctrLocatChild.width;
                                            //txtAns.Height = ctrLocatChild.height;
                                            txtAns.Location = new System.Drawing.Point(locationX, locationY);
                                            if (dicData.ContainsKey(childVo.fieldId))
                                            {
                                                string value = dicData[childVo.fieldId];
                                                txtAns.Text = value;
                                            }
                                            this.Detail.Controls.Add(txtAns);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.OutPutException(ex);
            }
            finally
            {
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// AddQuestCtrl
        /// </summary>
        void AddQuestCtrl(EntityQnRecord qnRecord)
        {
            try
            {
                if (qnRecord != null)
                {
                    if (!string.IsNullOrEmpty(qnRecord.xmlData))
                    {
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(qnRecord.xmlData);
                        XmlNodeList list = document["FormData"].ChildNodes;
                        xmlData = list[1].OuterXml;
                        dicData = Function.ReadXML(xmlData);
                    }
                }
                using (Biz202 biz = new Biz202())
                {
                    lstCtrlLocation = biz.GetQnCtrlLocation(lstQuest[1]);
                }

                using (Biz209 biz = new Biz209())
                {
                    lstTopic = new List <EntityDicQnSetting>();
                    lstItems = new List <EntityDicQnSetting>();
                    biz.GetQnCustom(1, out lstTopic, out lstItems);
                }
                int locationX = 0;
                int locationY = 0;

                int F35Count = 0;
                int F35Row   = (lstTopic.FindAll(r => r.fieldId.Contains("F035")).Count) / 6;
                int F35Y     = 0;
                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];
                        if (item.questName == lstQuest[1])
                        {
                            if (item.fieldId.Contains("F035"))
                            {
                                DevExpress.XtraReports.UI.XRCheckBox chkAns = new DevExpress.XtraReports.UI.XRCheckBox();
                                chkAns.Text = item.fieldName;
                                chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                chkAns.Name = item.fieldId;
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.FindAll(r => r.name.Contains("F035"))[F35Count];
                                locationX       = ctrLocat.locationX;
                                locationY       = ctrLocat.locationY;
                                F35Y           += locationY;
                                chkAns.Width    = ctrLocat.width;
                                chkAns.Height   = ctrLocat.height;
                                chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                if (dicData.ContainsKey(item.fieldId))
                                {
                                    string value = dicData[item.fieldId];
                                    chkAns.Checked = value == "0" ? false : true;
                                }
                                this.Detail.Controls.Add(chkAns);
                                F35Count++;
                            }
                        }
                    }
                    F35Y -= 80;
                    for (int i2 = 0; i2 < lstTopic.Count; i2++)
                    {
                        EntityDicQnSetting itemVo = lstTopic[i2];
                        if (itemVo.questName == lstQuest[1])
                        {
                            if (string.IsNullOrEmpty(itemVo.parentFieldId) && !itemVo.fieldId.Contains("F035"))
                            {
                                DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                                lblTopic.Name = itemVo.fieldId;
                                lblTopic.Text = itemVo.fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.Find(r => r.name == itemVo.fieldId);
                                locationX         = ctrLocat.locationX;
                                locationY         = ctrLocat.locationY - F35Y;
                                lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                                this.Detail.Controls.Add(lblTopic);

                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == itemVo.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        DevExpress.XtraReports.UI.XRCheckBox chkAns = new DevExpress.XtraReports.UI.XRCheckBox();
                                        string strEndWith = childVo.fieldId.Substring(4, 2);
                                        chkAns.Text = childVo.fieldName;
                                        chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                        chkAns.Name = childVo.fieldId;
                                        EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                        locationX       = ctrLocatChild.locationX;
                                        locationY       = ctrLocatChild.locationY - F35Y;
                                        chkAns.Width    = ctrLocatChild.width;
                                        chkAns.Height   = ctrLocatChild.height;
                                        chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                        if (dicData.ContainsKey(childVo.fieldId))
                                        {
                                            string value = dicData[childVo.fieldId];
                                            chkAns.Checked = value == "0" ? false : true;
                                        }
                                        this.Detail.Controls.Add(chkAns);
                                    }
                                }
                            }
                        }
                    }
                }

                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                        lblTopic.Name = clVo.name;
                        lblTopic.Text = clVo.text;
                        lblTopic.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                        locationX     = clVo.locationX;
                        if (clVo.name == "FM0201")
                        {
                            locationY = clVo.locationY;
                        }
                        else if (clVo.name.Contains("FM"))
                        {
                            locationY = clVo.locationY - F35Y;
                        }
                        else
                        {
                            continue;
                        }

                        lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                        this.Detail.Controls.Add(lblTopic);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.OutPutException(ex);
            }
            finally
            {
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// InitComponent
        /// </summary>
        public void InitComponent()
        {
            this.SuspendLayout();
            lstCheck.Clear();
            using (ProxyHms proxy = new ProxyHms())
            {
                lstCtrlLocation = proxy.Service.GetQnCtrlLocation(lstQuest[idx], qnId);
            }

            using (ProxyHms proxy = new ProxyHms())
            {
                lstTopic = new List <EntityDicQnSetting>();
                lstItems = new List <EntityDicQnSetting>();
                proxy.Service.GetQnCustom(qnId, out lstTopic, out lstItems);
            }
            int locationX = 0;
            int locationY = 0;

            #region quest01
            if (idx == 0)
            {
                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        if (clVo.name.Contains("FT"))
                        {
                            DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                            lblTopic.Name     = clVo.name;
                            lblTopic.Text     = clVo.text;
                            lblTopic.Font     = new System.Drawing.Font("宋体", 9.5F);
                            locationX         = clVo.locationX;
                            locationY         = clVo.locationY;
                            lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                            this.plUserCtrl.Controls.Add(lblTopic);
                        }
                        if (clVo.name.Contains("FM"))
                        {
                            DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                            lblTopic.Name     = clVo.name;
                            lblTopic.Text     = clVo.text;
                            lblTopic.Font     = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                            locationX         = clVo.locationX;
                            locationY         = clVo.locationY;
                            lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                            this.plUserCtrl.Controls.Add(lblTopic);
                        }
                    }
                }
                int parentCount = 0;
                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    List <EntityCtrlLocation> lstCtrlLocation2 = lstCtrlLocation.FindAll(r => r.type == 1 && !(r.name.Contains("FM") || r.name.Contains("FT")));
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];

                        #region quest01
                        if (item.questName == "quest01")
                        {
                            if (string.IsNullOrEmpty(item.parentFieldId))
                            {
                                DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                                lblTopic.Name = item.fieldId;
                                lblTopic.Text = lstTopic.Find(r => r.fieldId == item.fieldId).fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation2[parentCount];
                                locationX         = ctrLocat.locationX;
                                locationY         = ctrLocat.locationY;
                                lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                                this.plUserCtrl.Controls.Add(lblTopic);

                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == item.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        DevExpress.XtraEditors.CheckEdit chkAns = new DevExpress.XtraEditors.CheckEdit();
                                        string strEndWith = childVo.fieldId.Substring(4, 2);
                                        chkAns.Text = "";
                                        chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                        chkAns.Name = childVo.fieldId;
                                        chkAns.Properties.AccessibleName = childVo.fieldId;
                                        EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name.Contains(ctrLocat.name) && r.type == 2 && r.name.EndsWith(strEndWith));
                                        locationX       = ctrLocatChild.locationX;
                                        locationY       = ctrLocatChild.locationY;
                                        chkAns.Width    = ctrLocatChild.width;
                                        chkAns.Height   = ctrLocatChild.height;
                                        chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                        this.plUserCtrl.Controls.Add(chkAns);
                                    }
                                    parentCount++;
                                }
                            }
                        }
                        #endregion
                    }
                }
                this.plUserCtrl.Height = 680;
                this.plContent.Height  = (this.plUserCtrl.Height + 200);
            }
            #endregion

            #region quest02
            if (idx == 1)
            {
                int F35Count = 0;
                int F35Row   = (lstTopic.FindAll(r => r.fieldId.Contains("F035")).Count) / 6;
                int F35Y     = 0;
                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];
                        if (item.questName == lstQuest[idx])
                        {
                            if (item.fieldId.Contains("F035"))
                            {
                                DevExpress.XtraEditors.CheckEdit chkAns = new DevExpress.XtraEditors.CheckEdit();
                                chkAns.Text = item.fieldName;
                                chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                chkAns.Name = item.fieldId;
                                chkAns.Properties.AccessibleName = item.fieldId;
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.FindAll(r => r.name.Contains("F035"))[F35Count];
                                locationX       = ctrLocat.locationX;
                                locationY       = ctrLocat.locationY;
                                F35Y           += locationY;
                                chkAns.Width    = ctrLocat.width;
                                chkAns.Height   = ctrLocat.height;
                                chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                this.plUserCtrl.Controls.Add(chkAns);
                                F35Count++;
                            }
                        }
                    }

                    for (int i2 = 0; i2 < lstTopic.Count; i2++)
                    {
                        EntityDicQnSetting itemVo = lstTopic[i2];
                        if (itemVo.questName == lstQuest[idx])
                        {
                            if (string.IsNullOrEmpty(itemVo.parentFieldId) && !itemVo.fieldId.Contains("F035"))
                            {
                                DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                                lblTopic.Name = itemVo.fieldId;
                                lblTopic.Text = itemVo.fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.Find(r => r.name == itemVo.fieldId);
                                locationX         = ctrLocat.locationX;
                                locationY         = ctrLocat.locationY - F35Y + 80;
                                lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                                this.plUserCtrl.Controls.Add(lblTopic);

                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == itemVo.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        DevExpress.XtraEditors.CheckEdit chkAns = new DevExpress.XtraEditors.CheckEdit();
                                        string strEndWith = childVo.fieldId.Substring(4, 2);
                                        chkAns.Text = childVo.fieldName;
                                        chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                        chkAns.Name = childVo.fieldId;
                                        chkAns.Properties.AccessibleName = childVo.fieldId;
                                        EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                        locationX       = ctrLocatChild.locationX;
                                        locationY       = ctrLocatChild.locationY - F35Y + 80;
                                        chkAns.Width    = ctrLocatChild.width;
                                        chkAns.Height   = ctrLocatChild.height;
                                        chkAns.Location = new System.Drawing.Point(locationX, locationY);
                                        this.plUserCtrl.Controls.Add(chkAns);
                                    }
                                }
                            }
                        }
                    }
                }

                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                        lblTopic.Name = clVo.name;
                        lblTopic.Text = clVo.text;
                        lblTopic.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                        locationX     = clVo.locationX;
                        if (clVo.name == "FM0201")
                        {
                            locationY = clVo.locationY;
                        }
                        else if (clVo.name.Contains("FM"))
                        {
                            locationY = clVo.locationY - F35Y + 80;
                        }
                        else
                        {
                            continue;
                        }

                        lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                        this.plUserCtrl.Controls.Add(lblTopic);
                    }
                }

                this.plUserCtrl.Height = 1000;
                this.plContent.Height  = (this.plUserCtrl.Height + 200);
            }

            #endregion

            #region quest03  quest04 quest05 quest06 quest07 quest08 quest09 quest10
            if (idx == 2 || idx == 3 || idx == 4 || idx == 5 || idx == 6 || idx == 7 || idx == 8 || idx == 9)
            {
                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        if (clVo.name.Contains("FM"))
                        {
                            DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                            lblTopic.Name = clVo.name;
                            lblTopic.Text = clVo.text;
                            if (clVo.name == "FM0902" || clVo.name == "FM0903")
                            {
                                lblTopic.Font      = new System.Drawing.Font("宋体", 9.5F);
                                lblTopic.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                            }
                            locationX         = clVo.locationX;
                            locationY         = clVo.locationY;
                            lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                            this.plUserCtrl.Controls.Add(lblTopic);
                        }
                    }
                }

                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];
                        if (item.questName == lstQuest[idx])
                        {
                            if (string.IsNullOrEmpty(item.parentFieldId))
                            {
                                DevExpress.XtraEditors.LabelControl lblTopic = new DevExpress.XtraEditors.LabelControl();
                                lblTopic.Name = item.fieldId;
                                lblTopic.Text = item.fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.Find(r => r.name == item.fieldId);
                                locationX         = ctrLocat.locationX;
                                locationY         = ctrLocat.locationY;
                                lblTopic.Location = new System.Drawing.Point(locationX, locationY);
                                this.plUserCtrl.Controls.Add(lblTopic);

                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == item.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        if (childVo.typeId != "3")
                                        {
                                            DevExpress.XtraEditors.CheckEdit chkAns = new DevExpress.XtraEditors.CheckEdit();
                                            string strEndWith = childVo.fieldId.Substring(4, 2);
                                            chkAns.Text = childVo.fieldName;
                                            chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                            chkAns.Name = childVo.fieldId;
                                            chkAns.Properties.AccessibleName = childVo.fieldId;
                                            EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                            locationX              = ctrLocatChild.locationX;
                                            locationY              = ctrLocatChild.locationY;
                                            chkAns.Width           = ctrLocatChild.width;
                                            chkAns.Height          = ctrLocatChild.height;
                                            chkAns.Location        = new System.Drawing.Point(locationX, locationY);
                                            chkAns.CheckedChanged += new EventHandler(iChk_CheckedChanged);
                                            if (!string.IsNullOrEmpty(childVo.parentFieldId) && item.typeId == "1")
                                            {
                                                chkAns.Properties.AccessibleName = childVo.parentFieldId;
                                                lstCheck.Add(chkAns);
                                            }
                                            this.plUserCtrl.Controls.Add(chkAns);
                                        }
                                        else
                                        {
                                            DevExpress.XtraEditors.TextEdit txtAns = new DevExpress.XtraEditors.TextEdit();
                                            string strEndWith = childVo.fieldId.Substring(4, 2);
                                            txtAns.Text = childVo.fieldName;
                                            txtAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                            txtAns.Name = childVo.fieldId;
                                            txtAns.Properties.AccessibleName = childVo.fieldId;
                                            EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name == childVo.fieldId);
                                            locationX       = ctrLocatChild.locationX;
                                            locationY       = ctrLocatChild.locationY;
                                            txtAns.Width    = ctrLocatChild.width;
                                            txtAns.Height   = ctrLocatChild.height;
                                            txtAns.Location = new System.Drawing.Point(locationX, locationY);
                                            this.plUserCtrl.Controls.Add(txtAns);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                this.plUserCtrl.Height = 2000;
                this.plContent.Height  = (this.plUserCtrl.Height + 200);
            }
            #endregion

            this.ResumeLayout();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// AddQuestCtrl
        /// </summary>
        void AddQuestCtrl(EntityQnRecord qnRecord)
        {
            try
            {
                if (qnRecord != null)
                {
                    if (!string.IsNullOrEmpty(qnRecord.xmlData))
                    {
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(qnRecord.xmlData);
                        XmlNodeList list = document["FormData"].ChildNodes;
                        xmlData = list[1].OuterXml;
                        dicData = Function.ReadXML(xmlData);
                    }
                }
                using (ProxyHms proxy = new ProxyHms())
                {
                    lstCtrlLocation = proxy.Service.GetQnCtrlLocation(lstQuest[0], qnRecord.qnId);
                }

                using (ProxyHms proxy = new ProxyHms())
                {
                    lstTopic = new List <EntityDicQnSetting>();
                    lstItems = new List <EntityDicQnSetting>();
                    proxy.Service.GetQnCustom(1, out lstTopic, out lstItems);
                }
                int locationX = 0;
                int locationY = 0;

                if (lstCtrlLocation != null && lstCtrlLocation.Count > 0)
                {
                    foreach (var clVo in lstCtrlLocation)
                    {
                        if (clVo.name.Contains("FT"))
                        {
                            DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                            lblTopic.Name          = clVo.name;
                            lblTopic.Text          = clVo.text;
                            lblTopic.Font          = new System.Drawing.Font("宋体", 9.5F);
                            locationX              = clVo.locationX;
                            locationY              = clVo.locationY;
                            lblTopic.LocationFloat = new DevExpress.Utils.PointFloat(locationX, locationY);
                            this.Detail.Controls.Add(lblTopic);
                        }
                        if (clVo.name.Contains("FM"))
                        {
                            DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                            lblTopic.Name          = clVo.name;
                            lblTopic.Text          = clVo.text;
                            lblTopic.Font          = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold);
                            locationX              = clVo.locationX;
                            locationY              = clVo.locationY;
                            lblTopic.LocationFloat = new DevExpress.Utils.PointFloat(locationX, locationY);
                            this.Detail.Controls.Add(lblTopic);
                        }
                    }
                }
                int parentCount = 0;
                List <EntityDicQnSetting> lstChildSettings = new List <EntityDicQnSetting>();
                if (lstTopic != null && lstTopic.Count > 0)
                {
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        EntityDicQnSetting item = lstTopic[i];
                        if (item.questName == lstQuest[0])
                        {
                            if (string.IsNullOrEmpty(item.parentFieldId))
                            {
                                DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                                lblTopic.Name = item.fieldId;
                                lblTopic.Text = lstTopic.Find(r => r.fieldId == item.fieldId).fieldName;
                                lblTopic.Font = new System.Drawing.Font("宋体", 9.5F);
                                EntityCtrlLocation ctrLocat = lstCtrlLocation.FindAll(r => r.type == 1)[parentCount];
                                locationX = ctrLocat.locationX;
                                locationY = ctrLocat.locationY;
                                lblTopic.LocationFloat = new DevExpress.Utils.PointFloat(locationX, locationY);
                                this.Detail.Controls.Add(lblTopic);
                                lstChildSettings = lstTopic.FindAll(r => r.parentFieldId == item.fieldId);
                                if (lstChildSettings.Count > 0)
                                {
                                    foreach (var childVo in lstChildSettings)
                                    {
                                        DevExpress.XtraReports.UI.XRCheckBox chkAns = new DevExpress.XtraReports.UI.XRCheckBox();
                                        string strEndWith = childVo.fieldId.Substring(4, 2);
                                        chkAns.Text = "";
                                        chkAns.Font = new System.Drawing.Font("宋体", 9.5F);
                                        chkAns.Name = childVo.fieldId;
                                        EntityCtrlLocation ctrLocatChild = lstCtrlLocation.Find(r => r.name.Contains(ctrLocat.name) && r.type == 2 && r.name.EndsWith(strEndWith));
                                        locationX            = ctrLocatChild.locationX;
                                        locationY            = ctrLocatChild.locationY;
                                        chkAns.Dpi           = 100F;
                                        chkAns.LocationFloat = new DevExpress.Utils.PointFloat(locationX, locationY);
                                        chkAns.SizeF         = new System.Drawing.SizeF(15.625F, 23F);
                                        if (dicData.ContainsKey(childVo.fieldId))
                                        {
                                            string value = dicData[childVo.fieldId];
                                            chkAns.Checked = value == "0" ? false : true;
                                        }

                                        this.Detail.Controls.Add(chkAns);
                                    }
                                }
                                parentCount++;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.OutPutException(ex);
            }
            finally
            {
            }
        }