Ejemplo n.º 1
0
        //获得表单数据
        public FormStoreDTO GetFormStore(decimal?store_id)
        {
            FormStoreDTO result = null;

            using (BaseDB dbHelper = new RedasDBHelper())
            {
                try
                {
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("i_STORE_ID", store_id);
                    List <FormStoreDTO> list = null;
                    list = dbHelper.ExecuteListProc <FormStoreDTO>("pkg_form_store.sp_form_store_get", dic);

                    if (list.Count > 0)
                    {
                        result = list[0];
                    }
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        //获得询价信息中的多个表单的信息
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectId"></param>
        /// <param name="type">1:询价  2:查勘</param>
        /// <returns></returns>
        public Dictionary <int, JArray> GetDynamicFormData(decimal objectId, int type)
        {
            ObjectDTO info = GetObjectById(objectId);
            Dictionary <int, JArray> lstFormData = new Dictionary <int, JArray>();

            if (type == 1 && info.INQUIRY_FORM_ID > 0) //询价表单Id
            {
                FormStoreDTO formInfo = GetFormStore(info.INQUIRY_FORM_ID);
                JArray       arry     = JArray.Parse(formInfo.CONTENTS);
                lstFormData.Add(1, arry);
            }
            if (type == 2 && info.SURVEY_FORM_ID > 0) //查勘表单Id
            {
                FormStoreDTO formInfo = GetFormStore(info.SURVEY_FORM_ID);
                if (!lstFormData.ContainsKey(Convert.ToInt32(formInfo.INSTANCE_TYPE_ID)))
                {
                    JArray arry = JArray.Parse(formInfo.CONTENTS);
                    lstFormData.Add(2, arry);
                }
            }
            return(lstFormData);
        }