/// <summary> /// Saves this instance. /// </summary> /// <returns></returns> private bool Save() { bool status = false; try { if (isNew) { bllCompanyPoint.Add(modCompanyPoint); } else { bllCompanyPoint.Update(modCompanyPoint); } //status = true; if (isGeneralNew) { bllCompanyGeneral.Add(modCompayGeneral); } else { bllCompanyGeneral.Update(modCompayGeneral); } status = true; } catch (Exception exception) { status = false; LPLog.LogMessage(exception.Message); } return(status); }
/// <summary> /// 同步按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSync_Click(object sender, EventArgs e) { try { // 请大家不要使用 System.Transactions.TransactionScope, 它导致Service崩溃. //using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope()) //{ LPWeb.BLL.Company_General bllCG = new LPWeb.BLL.Company_General(); LPWeb.Model.Company_General modGeneral = new LPWeb.Model.Company_General(); modGeneral = bllCG.GetModel(); modGeneral.StartMarketingSync = true; bllCG.Update(modGeneral); ServiceManager sm = new ServiceManager(); using (LP2ServiceClient client = sm.StartServiceClient()) { string err = ""; if (!client.SyncMarketingData(ref err)) { PageCommon.AlertMsg(this, err); return; } //ts.Complete(); } //} PageCommon.WriteJsEnd(this, "Sync Marketing Info successfully.", PageCommon.Js_RefreshSelf); } catch (Exception ex) { PageCommon.AlertMsg(this, ex.Message); return; } }