/// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JumbotOA.Entity.PlanEntity model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into [OA_Plan](");
            strSql.Append("Uid,Pwtitle,Pwdate,Pwpath,Locked,Manager)");
            strSql.Append(" values (");
            strSql.Append("@Uid,@Pwtitle,@Pwdate,@Pwpath,@Locked,@Manager)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Uid", SqlDbType.Int,4),
                    new SqlParameter("@Pwtitle", SqlDbType.VarChar,80),
                    new SqlParameter("@Pwdate", SqlDbType.DateTime),
                    new SqlParameter("@Pwpath", SqlDbType.VarChar,50),
                    new SqlParameter("@Locked", SqlDbType.VarChar,10),
                    new SqlParameter("@Manager", SqlDbType.VarChar,50)};
            parameters[0].Value = model.Uid;
            parameters[1].Value = model.Pwtitle;
            parameters[2].Value = model.Pwdate;
            parameters[3].Value = model.Pwpath;
            parameters[4].Value = model.Locked;
            parameters[5].Value = model.Manager;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.WorklogEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     strSql1.Append("Uid,");
     strSql2.Append("" + model.Uid + ",");
     if (model.Manager != null)
     {
         strSql1.Append("Manager,");
         strSql2.Append("'" + model.Manager + "',");
     }
     if (model.Title != null)
     {
         strSql1.Append("Title,");
         strSql2.Append("'" + model.Title + "',");
     }
     if (model.Content != null)
     {
         strSql1.Append("Content,");
         strSql2.Append("'" + model.Content + "',");
     }
     if (model.Begintime != null)
     {
         strSql1.Append("Begintime,");
         strSql2.Append("'" + model.Begintime + "',");
     }
     if (model.Endtime != null)
     {
         strSql1.Append("Endtime,");
         strSql2.Append("'" + model.Endtime + "',");
     }
     if (model.Problem != null)
     {
         strSql1.Append("Problem,");
         strSql2.Append("'" + model.Problem + "',");
     }
     if (model.Remark != null)
     {
         strSql1.Append("Remark,");
         strSql2.Append("'" + model.Remark + "',");
     }
     strSql.Append("insert into [OA_Worklog](");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 1;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.CallinfoEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     strSql1.Append("Uid,");
     strSql2.Append("" + model.Uid + ",");
     if (model.Userinfo != null)
     {
         strSql1.Append("Userinfo,");
         strSql2.Append("'" + model.Userinfo + "',");
     }
     if (model.Title != null)
     {
         strSql1.Append("Title,");
         strSql2.Append("'" + model.Title + "',");
     }
     if (model.Unit != null)
     {
         strSql1.Append("Unit,");
         strSql2.Append("'" + model.Unit + "',");
     }
     if (model.Addtime != null)
     {
         strSql1.Append("Addtime,");
         strSql2.Append("'" + model.Addtime + "',");
     }
     if (model.Reply != null)
     {
         strSql1.Append("Reply,");
         strSql2.Append("'" + model.Reply + "',");
     }
     if (model.Remark != null)
     {
         strSql1.Append("Remark,");
         strSql2.Append("'" + model.Remark + "',");
     }
     strSql.Append("insert into [OA_Callinfo](");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 1;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(JumbotOA.Entity.UserEntity model)
        {
            if (Exists(model.Uname))//�Ѿ����ڸ��û�
                return 0;
            StringBuilder strSql = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();
            strSql1.Append("Pid,");
            strSql2.Append("" + model.Pid + ",");
            strSql1.Append("Did,");
            strSql2.Append("" + model.Did + ",");

            if (model.Uname != null)
            {
                strSql1.Append("Uname,");
                strSql2.Append("'" + model.Uname + "',");
            }
            if (model.Upwd != null)
            {
                strSql1.Append("Upwd,");
                strSql2.Append("'" + model.Upwd + "',");
            }
            if (model.Uipaddress != null)
            {
                strSql1.Append("Uipaddress,");
                strSql2.Append("'" + model.Uipaddress + "',");
            }
            if (model.Position != null)
            {
                strSql1.Append("Position,");
                strSql2.Append("'" + model.Position + "',");
            }
            if (model.Setting != null)
            {
                strSql1.Append("Setting,");
                strSql2.Append("'" + model.Setting + "',");
            }
            strSql.Append("insert into [OA_User](");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            strSql.Append(";select @@IDENTITY");
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JumbotOA.Entity.MessageEntity model)
        {
            StringBuilder strSql = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();
            strSql1.Append("ToUid,");
            strSql2.Append("" + model.ToUid + ",");
            strSql1.Append("FromUid,");
            strSql2.Append("" + model.FromUid + ",");
            if (model.Mtitle != null)
            {
                strSql1.Append("Mtitle,");
                strSql2.Append("'" + model.Mtitle + "',");
            }
            if (model.Content != null)
            {
                strSql1.Append("Content,");
                strSql2.Append("'" + model.Content + "',");
            }
            if (model.Addtime != null)
            {
                strSql1.Append("Addtime,");
                strSql2.Append("'" + model.Addtime + "',");
            }
            strSql1.Append("touser,");
            strSql2.Append("'" + model.Touser + "',");

            strSql.Append("insert into [OA_Message](");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            strSql.Append(";select @@IDENTITY");
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.MessageEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update [OA_Message] set ");
     strSql.Append("ToUid=" + model.ToUid + ",");
     strSql.Append("FromUid=" + model.FromUid + ",");
     strSql.Append("Mtitle='" + model.Mtitle + "',");
     strSql.Append("Content='" + model.Content + "',");
     strSql.Append("Addtime='" + model.Addtime + "'");
     strSql.Append("touser='******'");
     strSql.Append(" where Mid=" + model.Mid + " ");
     DbHelperSQL.ExecuteSql(strSql.ToString());
 }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(JumbotOA.Entity.PlanEntity model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update [OA_Plan] set ");
            strSql.Append("Uid=@Uid,");
            strSql.Append("Pwtitle=@Pwtitle,");
            strSql.Append("Pwdate=@Pwdate,");
            strSql.Append("Pwpath=@Pwpath,");
            strSql.Append("Locked=@Locked,");
            strSql.Append("Manager=@Manager");
            strSql.Append(" where Pwid=@Pwid ");
            SqlParameter[] parameters = {
                    new SqlParameter("@Pwid", SqlDbType.Int,4),
                    new SqlParameter("@Uid", SqlDbType.Int,4),
                    new SqlParameter("@Pwtitle", SqlDbType.VarChar,80),
                    new SqlParameter("@Pwdate", SqlDbType.DateTime),
                    new SqlParameter("@Pwpath", SqlDbType.VarChar,50),
                    new SqlParameter("@Locked", SqlDbType.VarChar,10),
                    new SqlParameter("@Manager", SqlDbType.VarChar,50)};
            parameters[0].Value = model.Pwid;
            parameters[1].Value = model.Uid;
            parameters[2].Value = model.Pwtitle;
            parameters[3].Value = model.Pwdate;
            parameters[4].Value = model.Pwpath;
            parameters[5].Value = model.Locked;
            parameters[6].Value = model.Manager;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.TaskEntity model)
 {
     return dal.Add(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.MessageEntity model)
 {
     return dal.Add(model);
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.WorklogEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update [OA_Worklog] set ");
     strSql.Append("Uid=" + model.Uid + ",");
     strSql.Append("Manager='" + model.Manager + "',");
     strSql.Append("Title='" + model.Title + "',");
     strSql.Append("Content='" + model.Content + "',");
     strSql.Append("Begintime='" + model.Begintime + "',");
     strSql.Append("Endtime='" + model.Endtime + "',");
     strSql.Append("Problem='" + model.Problem + "',");
     strSql.Append("Remark='" + model.Remark + "'");
     strSql.Append(" where Id=" + model.Id + " ");
     DbHelperSQL.ExecuteSql(strSql.ToString());
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.CallinfoEntity model)
 {
     dal.Update(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JumbotOA.Entity.TaskEntity model)
        {
            StringBuilder strSql = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();
            strSql1.Append("Uid,");
            strSql2.Append("" + model.Uid + ",");
            if (model.Manager != null)
            {
                strSql1.Append("Manager,");
                strSql2.Append("'" + model.Manager + "',");
            }
            if (model.Tasktitle != null)
            {
                strSql1.Append("Tasktitle,");
                strSql2.Append("'" + model.Tasktitle + "',");
            }
            if (model.Content != null)
            {
                strSql1.Append("Content,");
                strSql2.Append("'" + model.Content + "',");
            }
            if (model.Nowtime != null)
            {
                strSql1.Append("Nowtime,");
                strSql2.Append("'" + model.Nowtime + "',");
            }
            if (model.Plantime != null)
            {
                strSql1.Append("Plantime,");
                strSql2.Append("'" + model.Plantime + "',");
            }
            if (model.Ttype != null)
            {
                strSql1.Append("Ttype,");
                strSql2.Append("'" + model.Ttype + "',");
            }
            if (model.Worktime != null)
            {
                strSql1.Append("Worktime,");
                strSql2.Append("'" + model.Worktime + "',");
            }
            if (model.Workprogress != 0)
            {
                strSql1.Append("Workprogress,");
                strSql2.Append("'" + model.Workprogress + "',");
            }
            if (model.Sumtime != 0)
            {
                strSql1.Append("sumtime,");
                strSql2.Append("'"+model.Sumtime+"',");
            }
            if (model.Progresstime != 0)
            {
                strSql1.Append("progresstime,");
                strSql2.Append("'" + model.Progresstime + "',");
            }

            if (model.Classse != null)
            {
                strSql1.Append("classse,");
                strSql2.Append("'" + model.Classse + "',");
            }
            if (model.Remark != null)
            {
                strSql1.Append("remark,");
                strSql2.Append("'" + model.Remark + "',");
            }
            if (model.Newnote != null)
            {
                strSql1.Append("newnote,");
                strSql2.Append("'" + model.Newnote + "',");
            }
            if (model.Filepath != null)
            {
                strSql1.Append("filepath,");
                strSql2.Append("'" + model.Filepath + "',");
            }
            if (model.Question != null)
            {
                strSql1.Append("question,");
                strSql2.Append("'" + model.Question + "',");
            }
            strSql.Append("insert into [OA_Task](");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            strSql.Append(";select @@IDENTITY");
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(JumbotOA.Entity.TaskEntity model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update [OA_Task] set ");
            if (model.Uid !=0)
            {
                strSql.Append("Uid=" + model.Uid + ",");
            }
            if (model.Manager != null)
            {
                strSql.Append("Manager='" + model.Manager + "',");
            }
            if (model.Tasktitle != null)
            {
                strSql.Append("Tasktitle='" + model.Tasktitle + "',");
            }
            if (model.Content != null)
            {
                strSql.Append("Content='" + model.Content + "',");
            }
            if (model.Nowtime != null)
            {
                strSql.Append("Nowtime='" + model.Nowtime + "',");
            }
            if (model.Plantime != null)
            {
                strSql.Append("Plantime='" + model.Plantime + "',");
            }
            if (model.Ttype != null)
            {
                strSql.Append("Ttype='" + model.Ttype + "',");
            }
            if (model.Worktime != null)
            {
                strSql.Append("Worktime='" + model.Worktime + "',");
            }
            if (model.Workprogress != 0)
            {
                strSql.Append("Workprogress='" + model.Workprogress + "',");
            }
            if (model.Sumtime != 0)
            {
                strSql.Append("sumtime='" + model.Sumtime + "',");
            }
            if (model.Progresstime != 0)
            {
                strSql.Append("progresstime='" + model.Progresstime + "',");
            }
            if (model.Classse != null)
            {
                strSql.Append("classse='" + model.Classse + "',");
            }
            if (model.Remark != null)
            {
                strSql.Append("remark='" + model.Remark + "',");
            }
            if (model.Question != null)
            {
                strSql.Append("question='" + model.Question + "',");
            }
            strSql.Append("newnote='" + model.Newnote + "'");

            strSql.Append(" where Tlid=" + model.Tlid);
            DbHelperSQL.ExecuteSql(strSql.ToString());
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.CallinfoEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update [OA_Callinfo] set ");
     strSql.Append("Uid=" + model.Uid + ",");
     strSql.Append("Userinfo='" + model.Userinfo + "',");
     strSql.Append("Title='" + model.Title + "',");
     strSql.Append("Unit='" + model.Unit + "',");
     strSql.Append("Addtime='" + model.Addtime + "',");
     strSql.Append("Reply='" + model.Reply + "',");
     strSql.Append("Remark='" + model.Remark + "'");
     strSql.Append(" where Id=" + model.Id + " ");
     DbHelperSQL.ExecuteSql(strSql.ToString());
 }
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(JumbotOA.Entity.UserEntity model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update [OA_User] set ");
     strSql.Append("Pid=" + model.Pid + ",");
     strSql.Append("Uname='" + model.Uname + "',");
     strSql.Append("Did='" + model.Did + "',");
     strSql.Append("Upwd='" + model.Upwd + "',");
     strSql.Append("Position='" + model.Position + "',");
     strSql.Append("Setting='" + model.Setting + "',");
     strSql.Append("Uipaddress='" + model.Uipaddress + "'");
     strSql.Append(" where Uid=" + model.Uid + " ");
     DbHelperSQL.ExecuteSql(strSql.ToString());
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.WorklogEntity model)
 {
     dal.Update(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.WorklogEntity model)
 {
     return dal.Add(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JumbotOA.Entity.CallinfoEntity model)
 {
     return dal.Add(model);
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.TaskEntity model)
 {
     dal.Update(model);
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(JumbotOA.Entity.MessageEntity model)
 {
     dal.Update(model);
 }