Beispiel #1
0
 public async Task <JsonResult> EditDepartment(long depId, string Name, string Title, string Defination)
 {
     try
     {
         using (business.Management.DepartmentManagement.DepartmentFunctions departmentM = new business.Management.DepartmentManagement.DepartmentFunctions())
         {
             Department newDepartment = new Department
             {
                 Name       = Name,
                 Title      = Title,
                 Definition = Defination
             };
             if (departmentM.updateDepartment(newDepartment, depId))
             {
                 return(await Task.Run(() => Json(new { result = true, message = "Departman güncellendi" }, JsonRequestBehavior.AllowGet)));
             }
             else
             {
                 return(await Task.Run(() => Json(new { result = false, message = "Departman güncellenemedi." }, JsonRequestBehavior.AllowGet)));
             }
         }
     }
     catch (Exception)
     {
         return(await Task.Run(() => Json(new { result = false, message = "Hata oluştu." }, JsonRequestBehavior.AllowGet)));
     }
 }
 public void editDepartment(long id)
 {
     using (business.Management.DepartmentManagement.DepartmentFunctions department = new business.Management.DepartmentManagement.DepartmentFunctions())
     {
         departmentM = department.findDepartment(id);
     }
 }
 public void getDepartments()
 {
     using (business.Management.DepartmentManagement.DepartmentFunctions dm = new business.Management.DepartmentManagement.DepartmentFunctions())
     {
         var user = web.Session.SessionUser.User;
         getCustomerFirms(user.Firm_Id);
         departments = dm.ListDepartment(user.Firm_Id);
     }
 }
Beispiel #4
0
 public async Task <JsonResult> DeleteDepartment(long id)
 {
     try
     {
         using (business.Management.DepartmentManagement.DepartmentFunctions departmentM = new business.Management.DepartmentManagement.DepartmentFunctions())
         {
             if (departmentM.deleteDepartment(id))
             {
                 return(await Task.Run(() => Json(new { result = true, message = "Departman silindi." }, JsonRequestBehavior.AllowGet)));
             }
             else
             {
                 return(await Task.Run(() => Json(new { result = false, message = "Departman silinemedi." }, JsonRequestBehavior.AllowGet)));
             }
         }
     }
     catch (Exception)
     {
         return(await Task.Run(() => Json(new { result = false, message = "Hata oluştu." }, JsonRequestBehavior.AllowGet)));
     }
 }
        public JsonResult wflowSelect(long depId)
        {
            try
            {
                using (business.Management.DepartmentManagement.DepartmentFunctions dm = new business.Management.DepartmentManagement.DepartmentFunctions())
                {
                    List <WorkFlow> wflowList = dm.findDepartment(depId).WorkFlows.ToList();

                    if (wflowList != null && !wflowList.Count.Equals(0))
                    {
                        return(Json(new { result = true, list2 = wflowList }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { result = false }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception)
            {
                return(Json(new { result = false }, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #6
0
        public JsonResult workflowListPost(long departmentId)
        {
            try
            {
                using (business.Management.DepartmentManagement.DepartmentFunctions pm = new business.Management.DepartmentManagement.DepartmentFunctions())
                {
                    List <WorkFlow> workflowList = pm.findDepartment(departmentId).WorkFlows.ToList();

                    if (workflowList != null && !workflowList.Count.Equals(0))
                    {
                        return(Json(new { result = true, list = workflowList }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { result = false, message = "İş akışı oluşturulmamış." }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception)
            {
                return(Json(new { result = false, message = "Hata oluştu." }, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #7
0
        public async Task <JsonResult> CreateDepartment(long partnerId, string Name, string Title, string Defination)
        {
            try
            {
                using (business.Management.DepartmentManagement.DepartmentFunctions depM = new business.Management.DepartmentManagement.DepartmentFunctions())
                {
                    Department newDep = new Department
                    {
                        Name          = Name,
                        Title         = Title,
                        Definition    = Defination,
                        Register_Date = DateTime.Now,
                        Status        = true
                    };
                    depM.addDepartment(newDep, partnerId);

                    return(await Task.Run(() => Json(new { result = true, message = "Departman oluşturuldu." }, JsonRequestBehavior.AllowGet)));
                }
            }
            catch (Exception)
            {
                return(await Task.Run(() => Json(new { result = false, message = "Hata oluştu." }, JsonRequestBehavior.AllowGet)));
            }
        }