public string Delete(int id)
 {
     try
     {
         if (id < 1)
         {
             return("Lütfen Geçerli Bir Departman Seçiniz");
         }
         return(departmentDal.Delete(id));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Пример #2
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        DepartmentDal departmentDal = new DepartmentDal();
        int           deleteCount   = 0;

        foreach (GridViewRow row in gvMain.Rows)
        {
            if (row.Cells[0].Controls.Count != 0 && ((CheckBox)row.Cells[0].Controls[0]).Checked)
            {
                departmentDal.Delete(row.Cells[2].Text);
                deleteCount++;
            }
        }
        if (deleteCount == 0)
        {
            JScript.Instance.ShowMessage(UpdatePanel1, "请选择要删除的记录。");
        }
        else
        {
            JScript.Instance.ShowMessage(UpdatePanel1, "删除数据成功。");
        }
        BindData();
    }
Пример #3
0
 /// <summary>
 /// 根据指定条件删除部门
 /// </summary>
 /// <param name="departmentSearcher">部门查询对象</param>
 /// <param name="tran">中间事务对象</param>
 public static void DeleteDepartment(DepartmentSearcher departmentSearcher, ICTransaction tran)
 {
     DepartmentDal.Delete(departmentSearcher, tran);
 }
Пример #4
0
 /// <summary>
 /// 根据指定条件删除部门
 /// </summary>
 /// <param name="departmentSearcher">部门查询对象</param>
 public static void DeleteDepartment(DepartmentSearcher departmentSearcher)
 {
     DepartmentDal.Delete(departmentSearcher);
 }
Пример #5
0
 /// <summary>
 /// 删除部门
 /// </summary>
 /// <param name="departmentId">部门ID</param>
 /// <param name="tran">中间事务对象</param>
 public static void DeleteDepartment(string departmentId, ICTransaction tran)
 {
     DepartmentDal.Delete(departmentId, tran);
 }
Пример #6
0
 /// <summary>
 /// 删除部门
 /// </summary>
 /// <param name="departmentId">部门ID</param>
 public static void DeleteDepartment(string departmentId)
 {
     DepartmentDal.Delete(departmentId);
 }