/// <summary> /// 通过域名查找OEM信息 /// </summary> /// <param name="domain"></param> /// <returns></returns> public static OEMInfo QueryOEM(string domain) { if (NotOEMCache.GetValue(domain) == Guid.Empty) { return(null); } OEMInfo result = OEMCache.GetValue(domain); if (result == null) { lock (locker) { result = OEMCache.GetValue(domain); if (result != null) { return(result); } var repository = Factory.CreateCompanyRepository(); result = repository.QueryOEM(domain); if (result != null) { OEMCache.Add(domain, result); } else { NotOEMCache.Add(domain, Guid.Empty); } } } return(result); }
/// <summary> /// 通过公司ID查找OEM信息 /// </summary> /// <param name="companyId"></param> /// <returns></returns> public static OEMInfo QueryOEM(Guid companyId) { if (NotOEMCache.Values.Any(i => i == companyId)) { return(null); } OEMInfo result = OEMCache.Values.FirstOrDefault(o => o.CompanyId == companyId); if (result != null) { return(result); } lock (locker) { result = OEMCache.Values.FirstOrDefault(o => o.CompanyId == companyId); if (result != null) { return(result); } var repository = Factory.CreateCompanyRepository(); result = repository.QueryOEM(companyId); if (result != null) { OEMCache.Add(result.DomainName, result); } else { NotOEMCache.Add(companyId.ToString(), companyId); } } return(result); }
static void FlushOEM(Guid oemId) { OEMInfo result = OEMCache.Values.FirstOrDefault(o => o.Id == oemId); if (result == null) { return; } lock (locker) { OEMCache.Remove(result.DomainName); } }
public bool ExChangreCommosity(Guid id, int exChangeNum) { try { OEMInfo oem = BasePage.SuperiorOEM; CommodityServer.ExChangeCommodity(id, exChangeNum, CurrentCompany, CurrentUser, oem == null ? OEMCommodityState.Success : OEMCommodityState.Processing, oem == null ? "B3B交易平台" : oem.SiteName, oem == null ? (Guid?)null : oem.Id); return(true); } catch (System.Data.Common.DbException ex) { Service.LogService.SaveExceptionLog(ex); throw new Exception("兑换商品发生未知错误,请稍后再试"); } catch (Exception) { throw; } }
private void LoadStyle(OEMInfo oem) { string str = ""; int i = 0; foreach (var item in OEMStyleService.QueryOEMVailStyles()) { if (oem.OEMStyle != null && item.Id == oem.OEMStyle.Id) { hidValue.Value = item.Id.ToString(); } str += "<li for='s" + i + "'><img title='" + item.Remark + "' src='" + item.ThumbnailPicture + "' for='s" + i + "' /><p class='bor'>" + item.StyleName + "</p><p><input type='radio' " + "name='radChooice' value='" + item.Id + "' id='s" + i + "' " + (oem.OEMStyle != null && item.Id == oem.OEMStyle.Id ? "checked='checked'" : "") + " /><label for='s" + i + "'>设为默认</label></p></li>"; i++; } ulHtml.InnerHtml = str; }
// /// <summary> // /// 查询业务服务联系方式 // /// </summary> // /// <param name="oemId">oemId</param> // /// <returns>Contract</returns> // public static Contract GetContract(Guid oemId){ // throw new NotImplementedException(); // } /// <summary> /// 保存业务服务联系方式 /// </summary> /// <param name="oemInfo">oemInfo</param> /// <param name="operators">操作员</param> public static void SvaeContract(OEMInfo oemInfo, string operators) { var repository = Factory.CreateDistributionOEMRepository(); repository.SvaeOEMContract(oemInfo); saveUpdateLog("OEM业务服务联系方式设置", string.Format("企业QQ:{0},儿童机票受理传真:{1},票务综合处理电话:{2},退票电话:{3},废票电话:{4},支付相关服务电话:{5},紧急业务受理电话:{6},投诉监督电话:{7},是否允许平台联系采购:{8},是否采用B3B客服电话:{9}", oemInfo.Contract.EnterpriseQQ, oemInfo.Contract.Fax, oemInfo.Contract.ServicePhone, oemInfo.Contract.RefundPhone, oemInfo.Contract.ScrapPhone, oemInfo.Contract.PayServicePhone, oemInfo.Contract.EmergencyPhone, oemInfo.Contract.ComplainPhone, oemInfo.Contract.AllowPlatformContractPurchaser ? "允许" : "不允许", oemInfo.Contract.UseB3BServicePhone ? "采用" : "不采用"), oemInfo.SiteName, OperatorRole.User, operators); }
/// <summary> /// Get general oem info /// </summary> /// <returns></returns> public static OEMInfo GetOEMInfo() { OEMInfo oemInfo = new OEMInfo { // get baseboard info BaseBoard = GetBaseBoardInfo(), // get cpu info CPU = GetCPUInfo(), // get gpu info GPU = GetGPUInfo(), // get ard disk info HardDrive = GetPrimaryHardDiskInfo(), // get memory info Memory = GetMemoryInfo(), // get monitor info Monitor = GetMonitorInfo(), // get mac address MacAddress = GetMacAddress() }; return(oemInfo); }
private void initData(string oemId) { lblOperator.Text = "修改"; insert.Visible = false; update.Visible = true; OEMInfo distributionOEM = OEMService.QueryOEMById(Guid.Parse(oemId)); if (distributionOEM != null) { txtOemName.Text = distributionOEM.SiteName; txtAuthorizationDomain.Text = distributionOEM.DomainName; txtAuthorizationDeadline.Text = distributionOEM.EffectTime.HasValue ? distributionOEM.EffectTime.Value.ToString("yyyy-MM-dd") : string.Empty; txtAuthorizationDeposit.Text = distributionOEM.AuthCashDeposit.TrimInvaidZero(); rdnPlatform.Checked = distributionOEM.UseB3BConfig; rdnOwner.Checked = !distributionOEM.UseB3BConfig; txtLoginUrl.Text = distributionOEM.LoginUrl; CompanyDetailInfo companyDetailInfo = CompanyService.GetCompanyDetail(distributionOEM.CompanyId); if (companyDetailInfo != null) { lblB3bAccountNo.Text = companyDetailInfo.UserName; } } }
/// <summary> /// 通过OEMID查找OEM信息 /// </summary> /// <param name="oemId"></param> /// <returns></returns> public static OEMInfo QueryOEMById(Guid oemId) { OEMInfo result = OEMCache.Values.FirstOrDefault(o => o.Id == oemId); if (result != null) { return(result); } lock (locker) { result = OEMCache.Values.FirstOrDefault(o => o.Id == oemId); if (result != null) { return(result); } var repository = Factory.CreateCompanyRepository(); result = repository.QueryOEMById(oemId); if (result != null) { OEMCache.Add(result.DomainName, result); } } return(result); }
protected void Page_Load(object sender, EventArgs e) { RegisterOEMSkins("form.css"); RegisterOEMSkins("page.css"); RegisterOEMSkins("register.css"); if (!IsPostBack) { OEMInfo oem = null; if (Request.QueryString["id"] == null || Request.QueryString["id"] == "") { oem = OEMService.QueryOEM(CurrentCompany.CompanyId); hidValue.Value = "1"; } else { oem = OEMService.QueryOEM(Guid.Parse(Request.QueryString["id"])); hidValue.Value = "2"; btnCancel.Visible = false; } if (oem != null) { hidOemdId.Value = oem.Id.ToString(); txtKeyWord.Value = oem.Setting.SiteKeyWord; txtKeyDes.Value = oem.Setting.SiteDescription; txtCopyright.Value = oem.Setting.CopyrightInfo; txtBGColor.Value = oem.Setting.BGColor; txtShowBGColor.Style.Add("background-color", "#" + (oem.Setting.BGColor.Replace("#", ""))); string strheader = ""; if (oem.Setting.HeaderLinks != null) { int countheader = oem.Setting.HeaderLinks.Count(); int countfooter = oem.Setting.FooterLinks.Count(); int index = 0; foreach (var item in oem.Setting.HeaderLinks) { index++; if (strheader == "") { if (countheader == 1) { strheader += "<span>增加头部链接:</span><div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add'>+</a></div>"; } else { strheader += "<span>增加头部链接:</span><div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a></div>"; } } else { if (index == 5) { strheader += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add' style='visibility:hidden;'>+</a></div>"; } else { if (countheader == index) { strheader += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add' >+</a></div>"; } else { strheader += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a></div>"; } } //else //{ // strheader += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a><a class='add' style='visibility:hidden;'>+</a></div>"; //} } } string strfooter = ""; index = 0; foreach (var item in oem.Setting.FooterLinks) { index++; if (strfooter == "") { if (countfooter == 1) { strfooter += "<span>底部链接管理:</span><div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add'>+</a></div>"; } else { strfooter += "<span>底部链接管理:</span><div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a></div>"; } } else { if (index == 5) { strfooter += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add' style='visibility:hidden;'>+</a></div>"; } else { if (countfooter == index) { strfooter += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='add' >+</a></div>"; } else { strfooter += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a></div>"; } } //else //{ // strfooter += "<div><input type='text' placeholder='链接名称' value='" + item.LinkName + "' class='text text-s' />\n<input type='text' placeholder='链接地址' value='" + item.URL + "' class='text' />\n<a class='reduce'>-</a></div>"; //} } } if (strheader != "") { divHeader.InnerHtml = strheader; } if (strfooter != "") { divFooter.InnerHtml = strfooter; } } } } }