Exemplo n.º 1
0
        /// <summary>
        /// 创建POST连接
        /// </summary>
        /// <param name="dataDic"></param>
        /// <returns></returns>
        public static string postDataToFp(Dictionary <string, string> dataDic)
        {
            FpUtility.Fp_DAL.CallApi call = new Fp_DAL.CallApi(dataDic);
            string res = call.PostData();

            return(res);
        }
Exemplo n.º 2
0
Arquivo: Samples.cs Projeto: aj-hc/SY
 public static List<SampleTypes> GetAll(Fp_Common.UnameAndPwd up)
 {
     Dictionary<string, string> dic = new Dictionary<string, string>();
     dic.Add("username", up.UserName);
     dic.Add("password", up.PassWord);
     dic.Add("method", Fp_Common.FpMethod.sample_types.ToString());
     Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
     List<Fp_Model.SampleTypes> List = call.getdata<Fp_Model.SampleTypes>("SampleTypes");
     return List;
 }
Exemplo n.º 3
0
        public static List <Fp_Model.SampleSourceTypes> GetAll(Fp_Common.UnameAndPwd up)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("username", up.UserName);
            dic.Add("password", up.PassWord);
            dic.Add("method", Fp_Common.FpMethod.sample_source_types.ToString());
            Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
            List <Fp_Model.SampleSourceTypes> List = call.getdata <Fp_Model.SampleSourceTypes>("SampleSourceTypes");

            return(List);
        }
Exemplo n.º 4
0
 public static string ImportSampleSourceDataToFp(Fp_Common.UnameAndPwd up, string sampleSourceTypeName, Dictionary<string, string> jsonDic)
 {
     string result = string.Empty;
     Dictionary<string, string> dic = new Dictionary<string, string>();
     dic.Add("username", up.UserName);
     dic.Add("password", up.PassWord);
     dic.Add("method", Fp_Common.FpMethod.import_sources.ToString());
     dic.Add("sample_source_type", sampleSourceTypeName);
     if (jsonDic != null && jsonDic.Count > 0)
     {
         dic.Add("json", Fp_Common.FpJsonHelper.DictionaryToJsonString(jsonDic));
     }
     Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
     result = call.PostData();
     return result;
 }
Exemplo n.º 5
0
        public static string ImportSampleSourceDataToFp(Fp_Common.UnameAndPwd up, string sampleSourceTypeName, Dictionary <string, string> jsonDic)
        {
            string result = string.Empty;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("username", up.UserName);
            dic.Add("password", up.PassWord);
            dic.Add("method", Fp_Common.FpMethod.import_sources.ToString());
            dic.Add("sample_source_type", sampleSourceTypeName);
            if (jsonDic != null && jsonDic.Count > 0)
            {
                dic.Add("json", Fp_Common.FpJsonHelper.DictionaryToJsonString(jsonDic));
            }
            Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
            result = call.PostData();
            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 提交样本数据到系统
        /// </summary>
        /// <param name="up"></param>
        /// <param name="jsonDic"></param>
        /// <returns></returns>
        private static string ImportSampleToFp(Fp_Common.UnameAndPwd up, Dictionary <string, string> jsonDic)
        {
            string result = string.Empty;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("username", up.UserName);
            dic.Add("password", up.PassWord);
            dic.Add("method", FpMethod.import_samples.ToString());
            if (jsonDic != null && jsonDic.Count > 0)
            {
                foreach (KeyValuePair <string, string> item in jsonDic)
                {
                    dic.Add(item.Key.Trim(), item.Value.Trim());
                }
            }
            Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
            result = call.PostData();
            return(result);
        }
Exemplo n.º 7
0
 public static string postDataToFp(Dictionary<string,string> dataDic)
 {
     FpUtility.Fp_DAL.CallApi call = new Fp_DAL.CallApi(dataDic);
     string res = call.PostData();
     return res;
 }
Exemplo n.º 8
0
Arquivo: Samples.cs Projeto: aj-hc/SY
 private static string ImportSampleToFp(Fp_Common.UnameAndPwd up, Dictionary<string, string> jsonDic)
 {
     string result = string.Empty;
     Dictionary<string, string> dic = new Dictionary<string, string>();
     dic.Add("username", up.UserName);
     dic.Add("password", up.PassWord);
     dic.Add("method", FpMethod.import_samples.ToString());
     //dic.Add("method", FpMethod.import_samples_bulk.ToString());
     if (jsonDic != null && jsonDic.Count > 0)
     {
         foreach (KeyValuePair<string, string> item in jsonDic)
         {
             dic.Add(item.Key.Trim(), item.Value.Trim());
         }
     }
     Fp_DAL.CallApi call = new Fp_DAL.CallApi(dic);
     result = call.PostData();
     return result;
 }