Esempio n. 1
0
 /// <summary>
 /// 此方法用于根据交往记录id查询
 /// </summary>
 /// <param name="actID"></param>
 /// <returns></returns>
 public static Activitys ActivityFindByACTID(int actID)
 {
     using (SqlDataReader sdr = DBHelp.ExecuteReader("select * from activitys where [email protected]", new List<SqlParameter> { new SqlParameter("@ActID", actID) }))
     {
         Activitys obj = null;
         if (sdr.Read())
         {
             obj = new Activitys();
             obj.ActID = actID;
             obj.CusID = sdr["CusID"].ToString();
             obj.ActDate = sdr["ActDate"].ToString();
             obj.ActAdd = sdr["ActAdd"].ToString();
             obj.ActTitle = sdr["ActTitle"].ToString();
             obj.ActMemo = sdr["ActMemo"].ToString();
             obj.ActDesc = sdr["ActDesc"].ToString();
         }
         return obj;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 此方法用于按照客户编号查询交往记录
 /// </summary>
 /// <param name="cusID"></param>
 /// <returns></returns>
 public static List<Activitys> ActivityFindByID(string cusID)
 {
     using (SqlDataReader sdr = DBHelp.ExecuteReader("select * from activitys where [email protected] order by ActDate desc", new List<SqlParameter> { new SqlParameter("@CusID", cusID) }))
     {
         List<Activitys> list = new List<Activitys>();
         while (sdr.Read())
         {
             Activitys obj = new Activitys();
             obj.ActID = Convert.ToInt32(sdr["ActID"].ToString());
             obj.CusID = cusID;
             obj.ActDate = sdr["ActDate"].ToString();
             obj.ActAdd = sdr["ActAdd"].ToString();
             obj.ActTitle = sdr["ActTitle"].ToString();
             obj.ActMemo = sdr["ActMemo"].ToString();
             obj.ActDesc = sdr["ActDesc"].ToString();
             list.Add(obj);
         }
         return list;
     }
 }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
 /// <summary>
 /// 此方法用于修改交往记录
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool ActivitysEdit(Activitys obj)
 {
     List<SqlParameter> list = new List<SqlParameter>
     {
         new SqlParameter("@ActDate",DateTime.Parse(obj.ActDate)),
         new SqlParameter("@ActAdd", obj.ActAdd),
         new SqlParameter("@ActTitle", obj.ActTitle),
         new SqlParameter("@ActMemo", obj.ActMemo),
         new SqlParameter("@ActDesc", obj.ActDesc),
         new SqlParameter("@ActID",obj.ActID)
     };
     return DBHelp.ExecuteCUD("update activitys set [email protected], [email protected], [email protected], [email protected], [email protected] where [email protected]", list)>0;
 }
Esempio n. 5
0
 /// <summary>
 /// 此方法用于添加新的交往记录
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool ActivitysAdd(Activitys obj)
 {
     List<SqlParameter> list = new List<SqlParameter>
     {
         new SqlParameter("@CusID", obj.CusID),
         new SqlParameter("@ActAdd", obj.ActAdd),
         new SqlParameter("@ActDate", DateTime.Parse(obj.ActDate)),
         new SqlParameter("@ActTitle", obj.ActTitle),
         new SqlParameter("@ActMemo", obj.ActMemo),
         new SqlParameter("@ActDesc", obj.ActDesc)
     };
     return DBHelp.ExecuteCUD("insert into activitys values(@CusID, @ActDate , @ActAdd, @ActTitle, @ActMemo, @ActDesc)", list) > 0;
 }