예제 #1
0
        public void EditApprove(Approve ap)
        {
            string sql = string.Format(" update Approve set Title='{0}',BeginDate='{1}',EndDate='{2}',Reason='{3}' where ApproveID='{4}'"
                                       , ap.Title, ap.BeginDate, ap.EndDate, ap.Reason, ap.ApproveID);

            DBhelper.Change(sql);
        }
예제 #2
0
        public void AppleApprove(string Uid, string Res, string Rema, string AppId)
        {
            string sql = string.Format(" update Approve set ApproveUser='******', ApproveDate=GETDATE() ,Status='1',Result='{1}',Remark='{2}' where ApproveID='{3}'"
                                       , Uid, Res, Rema, AppId);

            DBhelper.Change(sql);
        }
예제 #3
0
        public void EditDepart(Department dp, string OldName)
        {
            string sql = string.Format("update Department set DeptName='{0}',ManagerID='{1}',DeptInfo='{2}'   where DeptName='{3}'",
                                       dp.DeptName, dp.ManagerID, dp.DeptInfo, OldName);

            DBhelper.Change(sql);
        }
예제 #4
0
        public void DelteDepart(string OldName)
        {
            string sql = string.Format("delete from Department where DeptName='{0}'",
                                       OldName);

            DBhelper.Change(sql);
        }
예제 #5
0
        public void DeleteDate(string date)
        {
            DateTime time = Convert.ToDateTime(date);
            string   sql  = "delete from AttendanceSetting where year(Date)=" + time.Year + " and MONTH(Date)=" + time.Month;

            DBhelper.Change(sql);
        }
예제 #6
0
        public void AddApprove(Approve ap)
        {
            //(select ManagerID from Department  where DeptID= (select DeptID from UserInfo where UserName='******'))
            string sql = string.Format("insert into Approve values ((select userid from UserInfo where UserName='******'),'{1}','{2}','{3}','{4}',null,getdate(),null,'0',null,null)"
                                       , ap.ApplyUser, ap.Title, ap.BeginDate, ap.EndDate, ap.Reason);

            DBhelper.Change(sql);
        }
예제 #7
0
        public void EditUser(UserInfo us)
        {
            string sql;

            sql = string.Format(
                "update UserInfo set Password='******',Cellphone='{2}' where UserID='{0}'"
                , us.UserID, us.Password, us.Cellphone);
            DBhelper.Change(sql);
        }
예제 #8
0
        public void UpdateAttanceInfo(List <AttendanceInfo> list)
        {
            string sql = "";

            foreach (AttendanceInfo item in list)
            {
                sql += "insert into AttendanceInfo values('" + item.UserID + "','" + item.FaceTime + "') ";
            }
            DBhelper.Change(sql);
        }
예제 #9
0
        public void EditPeople(UserInfo us)
        {
            string sql;

            if (us.DeptID != null)
            {
                sql = string.Format(
                    "update UserInfo set UserName='******',DeptID='{2}',Cellphone='{3}',UserType='{4}'   where UserID='{0}'"
                    , us.UserID, us.UserName, us.DeptID, us.Cellphone, us.UserType);
            }
            else
            {
                sql = string.Format(
                    "update UserInfo set UserName='******',DeptID=null,Cellphone='{2}',UserType='{3}'   where UserID='{0}'"
                    , us.UserID, us.UserName, us.Cellphone, us.UserType);
            }
            DBhelper.Change(sql);
        }
예제 #10
0
        public void AddPeople(UserInfo us)
        {
            string sql;

            if (us.DeptID != null)
            {
                sql = string.Format(
                    "insert into  UserInfo values ('{0}','{1}','{2}',null,'{3}','{4}')"
                    , us.UserID, us.UserName, us.DeptID, us.Cellphone, us.UserType);
            }
            else
            {
                sql = string.Format(
                    "insert into  UserInfo values ('{0}','{1}',null,null,'{2}','{3}')"
                    , us.UserID, us.UserName, us.Cellphone, us.UserType);
            }

            DBhelper.Change(sql);
        }
예제 #11
0
        public void DeleteApprove(string id)
        {
            string sql = " delete from Approve where ApproveID='" + id + "'";

            DBhelper.Change(sql);
        }
예제 #12
0
        public void AddDepart(Department dp)
        {
            string sql = string.Format("insert into Department values ('{0}','{1}','{2}')", dp.DeptName, dp.ManagerID, dp.DeptInfo);

            DBhelper.Change(sql);
        }
예제 #13
0
        public void DelPeople(string us)
        {
            string sql = "delete from userInfo where UserID='" + us + "'";

            DBhelper.Change(sql);
        }