示例#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);
            }
        }
        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);
            }
        }
        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);
            }
        }
        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
        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);
            }
        }