/// <summary> /// 初始化卖家的买家系统分组;另外功能还需要提供卖家自定义分组。 /// </summary> private void InitGroup(string strNick) { //同步系统分组功能 CTCRM.Entity.Group obj = new CTCRM.Entity.Group(); obj.Group_name = "新客户"; obj.SellerNick = strNick; obj.Memo = ""; obj.OpenStatus = true; //如果添加分组成功 if (!BuyerBLL.CheckGroupIsExit(strNick, "新客户")) { //BuyerBLL.AddBuyerGroup(obj); BuyerBLL.AddGroup(obj); } CTCRM.Entity.Group obj2 = new CTCRM.Entity.Group(); obj2.Group_name = "老客户"; obj2.SellerNick = strNick; obj2.Memo = ""; obj2.OpenStatus = true; //如果添加分组成功 if (!BuyerBLL.CheckGroupIsExit(strNick, "老客户")) { BuyerBLL.AddGroup(obj2); } CTCRM.Entity.Group obj3 = new CTCRM.Entity.Group(); obj3.Group_name = "休眠3个月"; obj3.SellerNick = strNick; obj3.Memo = ""; obj3.OpenStatus = true; //如果添加分组成功 if (!BuyerBLL.CheckGroupIsExit(strNick, "休眠3个月")) { BuyerBLL.AddGroup(obj3); } CTCRM.Entity.Group obj5 = new CTCRM.Entity.Group(); obj5.Group_name = "潜在客户"; obj5.SellerNick = strNick; obj5.Memo = ""; obj5.OpenStatus = true; //如果添加分组成功 if (!BuyerBLL.CheckGroupIsExit(strNick, "潜在客户")) { BuyerBLL.AddGroup(obj5); } }
public static bool AddGroup(CTCRM.Entity.Group o) { try { string query = @"insert into UserGroup(group_name,sellerNick,memo,createDate,openStatus)values(@group_name,@sellerNick,@memo,@createDate,@openStatus)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@group_name", o.Group_name), new SqlParameter("@sellerNick", o.SellerNick), new SqlParameter("@memo", o.Memo), new SqlParameter("@openStatus", o.OpenStatus), new SqlParameter("@createDate", DateTime.Now) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool AddGroup(CTCRM.Entity.Group o) { return(GroupDAL.AddGroup(o)); }