public int InsertLink(Model.LinkMans link) { int id = -1; if (DalBase.Insert(link) > 0) { id = DalBase.GetMax <Model.LinkMans>(); } return(id); }
/// <summary> /// 此方法用于客户开发成功 /// </summary> /// <param name="cus">要添加的客户对象</param> /// <param name="lm">要添加的联系人对象</param> /// <param name="od">要添加的订单对象</param> /// <param name="act">要添加的交往记录对象</param> /// <returns></returns> public static bool PlanSuccess(int chanID) { Chances chan = ChancesBLL.ChanFindById(chanID); //判断销售机会是否修改成功 if (null == chan) { return false; } List<Plans> plList = PlansDAL.PlanFindByID(chanID); //判断客户开发计划是否为空 if (null == plList) { return false; } //给要添加的客户初始化值 Customers cus = new Customers(); cus.CusID = CustomersBLL.GetCusID(); cus.UserID = chan.ChanDueMan; cus.CusName = chan.ChanName; //给要添加的联系人初始化值 LinkMans lm = new LinkMans(); lm.CusID = cus.CusID; lm.LMName = chan.ChanName; lm.LMMobileNo = lm.LMOfficeNo = chan.ChanLinkTel; //给要添加的订单初始化值 Orders od = new Orders(); od.CusID = cus.CusID; od.OrderDate = "getdate()"; //给要添加的交往记录初始化值 List<Activitys> actList = new List<Activitys>(); for (int i = 0; i < plList.Count; i++) { Activitys act = new Activitys(); act.CusID = cus.CusID; act.ActDate = plList[i].PlanResultDate; act.ActTitle = plList[i].PlanResult; actList.Add(act); } return CustomersBLL.CustomerAddNew(cus) && LinkMansBLL.LinkManAddNew(lm) && OrdersBLL.OrderAddNew(od) && ActivitysBLL.ActivityAddNew(actList) && ChancesBLL.PlanSuccess(chanID); }
public bool LinkManEdit(LinkMans obj) { return LinkMansBLL.LinkManEdit(obj); }
public bool LinkManAdd(LinkMans obj) { return LinkMansBLL.LinkManAdd(obj); }
public int UpdLink(Model.LinkMans link) { return(DalBase.Updata(link)); }