コード例 #1
0
ファイル: ExportData.cs プロジェクト: hj-nicholas/BaseFrame
 //根据实例Id获取表单实例
 public FormViewModel GetFormInstanceById(int InstanceId)
 {
     FormViewModel formInstance = new FormViewModel();
     Dictionary<string, object> dsDic = new Dictionary<string, object>();
     dsDic.Add("i_InstanceId", InstanceId);
     using (BaseDB db = new RedasDBHelper())
     {
         try
         {
             IList<FormViewModel> InstanceList = db.ExecuteListProc<FormViewModel>("pkg_Test.sp_get_instanceform", dsDic);
             if (InstanceList != null && InstanceList.Count > 0)
             {
                 formInstance = InstanceList[0];
                formInstance.LABLELIST = JsonTools.JsonToObject2<DFormViewModel>(formInstance.CONTENTS).FormLabels
                     .Where(l => l.IsSelected == true)
                     .OrderBy(d => d.DEFAULT_ORDER).ThenBy(d => d.SORT).ToList();
             }
         }
         catch
         {
             formInstance = new FormViewModel();
         }
     }
     return formInstance;
 }
コード例 #2
0
        public BaseResult CopyForm(string CustomerId, string UserId, string FormId)
        {
            BaseResult result = new BaseResult();
               try
               {
               using (RedasDBHelper db = new RedasDBHelper())
               {
                   var dic = new Dictionary<string, object>();
                   dic["i_customer_id"] = CustomerId;
                   dic["i_user_id"] = UserId;
                   dic["i_form_id"] = FormId;

                     db.ExecuteNonQueryProc("pkg_test_tools.sp_copy_forminstance", dic);
                     db.Commit();
                     result.Succeeded = true;

               }
               }
               catch (Exception ex)
               {

               result.Succeeded = false;
               result.Error = ex.Message;
               }
               return result;
        }
コード例 #3
0
ファイル: ExportData.cs プロジェクト: hj-nicholas/BaseFrame
        public List<SurveryDataModel> ExportSurveryData()
        {
            using (var db = new RedasDBHelper())
            {
                var dic = new Dictionary<string, object>();

                dic.Add("cur_result", null);

                var field = new RedasDbFieldDTO();
                IList<SurveryDataModel> fieldList = db.ExecuteListProc<SurveryDataModel>("pkg_Test.sp_SurveryData_get", dic);

                return fieldList.ToList();
            }
        }