本文整理汇总了C#中BKIT.Model.DataAccess.getQuyenTruycapByID方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.getQuyenTruycapByID方法的具体用法?C# DataAccess.getQuyenTruycapByID怎么用?C# DataAccess.getQuyenTruycapByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BKIT.Model.DataAccess
的用法示例。
在下文中一共展示了DataAccess.getQuyenTruycapByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TabPageAccessPermission_Update
private void TabPageAccessPermission_Update()
{
DataAccess da = new DataAccess();
Nhanvien nhanvien = da.getNhanvienbyUserName(currentItem.Username);
if (nhanvien.Loai != "Quản lý" && Program.userLevel == Level.Admin)
{
chkListBoxPermission.Enabled = true;
simpleButtonDefaut.Enabled = true;
}
else
{
chkListBoxPermission.Enabled = false;
simpleButtonDefaut.Enabled = false;
}
QuyenTruycap quyentruycap = da.getQuyenTruycapByID(nhanvien.IDQuyenTruycap); // item in list box
if (quyentruycap == null)
{
quyentruycap = getDefaultPermissionByGroupname(nhanvien.Loai);
}
chkListBoxPermission_Update(quyentruycap);
}
示例2: chkListBoxPermission_ItemCheck
private void chkListBoxPermission_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
if (enableItemCheckEvent == false)
return;
DataAccess da = new DataAccess();
Nhanvien employee = da.getNhanvienbyUserName(currentItem.Username);
QuyenTruycap permission = da.getQuyenTruycapByID(employee.IDQuyenTruycap);
permission.Vanhanh = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Vanhanh)].CheckState);
permission.HoadonNhap = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Hoadonnhap)].CheckState);
permission.Setting = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Caidat)].CheckState);
permission.Nhanvien = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Nhanvien)].CheckState);
permission.HoadonxuatSP = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Hoadonxuat)].CheckState);
permission.Sanpham = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Sanpham)].CheckState);
permission.Phong = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Phong)].CheckState);
permission.Report = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Baocao)].CheckState);
permission.Khachhang = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Khachhang)].CheckState);
permission.Khuyenmai = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Khuyenmai)].CheckState);
permission.Tonkho = Convert.ToInt32(
chkListBoxPermission.Items[Convert.ToInt32(Quyen.Tonkho)].CheckState);
if (lblStatusUpdatePermission.ForeColor == System.Drawing.Color.Black)
{
lblStatusUpdatePermission.ForeColor = System.Drawing.Color.Blue;
}
else
{
lblStatusUpdatePermission.ForeColor = System.Drawing.Color.Black;
}
permission.IDQuyentruycap = employee.IDQuyenTruycap;
permission.TenLoaiNV = employee.Loai;
permission.Ngaythietlap = DateTime.Now.Date;
da.updateQuyenTruycap(permission);
}