Beispiel #1
0
        public static Resp_Company_List To_Company_List(ISearchResponse <OrgCompanyCombine> search)
        {
            var resp = new Resp_Company_List()
            {
                oc_list = new List <Resp_Oc_Abs>(), count = 3
            };
            var docs = search.Documents;

            foreach (var c in docs)
            {
                if (Private_Util.Normal_Filter(c.od_ext))
                {
                    var r = new Resp_Oc_Abs();
                    r.flag           = c.od_CreateTime.Year != 1900;
                    r.oc_addr        = c.oc_address ?? "--";
                    r.oc_area        = c.oc_area;
                    r.oc_code        = c.oc_code;
                    r.oc_art_person  = c.od_faRen ?? string.Empty;
                    r.oc_issue_time  = c.oc_issuetime.ToString("yyyy-MM-dd") ?? "--";
                    r.oc_name_hl     = c.oc_name;
                    r.oc_name        = c.oc_name;
                    r.oc_reg_capital = c.od_regMoney ?? "--";
                    r.oe_status      = c.oc_issuetime < DateTime.Now;
                    r.oc_type        = c.oc_companytype ?? "--";
                    r.oc_status      = r.flag ? Private_Util.Operation_Status_Get(c.od_ext) : "未知";
                    resp.oc_list.Add(r);
                }
                if (resp.oc_list.Count == 3)
                {
                    break;
                }
            }
            return(resp);
        }
Beispiel #2
0
        public static Resp_Company_Detail To_Company_Detail(this Tuple <OrgCompanyDtlInfo, OrgCompanyListInfo> t)
        {
            var c = new Resp_Company_Detail();

            if (t.Item1 != null)
            {
                var flag = t.Item1.od_CreateTime.Year != 1900;
                c.oc_code_s       = Private_Util.To_Code_Display(t.Item1.od_oc_code) ?? string.Empty;
                c.oc_code         = t.Item1.od_oc_code ?? string.Empty;
                c.oc_number       = Private_Util.To_Number_Display(t.Item1.oc_number) ?? string.Empty;
                c.oc_name         = t.Item1.oc_name ?? string.Empty;
                c.oc_addr         = t.Item1.oc_address ?? string.Empty;
                c.oc_art_person   = t.Item1.od_faRen ?? string.Empty;
                c.oc_business     = t.Item1.od_bussinessDes ?? string.Empty;
                c.oc_reg_capital  = t.Item1.od_regMoney ?? string.Empty;
                c.oc_paid_capital = t.Item1.od_factMoney ?? string.Empty;
                c.oc_reg_type     = t.Item1.od_regType ?? string.Empty;
                c.oc_reg_date     = t.Item1.od_regDate ?? string.Empty;
                c.oc_operate_time = flag ? (string.IsNullOrEmpty(t.Item1.od_bussinessS) ? "****" : t.Item1.od_bussinessS)
                                    + " 至 "
                                    + (string.IsNullOrEmpty(t.Item1.od_bussinessE) ? "永续经营" : t.Item1.od_bussinessE) : "";
                c.oc_check_date    = t.Item1.od_chkDate;
                c.oc_annual_review = t.Item1.od_yearChk;
                // generating time of this record
                c.oc_create_time = t.Item1.od_CreateTime.ToString("yyyy-MM-dd HH:mm");
                c.oc_ext         = t.Item1.od_ext ?? string.Empty;
                c.oc_status      = Private_Util.Operation_Status_Get(c.oc_ext);
            }
            if (t.Item2 != null)
            {
                c.oc_detail_weburi = $"{ConfigurationManager.AppSettings["oc_detail_weburi"]}/?a=detail&c={HttpUtility.UrlEncode(Cipher_Aes.EncryptToBase64(t.Item2.oc_code, ConfigurationManager.AppSettings["code_key"]), Encoding.UTF8)}";
                if (string.IsNullOrEmpty(c.oc_code_s))
                {
                    c.oc_code_s = Private_Util.To_Code_Display(t.Item2.oc_code);
                    c.oc_code   = t.Item2.oc_code;
                }
                c.oc_area      = t.Item2.oc_area ?? string.Empty;
                c.oc_area_name = t.Item2.oc_areaName ?? string.Empty;
                if (string.IsNullOrEmpty(c.oc_name))
                {
                    c.oc_name = t.Item2.oc_name;
                }

                c.oc_type     = t.Item2.oc_companytype;
                c.oc_reg_name = t.Item2.oc_regOrgName;
                c.oc_number   = t.Item2.oc_number;
                if (string.IsNullOrEmpty(c.oc_number))
                {
                    c.oc_number = Private_Util.To_Number_Display(t.Item2.oc_number);
                }
                c.oc_creditcode = t.Item2.oc_creditcode;
                if (string.IsNullOrEmpty(c.oc_addr))
                {
                    c.oc_addr = t.Item2.oc_address;
                }
                c.oc_valid_period = t.Item2.oc_issuetime.ToString("yyyy-MM-dd") + " 至 " + t.Item2.oc_invalidtime.ToString("yyyy-MM-dd"); // 有效期
                if (string.IsNullOrEmpty(c.oc_create_time))
                {
                    c.oc_create_time = t.Item2.oc_createTime.ToString("yyyy-MM-dd HH:mm");
                }
            }
            return(c);
        }