Beispiel #1
0
 /// <summary>
 /// 常规问卷--保存
 /// </summary>
 /// <param name="qnRecord"></param>
 /// <param name="qnData"></param>
 /// <param name="recId"></param>
 /// <returns></returns>
 public int SaveQnRecord(EntityQnRecord qnRecord, EntityQnData qnData, out decimal recId)
 {
     using (Biz202 biz = new Biz202())
     {
         return(biz.SaveQnRecord(qnRecord, qnData, out recId));
     }
 }
Beispiel #2
0
        private void ribtnOpen_Click(object sender, EventArgs e)
        {
            if (this.gridView.FocusedRowHandle >= 0)
            {
                qnRecord = this.gridView.GetRow(this.gridView.FocusedRowHandle) as EntityQnRecord;
            }
            frmPopup2020201 frm = new frmPopup2020201(qnRecord);

            frm.ShowDialog();
        }
Beispiel #3
0
        private void gridView_DoubleClick(object sender, EventArgs e)
        {
            if (this.gridView.FocusedRowHandle >= 0)
            {
                qnRecord = this.gridView.GetRow(this.gridView.FocusedRowHandle) as EntityQnRecord;
                isSelect = true;
            }

            this.Close();
        }
Beispiel #4
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;
                 string      xmlData = list[0].OuterXml;
                 dicData         = Function.ReadXML(xmlData);
                 ClientName.Text = dicData[ClientName.Name];
                 //BirthPlace.Text = dicData[BirthPlace.Name];
                 Company.Text       = dicData[Company.Name];
                 Telephone.Text     = dicData[Telephone.Name];
                 YearIncom.Text     = dicData[YearIncom.Name];
                 ConnectPhone.Text  = dicData[ConnectPhone.Name];
                 ClientName.Text    = dicData[ClientName.Name];
                 Sex.Text           = dicData[Sex.Name];
                 Mobile.Text        = dicData[Mobile.Name];
                 YbType.Text        = dicData[YbType.Name];
                 ConnectName.Text   = dicData[ConnectName.Name];
                 BooldType.Text     = dicData[BooldType.Name];
                 Rh.Text            = dicData[Rh.Name];
                 Job.Text           = dicData[Job.Name];
                 EhtnicGroup.Text   = dicData[EhtnicGroup.Name];
                 QuestDate.Text     = dicData[QuestDate.Name];
                 Marriage.Text      = dicData[Marriage.Name];
                 Birthday.Text      = dicData[Birthday.Name];
                 EduationLevel.Text = dicData[EduationLevel.Name];
                 Religious.Text     = dicData[Religious.Name];
                 IdCard.Text        = dicData[IdCard.Name];
                 Address.Text       = dicData[Address.Name];
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionLog.OutPutException(ex);
     }
     finally
     {
     }
 }
Beispiel #5
0
 /// <summary>
 /// 编辑
 /// </summary>
 public override void Edit()
 {
     if (this.gvQnRecord.SelectedRowsCount > 0)
     {
         EntityQnRecord  vo  = this.gvQnRecord.GetRow(this.gvQnRecord.GetSelectedRows()[0]) as EntityQnRecord;
         frmPopup2020702 frm = new frmPopup2020702(vo);
         frm.ShowDialog();
         if (frm.IsRequireRefresh)
         {
             this.RefreshData();
         }
     }
     else
     {
         DialogBox.Msg("请选择要编辑的记录.");
     }
 }
Beispiel #6
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
            {
            }
        }
Beispiel #7
0
 public xrptQuest09(EntityQnRecord qnRecord)
 {
     InitializeComponent();
     AddQuestCtrl(qnRecord);
 }
Beispiel #8
0
 public frmPopup2020202(EntityQnRecord _qnVo = null)
 {
     InitializeComponent();
     qnVo = _qnVo;
 }
Beispiel #9
0
        /// <summary>
        /// 常规问卷-保存
        /// </summary>
        /// <param name="sfData"></param>
        /// <param name="sfId"></param>
        /// <returns></returns>
        public int SaveQnRecord(EntityQnRecord qnRecord, EntityQnData qnData, out decimal recId)
        {
            int affectRows = 0;

            recId = 0;
            string    Sql = string.Empty;
            SqlHelper svc = null;

            try
            {
                List <DacParm> lstParm = new List <DacParm>();
                svc = new SqlHelper(EnumBiz.onlineDB);
                if (qnRecord.recId <= 0)
                {
                    recId               = svc.GetNextID("qnRecord", "recId");
                    qnRecord.recId      = recId;
                    qnRecord.recorder   = "00";
                    qnRecord.recordDate = DateTime.Now;
                    qnRecord.status     = 0;
                    qnData.recId        = recId;

                    lstParm.Add(svc.GetInsertParm(qnRecord));
                    lstParm.Add(svc.GetInsertParm(qnData));
                }
                else
                {
                    recId = qnRecord.recId;
                    lstParm.Add(svc.GetUpdateParm(qnRecord,
                                                  new List <string> {
                        EntityQnRecord.Columns.clientNo,
                        EntityQnRecord.Columns.qnType,
                        EntityQnRecord.Columns.qnSource
                    },
                                                  new List <string> {
                        EntityQnRecord.Columns.recId
                    }));
                    lstParm.Add(svc.GetUpdateParm(qnData,
                                                  new List <string> {
                        EntityQnData.Columns.xmlData
                    },
                                                  new List <string> {
                        EntityQnData.Columns.recId
                    }));
                }

                if (lstParm.Count > 0)
                {
                    affectRows = svc.Commit(lstParm);
                }
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Beispiel #10
0
 public xrptCustomQn(EntityQnRecord qnVo)
 {
     InitializeComponent();
     InitComponent(qnVo);
 }
Beispiel #11
0
 public frmPopup2020201(EntityQnRecord _qnRecordVo)
 {
     InitializeComponent();
     this.qnRecordVo = _qnRecordVo;
 }
Beispiel #12
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="_qnVo"></param>
 public frmPopup2020201(EntityQnRecord _qnRecordVo, List <EntityClientInfo> _lstClientInfo)
 {
     InitializeComponent();
     this.qnRecordVo = _qnRecordVo;
     lstClientInfo   = _lstClientInfo;
 }
Beispiel #13
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
            {
            }
        }
Beispiel #14
0
 public frmPopup2020702(EntityQnRecord _qnRecordVo)
 {
     InitializeComponent();
     qnRecordVo = _qnRecordVo;
 }
Beispiel #15
0
        /// <summary>
        /// InitComponent
        /// </summary>
        public void InitComponent(EntityQnRecord qnRecordVo)
        {
            try
            {
                List <EntityDicQnSetting> lstTopic = null;
                List <EntityDicQnSetting> lstItems = null;
                using (ProxyHms svc = new ProxyHms())
                {
                    svc.Service.GetQnCustom(qnRecordVo.qnId, out lstTopic, out lstItems);
                }
                int intY = 10;
                Dictionary <string, string> dicData = Function.ReadXmlNodes(qnRecordVo.xmlData, "FormData");
                this.Sex.Text          = dicData["Sex"];
                this.ClientName.Text   = dicData["ClientName"];
                this.ClientNo.Text     = dicData["clientNo"];
                this.QuestionDate.Text = dicData["QuestionDate"];
                this.Birthday.Text     = dicData["Birthday"];

                if (lstTopic != null && lstTopic.Count > 0)
                {
                    qnName.Text = qnRecordVo.qnName;
                    EntityDicQnSetting item  = null;
                    EntityDicQnSetting item2 = null;
                    for (int i = 0; i < lstTopic.Count; i++)
                    {
                        item = lstTopic[i];
                        DevExpress.XtraReports.UI.XRLabel lblTopic = new DevExpress.XtraReports.UI.XRLabel();
                        lblTopic.Name     = item.fieldId;
                        lblTopic.Text     = Convert.ToString(i + 1) + "、" + item.fieldName;
                        lblTopic.WidthF   = lblTopic.Text.Length + 120;
                        lblTopic.Font     = new System.Drawing.Font("宋体", 9.5F);
                        lblTopic.Location = new Point(44, intY);
                        this.Detail.Controls.Add(lblTopic);

                        List <EntityDicQnSetting> lstCtrls = lstItems.FindAll(t => t.parentFieldId == item.fieldId);
                        if (lstCtrls != null && lstCtrls.Count > 0)
                        {
                            intY += 40;
                            int tmpX = 0;
                            int tmpY = intY;
                            for (int j = 0; j < lstCtrls.Count; j++)
                            {
                                tmpY = intY + 30 * (j / 5);
                                tmpX = 44 + (j % 5) * 130;

                                item2 = lstCtrls[j];
                                if (item2.typeId == "3")
                                {
                                    DevExpress.XtraReports.UI.XRLabel lblAns = new XRLabel();
                                    lblAns.Location = new Point(44, intY);
                                    lblAns.Font     = new System.Drawing.Font("宋体", 9.5F);
                                    if (dicData.ContainsKey(item2.fieldId))
                                    {
                                        lblAns.Text = dicData[item2.fieldId];
                                    }

                                    lblAns.Width = lblAns.Text.Length + 120;
                                    this.Detail.Controls.Add(lblAns);
                                }
                                else
                                {
                                    DevExpress.XtraReports.UI.XRCheckBox chkAns = new XRCheckBox();
                                    chkAns.Name  = item2.fieldId;
                                    chkAns.Text  = item2.fieldName;
                                    chkAns.Font  = new System.Drawing.Font("宋体", 9.5F);
                                    chkAns.Width = item2.fieldName.Length + 85;
                                    if (dicData.ContainsKey(item2.fieldId))
                                    {
                                        chkAns.Checked = dicData[item2.fieldId] == "1" ? true : false;
                                    }
                                    chkAns.Location = new Point(tmpX, tmpY);

                                    this.Detail.Controls.Add(chkAns);
                                }
                            }
                            intY  = tmpY;
                            intY += 60;
                        }
                        else
                        {
                            if (item.typeId == "3")
                            {
                                intY += 30;
                                DevExpress.XtraReports.UI.XRLabel lblAns = new XRLabel();
                                lblAns.Location = new Point(44, intY);
                                lblAns.Font     = new System.Drawing.Font("宋体", 9.5F);
                                if (dicData.ContainsKey(item2.fieldId))
                                {
                                    lblAns.Text = dicData[item2.fieldId];
                                }
                                lblAns.Width = lblAns.Text.Length + 120;
                                this.Detail.Controls.Add(lblAns);
                            }
                            else
                            {
                                intY += 60;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                DialogBox.Msg(ex.Message);
            }
            finally
            {
            }
        }
Beispiel #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        public List <EntityQnRecord> GetQnRecords(List <EntityParm> parms)
        {
            List <EntityQnRecord> data = null;
            SqlHelper             svc  = new SqlHelper(EnumBiz.onlineDB);
            string Sql = string.Empty;

            Sql = @"select a.recId,
                           b.clientNo,
                           b.clientName,
                           b.gender,
						   b.gradeName,
                           b.birthday,
                           a.qnName,
						   a.qnType,
                           a.qnDate,
                           a.qnSource,
                           a.qnId,
                           d.oper_name as recorder,
                           q.xmlData
                        from qnRecord a
                     left join qnData q
                        on a.recId = q.recId
                     inner join v_clientInfo b
                        on a.clientNo = b.clientNo
                      left join code_operator d
                        on a.recorder = d.oper_code 
                            where a.status != -1";

            string sub = string.Empty;

            if (parms != null)
            {
                foreach (EntityParm pa in parms)
                {
                    string key = pa.key;

                    switch (key)
                    {
                    case "qnType":
                        sub += " and a.qnType = '" + pa.value + "'";
                        break;

                    case "clientNo":
                        sub += " and a.clientNo = '" + pa.value + "'";
                        break;

                    case "search":
                        sub += "and a.clientNo like '%" + pa.value + "%' or a.clientName like '%" + pa.value + "%'";
                        break;

                    default:
                        break;
                    }
                }
            }

            if (!string.IsNullOrEmpty(sub))
            {
                Sql += sub;
            }

            DataTable dt = svc.GetDataTable(Sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityQnRecord>();
                EntityQnRecord vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo        = new EntityQnRecord();
                    vo.recId  = Function.Dec(dr["recId"]);
                    vo.gender = Function.Int(dr["gender"]);
                    if (vo.gender == 1)
                    {
                        vo.sex = "男";
                    }
                    if (vo.gender == 2)
                    {
                        vo.sex = "女";
                    }
                    vo.clientNo   = dr["clientNo"].ToString();
                    vo.clientName = dr["clientName"].ToString();
                    vo.gradeName  = dr["gradeName"].ToString();
                    vo.age        = dr["birthday"] == DBNull.Value ? "" : CalcAge.GetAge(Function.Datetime(dr["birthday"]));
                    vo.qnName     = dr["qnName"].ToString();
                    vo.qnId       = Function.Dec(dr["qnId"]);
                    vo.qnSource   = Function.Dec(dr["qnSource"]);
                    if (vo.qnSource == 1)
                    {
                        vo.strQnSource = "采集系统";
                    }
                    vo.qnDate    = Function.Datetime(dr["qnDate"]);
                    vo.strQnDate = Function.Datetime(dr["qnDate"]).ToString("yyyy-MM-dd");
                    vo.recorder  = dr["recorder"].ToString();
                    vo.xmlData   = dr["xmlData"].ToString();
                    if (data.Any(r => r.recId == vo.recId))
                    {
                        continue;
                    }
                    data.Add(vo);
                }
            }
            return(data);
        }
Beispiel #17
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
            {
            }
        }