コード例 #1
0
        private void InsertGoOutStateInfo(GoOutState info)
        {
            string sql = "insert into GoOutState(GoOutStateName, GoOutStateSeqNumber, GoOutStateDescribe)";

            sql += " VALUES('{0}', {1}, '{2}')";

            sql = string.Format
                  (
                sql,
                info.GoOutStateName,
                info.GoOutStateSeqNumber,
                info.GoOutStateDescribe
                  );
            SqlOperation.UpdateData(sql);
        }
コード例 #2
0
        private void InsertSalesLeaveStateInfo(SalesLeaveState info)
        {
            string sql = "insert into SalesLeaveState(SalesLeaveStateName, SalesLeaveStateSeqNumber, SalesLeaveStateDescribe)";

            sql += " VALUES('{0}', {1}, '{2}')";

            sql = string.Format
                  (
                sql,
                info.SalesLeaveStateName,
                info.SalesLeaveStateSeqNumber,
                info.SalesLeaveStateDescribe
                  );

            SqlOperation.UpdateData(sql);
        }
コード例 #3
0
        public void InsertDepartmentInfo(Department department)
        {
            string sql = "insert into Department(DepartmentName, Telephone, FaxNumber, Describe)";

            sql += " VALUES('{0}', '{1}', '{2}', '{3}')";

            sql = string.Format(sql, department.DepartmentName, department.Telephone, department.FaxNumber, department.Describe);

            try
            {
                SqlOperation.UpdateData(sql);
            }
            catch (Exception ex)
            {
                throw new Exception("添加数据异常:" + ex.Message);
            }
        }
コード例 #4
0
        private void InsertDayOffStateInfo(DayOffState info)
        {
            string sql = "insert into DayOffState(DayOffStateName, SequenceNumber, DayOffStateDescribe)";

            sql += " VALUES('{0}', {1}, '{2}')";

            sql = string.Format(sql, info.DayOffStateName, info.DayOffStateID, info.DayOffStateDescribe);

            try
            {
                SqlOperation.UpdateData(sql);
            }
            catch (Exception ex)
            {
                throw new Exception("添加数据异常:" + ex.Message);
            }
        }
コード例 #5
0
        private void UpdateExistsDayOffStateInfo(DayOffState info)
        {
            StringBuilder sqlBUilder = new StringBuilder();

            sqlBUilder.Append("update DayOffState set DayOffStateName = '{0}', SequenceNumber = {1}, ");
            sqlBUilder.Append("DayOffStateDescribe = '{2}' where DayOffStateID = {3}");

            string sql = string.Format
                         (
                sqlBUilder.ToString(),
                info.DayOffStateName,
                info.SequenceNumber,
                info.DayOffStateDescribe,
                info.DayOffStateID
                         );

            SqlOperation.UpdateData(sql);
        }
コード例 #6
0
        private void UpdateExistsTaskStateInfo(TaskState info)
        {
            StringBuilder sqlBuilder = new StringBuilder();

            sqlBuilder.Append("update TaskState set TaskStateName = '{0}', TaskStateSeqNumber = {1}, ");
            sqlBuilder.Append("TaskStateDescribe = '{2}' where TaskStateID = {3}");

            string sql = string.Format
                         (
                sqlBuilder.ToString(),
                info.TaskStateName,
                info.TaskStateSeqNumber,
                info.TaskStateDescribe,
                info.TaskStateID
                         );

            SqlOperation.UpdateData(sql);
        }
コード例 #7
0
        public void UpdateDepartmentInfo(Department department)
        {
            StringBuilder sqlBuilder = new StringBuilder();

            sqlBuilder.Append("update Department set DepartmentName = '{0}', Telephone = '{1}', ");
            sqlBuilder.Append("FaxNumber = '{2}', Describe = '{3}' where DepartmentID = {4}");

            string sql = string.Format
                         (
                sqlBuilder.ToString(),
                department.DepartmentName,
                department.Telephone,
                department.FaxNumber,
                department.Describe,
                department.DepartmentID
                         );

            SqlOperation.UpdateData(sql);
        }
コード例 #8
0
        public void DeleteDepartmentByID(string id)
        {
            string sql = "delete from Department where DepartmentID = " + id;

            try
            {
                SqlOperation.UpdateData(sql);
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                if (547 == ex.Number)
                {
                    throw new Exception("当前部门被引用, 删除失败!");
                }
                else
                {
                    throw new Exception("删除发生异常:" + ex.Message);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("删除发生异常:" + ex.Message);
            }
        }
コード例 #9
0
        private void DeleteDayOffStateInfoByID(string id)
        {
            string sql = "delete from DayOffState where DayOffStateID = " + id;

            try
            {
                SqlOperation.UpdateData(sql);
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                if (547 == ex.Number)
                {
                    throw new Exception("当前流程被引用, 删除失败!");
                }
                else
                {
                    throw new Exception("删除发生异常:" + ex.Message);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("删除发生异常:" + ex.Message);
            }
        }
コード例 #10
0
        public List <TaskState> GetTaskStateInfo(string parm, TaskStateGetDataMode mode)
        {
            string sql = null;

            if (TaskStateGetDataMode.GET_DATA_MODE_ALL == mode)
            {
                sql = "select * from TaskState";
            }
            else if (TaskStateGetDataMode.GET_DATA_MODE_BY_ID == mode)
            {
                sql = "select * from TaskState where TaskStateID = " + parm;
            }
            else if (TaskStateGetDataMode.GET_DATA_MODE_BY_NAME == mode)
            {
                sql = "select * from TaskState where TaskStateName = " + "'" + parm + "'";
            }

            SqlDataReader    objReader = SqlOperation.GetReader(sql);
            List <TaskState> list      = CopyDataToListFromSqlReader(objReader);

            objReader.Close();

            return(list);
        }
コード例 #11
0
        private void DeleteTravelStateByID(string id)
        {
            string sql = "delete from TravelState where TravelStateID = " + id;

            try
            {
                SqlOperation.UpdateData(sql);
            }
            catch (SqlException ex)
            {
                if (547 == ex.Number)
                {
                    throw new Exception("当前流程被引用, 删除失败!");
                }
                else
                {
                    throw new Exception("删除发生异常:" + ex.Message);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("删除发生异常:" + ex.Message);
            }
        }