public ActionResult Index()
        {
            Index model = new Models.Index();

            SessionContext.Current.ActiveUser.MenuId = "0";

            DataSet totalActiveTask = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit ", new ArrayList {
                "is_active_bit"
            }, new ArrayList {
                1
            });
            DataSet totalActiveFinishedTask = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi  from tsk_tasks_v where is_active_bit=@is_active_bit and task_status_id=@task_status_id ", new ArrayList {
                "is_active_bit", "task_status_id"
            }, new ArrayList {
                1, 6
            });
            DataSet totalActiveClosedTask = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit and task_status_id=@task_status_id ", new ArrayList {
                "is_active_bit", "task_status_id"
            }, new ArrayList {
                1, 7
            });
            DataSet totalActiveProcessedTask = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit  and task_status_id in (2,3,4,8)  ", new ArrayList {
                "is_active_bit"
            }, new ArrayList {
                1
            });

            model.totalActiveTask          = (totalActiveTask != null && totalActiveTask.Tables[0].Rows.Count > 0) ? totalActiveTask.Tables[0].Rows[0]["kayit_sayisi"].ToString():"0";
            model.totalActiveFinishedTask  = (totalActiveFinishedTask != null && totalActiveFinishedTask.Tables[0].Rows.Count > 0) ? totalActiveFinishedTask.Tables[0].Rows[0]["kayit_sayisi"].ToString():"0";
            model.totalActiveClosedTask    = (totalActiveClosedTask != null && totalActiveClosedTask.Tables[0].Rows.Count > 0) ? totalActiveClosedTask.Tables[0].Rows[0]["kayit_sayisi"].ToString():"0";
            model.totalActiveProcessedTask = (totalActiveProcessedTask != null && totalActiveProcessedTask.Tables[0].Rows.Count > 0) ? totalActiveProcessedTask.Tables[0].Rows[0]["kayit_sayisi"].ToString() : "0";

            DataSet totalActiveTaskMy = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit and assigned_user_id=@assigned_user_id", new ArrayList {
                "is_active_bit", "assigned_user_id"
            }, new ArrayList {
                1, SessionContext.Current.ActiveUser.UserUid
            });
            DataSet totalActiveFinishedTaskMy = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi  from tsk_tasks_v where is_active_bit=@is_active_bit and task_status_id=@task_status_id  and assigned_user_id=@assigned_user_id", new ArrayList {
                "is_active_bit", "task_status_id", "assigned_user_id"
            }, new ArrayList {
                1, 6, SessionContext.Current.ActiveUser.UserUid
            });
            DataSet totalActiveClosedTaskMy = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit and task_status_id=@task_status_id and assigned_user_id=@assigned_user_id", new ArrayList {
                "is_active_bit", "task_status_id", "assigned_user_id"
            }, new ArrayList {
                1, 7, SessionContext.Current.ActiveUser.UserUid
            });
            DataSet totalActiveProcessedTaskMy = BaseDB.DBManager.AppConnection.GetDataSet("select count(*) kayit_sayisi from tsk_tasks_v where is_active_bit=@is_active_bit  and task_status_id in (2,3,4,8) and  assigned_user_id=@assigned_user_id", new ArrayList {
                "is_active_bit", "assigned_user_id"
            }, new ArrayList {
                1, SessionContext.Current.ActiveUser.UserUid
            });


            model.totalActiveTaskMy          = (totalActiveTaskMy != null && totalActiveTaskMy.Tables[0].Rows.Count > 0) ? totalActiveTaskMy.Tables[0].Rows[0]["kayit_sayisi"].ToString() : "0";
            model.totalActiveFinishedTaskMy  = (totalActiveFinishedTaskMy != null && totalActiveFinishedTaskMy.Tables[0].Rows.Count > 0) ? totalActiveFinishedTaskMy.Tables[0].Rows[0]["kayit_sayisi"].ToString() : "0";
            model.totalActiveClosedTaskMy    = (totalActiveClosedTaskMy != null && totalActiveClosedTaskMy.Tables[0].Rows.Count > 0) ? totalActiveClosedTaskMy.Tables[0].Rows[0]["kayit_sayisi"].ToString() : "0";
            model.totalActiveProcessedTaskMy = (totalActiveProcessedTaskMy != null && totalActiveProcessedTaskMy.Tables[0].Rows.Count > 0) ? totalActiveProcessedTaskMy.Tables[0].Rows[0]["kayit_sayisi"].ToString() : "0";

            #region Görev Bitiş Tarihi Geçmiş Olanların Bildirimleri Oluşturuluyor

            try
            {
                TaskRepository  tskDB        = RepositoryManager.GetRepository <TaskRepository>();
                GenelRepository gnlDB        = RepositoryManager.GetRepository <GenelRepository>();
                DataSet         dsExpireTask = tskDB.SendTaskExpireNotification();

                foreach (DataRow row in dsExpireTask.Tables[0].Rows)
                {
                    gnlDB.AddNotification(Guid.Parse(row["task_id"].ToString()), Guid.Parse(row["task_user_id"].ToString()), (int)Enums.NotificationType.Expire, (int)Enums.NotificationModuleType.Task, Resources.GlobalResource.task_expire_end_date_title, Resources.GlobalResource.task_expire_end_date_body);
                    gnlDB.Kaydet();


                    gnlDB.AddNotification(Guid.Parse(row["task_id"].ToString()), Guid.Parse(row["assigned_user_id"].ToString()), (int)Enums.NotificationType.Expire, (int)Enums.NotificationModuleType.Task, Resources.GlobalResource.task_expire_end_date_title, Resources.GlobalResource.task_expire_end_date_body);
                    gnlDB.Kaydet();

                    tsk_tasks task = new tsk_tasks();
                    task = tskDB.GetTask(Guid.Parse(row["task_id"].ToString()));


                    tskDB.TaskMailSend(Guid.Parse(row["task_user_id"].ToString()), task.order_id.ToString(), task.task_name, task.task_id, "Task End Date Expired", "", "", "99");
                    tskDB.TaskMailSend(Guid.Parse(row["assigned_user_id"].ToString()), task.order_id.ToString(), task.task_name, task.task_id, "Task End Date Expired", "", "", "99");
                }
            }
            catch (Exception exp)
            {
            }


            #endregion



            return(View(model));
        }