Esempio n. 1
0
        private bool CheckTicketIdPrivilege(string ticketId)
        {
            decimal?staffTypeId   = StaffBiz.GetStaffType(HttpContext.Current.User.Identity.Name);
            string  staff_type_id = staffTypeId != null?staffTypeId.Value.ToString() : "";

            string username = HttpContext.Current.User.Identity.Name;

            if (!RoleBiz.CheckTicketIdPrivilege(ticketId, username, AppUtil.GetRecursiveStaff(username), AppUtil.GetRecursiveTeam(username), staff_type_id))
            {
                string message       = "ข้อมูลผู้มุ่งหวังรายนี้ ท่านไม่มีสิทธิในการมองเห็น";
                string lastOwnerName = LeadBiz.GetLastOwnerName(ticketId);

                if (!string.IsNullOrEmpty(lastOwnerName))
                {
                    message += " ณ ปัจจุบันผู้เป็นเจ้าของ คือ " + lastOwnerName.ToString().Trim();
                }

                AppUtil.ClientAlertAndRedirect(Page, message, "COC_SCR_002.aspx");
                return(false);
            }
            else
            {
                return(true);
            }
        }