Esempio n. 1
0
        public GepAdminResult ExportSiteAdd(string siteId, string siteName, string second_siteId, string second_siteName, string lang, string use, string loginId)
        {
            GepAdminResult resultData = new GepAdminResult();
            try
            {
                ExportSite data = new ExportSite();
                List<ExportSecondSite> secondSiteInfoList = new List<ExportSecondSite>();

                // siteId로 찾기
                if (siteId != "")
                {
                    QueryComplete param = Query.EQ("_id", Util.GetSafeLong(siteId));
                    ExportSite originSite = new AdminDac().ExportSiteView(param);
                    ExportSecondSite secondSiteInfo = new ExportSecondSite();
                    secondSiteInfo.second_siteId = Util.GetSafeInt(second_siteId);
                    secondSiteInfo.second_site_name = second_siteName;
                    secondSiteInfo.lang = lang;
                    secondSiteInfo.use_yn = use == "Y" ? true : false;
                    originSite.second_site.Add(secondSiteInfo);
                    data = originSite;
                    new AdminDac().ExportSiteSave(data);
                }
                else
                {
                    data._id = GetExpertsiteNo();
                    data.site_name = siteName;

                    ExportSecondSite secondSiteInfo = new ExportSecondSite();
                    secondSiteInfo.second_siteId = Util.GetSafeInt(second_siteId);
                    secondSiteInfo.second_site_name = second_siteName;
                    secondSiteInfo.lang = lang;
                    secondSiteInfo.use_yn = use == "Y" ? true : false;

                    secondSiteInfoList.Add(secondSiteInfo);

                    data.second_site = secondSiteInfoList;
                    data.reg_id = loginId;
                    data.reg_date = DateTime.Now;
                    new AdminDac().ExportSiteCreate(data);
                }

                resultData.result = "S";
            }
            catch (Exception ex)
            {
                resultData.message = ex.Message;
                resultData.result = "F";
            }
            return resultData;
        }
Esempio n. 2
0
        public GepAdminResult ExportSiteDelete(string siteId, string secondId)
        {
            GepAdminResult resultData = new GepAdminResult();
            try
            {
                ExportSite originSite = new AdminDac().ExportSiteView(Query.EQ("_id", Util.GetSafeLong(siteId)));
                List<ExportSecondSite> secondList = new List<ExportSecondSite>();
                foreach (var data in originSite.second_site)
                {
                    if (data.second_siteId != Util.GetSafeInt(secondId))
                    {
                        ExportSecondSite second = new ExportSecondSite();
                        second.second_siteId = data.second_siteId;
                        second.second_site_name = data.second_site_name;
                        second.lang = data.lang;
                        secondList.Add(second);
                    }

                }
                originSite.second_site = secondList;
                new AdminDac().ExportSiteSave(originSite);
                resultData.result = "S";
            }
            catch (Exception ex)
            {
                resultData.message = ex.Message;
                resultData.result = "F";
            }
            return resultData;
        }
Esempio n. 3
0
        private static void SaveExportHistory(string loginId, BsonDocument bsonDocument, ExportSecondSite exportSite, GepItemsData gepItem)
        {
            GepeBayExportHistory history = new GepeBayExportHistory();
            history._id = ObjectId.GenerateNewId();
            history.gep_id = gepItem._id;
            history.gep_img = gepItem.img;
            history.gep_stat = gepItem.stat;
            history.expt_site = exportSite.second_siteId;
            history.lang = exportSite.lang;
            foreach (var trans in gepItem.trans)
            {
                string lang = "EN";
                if (trans.lang == "US" || trans.lang == "UK" || trans.lang == "AU")
                {
                    lang = "EN";
                }
                else
                {
                    lang = trans.lang;
                }

                if (exportSite.lang == lang)
                {
                    history.tran_name = trans.name;
                    history.tran_sel = trans.sel_name;
                    history.tran_desc = trans.desc;
                }
            }
            foreach (var documentCollection in bsonDocument)
            {
                if (documentCollection.Name == "_id")
                {
                    history.tmpl_id = documentCollection.Value.ToString();
                }
            }
            history.ta = loginId;
            history.expt_date = DateTime.Now;
            new eBayItemDac().SaveExportHistory(history);
        }