Exemplo n.º 1
0
        //部门表添加
        public static object department_ADD(department me)
        {
            sqltext = "insert into department (name)values('" + me.Name + "')";
            int i = (int)DAL.SQLHELPER.ExecuteNonQuery(sqltext);

            return(i);
        }
Exemplo n.º 2
0
        //部门表假删除
        //部门表查询
        public static DataSet selectByDID(department me)
        {
            sqltext = "select did as 部门编号,name as 部门 from  department where did='" + me.Did + "'";
            DataSet met = DAL.SQLHELPER.ExecuteDataSet(sqltext);

            return(met);
        }
Exemplo n.º 3
0
        //修改
        public static int departmentXiuGai(department d)
        {
            NewHope4Entities ent = new NewHope4Entities();
            var obj = ent.department.Find(d.Did);

            obj.DName = d.DName;
            return(ent.SaveChanges());
        }
Exemplo n.º 4
0
        //删除
        public static int departmentShanChu(department d)
        {
            NewHope4Entities ent = new NewHope4Entities();
            var obj = ent.department.Find(d.Did);

            obj.state = 1;
            return(ent.SaveChanges());
        }
Exemplo n.º 5
0
        // role角色表新增
        public static int departmentXinZeng(department d)
        {
            NewHope4Entities ent = new NewHope4Entities();

            d.CreationDate = DateTime.Now;
            d.state        = 0;
            ent.department.Add(d);
            return(ent.SaveChanges());
        }
Exemplo n.º 6
0
        public void updateks(department m)
        {
            string sql = "update department set name=@name,pid=@pid,must=@must,valid=@valid,isExam=@isExam where ID=@ID";

            SqlParameter[] pars = new SqlParameter[]
            {
                new SqlParameter("@name", m.name),
                new SqlParameter("@pid", m.pid),
                new SqlParameter("@must", m.must),
                new SqlParameter("@valid", m.valid),
                new SqlParameter("@isExam", m.isExam),
                new SqlParameter("@ID", m.id)
            };
            SqlHelper.ExcuteNonQuery(sql, pars);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 保存部门或科室
        /// </summary>
        /// <param name="m"></param>
        public void save(department m)
        {
            string sql = "insert into department(companyID,name,pid,type,valid,must,isExam)values(@companyID,@name,@pid,@type,@valid,@must,@isExam)";

            SqlParameter[] pars = new SqlParameter[]
            {
                new SqlParameter("@companyID", m.companyID),
                new SqlParameter("@name", m.name),
                new SqlParameter("@pid", m.pid),
                new SqlParameter("@type", m.type),
                new SqlParameter("@valid", m.valid),
                new SqlParameter("@must", m.must),
                new SqlParameter("@isExam", m.isExam)
            };
            SqlHelper.ExcuteNonQuery(sql, pars);
        }
Exemplo n.º 8
0
		private void detach_departments(department entity)
		{
			this.SendPropertyChanging();
			entity.company = null;
		}
Exemplo n.º 9
0
 partial void Deletedepartment(department instance);
Exemplo n.º 10
0
 partial void Updatedepartment(department instance);
Exemplo n.º 11
0
 partial void Insertdepartment(department instance);