Beispiel #1
0
        /// <summary>
        /// 根据ID查询所对应的回访记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Tz888.Model.Visit.VisitInfoModel SelVisit(string name)
        {
            Tz888.Model.Visit.VisitInfoModel visit = new Tz888.Model.Visit.VisitInfoModel();
            string sql = "select Valid,Mobile,Email,Disposition,Caption,Remark,VisitNew,VisitTime from VisitInfoTab where LoginName=@name";

            SqlParameter[] para =
            {
                new SqlParameter("@name", SqlDbType.VarChar, 20)
            };
            para[0].Value = name;
            DataSet ds = DbHelperSQL.Query(sql, para);

            if (ds != null & ds.Tables[0].Rows.Count > 0)
            {
                visit.Valid       = Convert.ToInt32(ds.Tables[0].Rows[0]["Valid"].ToString());
                visit.Mobile      = ds.Tables[0].Rows[0]["Mobile"].ToString();
                visit.Email       = ds.Tables[0].Rows[0]["Email"].ToString();
                visit.Disposition = ds.Tables[0].Rows[0]["Disposition"].ToString();
                visit.Caption     = ds.Tables[0].Rows[0]["Caption"].ToString();
                visit.Remark      = ds.Tables[0].Rows[0]["Remark"].ToString();
                visit.VisitNew    = Convert.ToInt32(ds.Tables[0].Rows[0]["VisitNew"].ToString());
                visit.VisitTime   = Convert.ToDateTime(ds.Tables[0].Rows[0]["VisitTime"].ToString());
            }
            return(visit);
        }
Beispiel #2
0
        /// <summary>
        /// 修改回访记录
        /// </summary>
        /// <param name="visit"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public int ModfiyVisit(Tz888.Model.Visit.VisitInfoModel visit, string name)
        {
            string sql = "update VisitInfoTab set Valid=@Valid,Mobile=@Mobile,Email=@Email,Disposition=@Disposition,Caption=@Caption,"
                         + "Remark=@Remark,VisitNew=@VisitNew,VisitTime=@VisitTime where LoginName=@name";

            SqlParameter[] para =
            {
                new SqlParameter("@name",        SqlDbType.VarChar,    20),
                new SqlParameter("@Valid",       SqlDbType.Int,        10),
                new SqlParameter("@Mobile",      SqlDbType.VarChar,    50),
                new SqlParameter("@Email",       SqlDbType.VarChar,    50),
                new SqlParameter("@Disposition", SqlDbType.VarChar,    20),
                new SqlParameter("@Caption",     SqlDbType.VarChar,  5000),
                new SqlParameter("@Remark",      SqlDbType.VarChar,  5000),
                new SqlParameter("@VisitNew",    SqlDbType.Int,         4),
                new SqlParameter("VisitTime",    SqlDbType.DateTime, 50)
            };
            para[0].Value = name;
            name          = visit.LoginName;
            para[1].Value = visit.Valid;
            para[2].Value = visit.Mobile;
            para[3].Value = visit.Email;
            para[4].Value = visit.Disposition;
            para[5].Value = visit.Caption;
            para[6].Value = visit.Remark;
            para[7].Value = visit.VisitNew;
            para[8].Value = visit.VisitTime;
            object num = DbHelperSQL.GetSingle(sql, para);

            if (num == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(num));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 添加回访记录
        /// </summary>
        /// <param name="visit"></param>
        /// <returns></returns>
        public int AddVisit(Tz888.Model.Visit.VisitInfoModel visit)
        {
            string sql = "insert into VisitInfoTab(LoginName,Valid,Mobile,Email,Disposition,Caption,Remark,VisitNew,VisitTime) values "
                         + "(@LoginName,@Valid,@Mobile,@Email,@Disposition,@Caption,@Remark,@VisitNew,@VisitTime)";

            SqlParameter[] para =
            {
                new SqlParameter("@LoginName",   SqlDbType.VarChar,    20),
                new SqlParameter("@Valid",       SqlDbType.Int,         4),
                new SqlParameter("@Mobile",      SqlDbType.VarChar,    50),
                new SqlParameter("@Email",       SqlDbType.VarChar,    50),
                new SqlParameter("@Disposition", SqlDbType.VarChar,    20),
                new SqlParameter("@Caption",     SqlDbType.VarChar,  5000),
                new SqlParameter("@Remark",      SqlDbType.VarChar,  5000),
                new SqlParameter("@VisitNew",    SqlDbType.Int,         4),
                new SqlParameter("@VisitTime",   SqlDbType.DateTime, 100)
            };
            para[0].Value = visit.LoginName;
            para[1].Value = visit.Valid;
            para[2].Value = visit.Mobile;
            para[3].Value = visit.Email;
            para[4].Value = visit.Disposition;
            para[5].Value = visit.Caption;
            para[6].Value = visit.Remark;
            para[7].Value = visit.VisitNew;
            para[8].Value = visit.VisitTime;
            object name = DbHelperSQL.GetSingle(sql, para);

            if (name == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(name));
            }
        }
Beispiel #4
0
 /// <summary>
 /// 添加回访记录
 /// </summary>
 /// <param name="visit"></param>
 /// <returns></returns>
 public int AddVisit(Tz888.Model.Visit.VisitInfoModel visit)
 {
     return(dal.AddVisit(visit));
 }
Beispiel #5
0
 /// <summary>
 /// 修改回访记录
 /// </summary>
 /// <param name="visit"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public int ModfiyVisit(Tz888.Model.Visit.VisitInfoModel visit, string name)
 {
     return(dal.ModfiyVisit(visit, name));
 }