using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FrameworkDAL.DTO.Menu { public class RoleVsMenuForMenuDTO { private int roleid; private string rolename; private byte ispresent; private string allow; private string view; private string insert; private string update; private string delete; private string print; private string export; public int RoleId { get { return roleid; } set { roleid = value; } } public string RoleName { get { return rolename; } set { rolename = value; } } public byte IsPresent { get { return ispresent; } set { ispresent = value; } } public string Allow { get { return allow; } set { if (value == null) { allow = "111111"; View = "1"; Insert = "1"; Update = "1"; Delete = "1"; Print = "1"; Export = "1"; } else { allow = value; View = "1"; Insert = "1"; Update = "1"; Delete = "1"; Print = "1"; Export = "1"; if (value.Length == 1) { View = value.Substring(0, 1); } else if (value.Length == 2) { View = value.Substring(0, 1); Insert = value.Substring(1, 1); } else if (value.Length == 3) { View = value.Substring(0, 1); Insert = value.Substring(1, 1); Update = value.Substring(2, 1); } else if (value.Length == 4) { View = value.Substring(0, 1); Insert = value.Substring(1, 1); Update = value.Substring(2, 1); Delete = value.Substring(3, 1); } else if (value.Length == 5) { View = value.Substring(0, 1); Insert = value.Substring(1, 1); Update = value.Substring(2, 1); Delete = value.Substring(3, 1); Print = value.Substring(4, 1); } else if (value.Length == 6) { View = value.Substring(0, 1); Insert = value.Substring(1, 1); Update = value.Substring(2, 1); Delete = value.Substring(3, 1); Print = value.Substring(4, 1); Export = value.Substring(5, 1); } } } } public string View { get { return view; } set { view = value; } } public string Insert { get { return insert; } set { insert = value; } } public string Update { get { return update; } set { update = value; } } public string Delete { get { return delete; } set { delete = value; } } public string Print { get { return print; } set { print = value; } } public string Export { get { return export; } set { export = value; } } private int isavailable; public int IsAvailable { get { return isavailable; } set { isavailable = value; } } } }