请高手 帮忙把这段vb.net 代码转换成 c# 代码

wangxiucn 2014-01-20 05:40:33
''' <summary>
''' 获取或设置所有数据权限
''' </summary>
''' <param name="cUserName">用户名</param>
''' <param name="cDataPowerType">数据权限类型</param>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property AllPower(ByVal cUserName As String, ByVal cDataPowerType As String, Optional ByVal cmd As System.Data.Common.DbCommand = Nothing) As Boolean
Get
Dim cClass As String = "数据权限"
Dim cVarName As String = cUserName & "_" & cDataPowerType
Dim Value As String = DAL.Var.Var.Create.getValue(cClass, cVarName, cmd)
If tostr(Value) = "" Or tostr(Value) = "1" Then
Return True
ElseIf tostr(Value) = "0" Then
Return False
End If
End Get
Set(ByVal value As Boolean)
Dim cClass As String = "数据权限"
Dim cVarName As String = cUserName & "_" & cDataPowerType
Dim cValue As String = IIf(value, "1", "0")
DAL.Var.Var.Create.Save(cClass, cVarName, cValue, cmd)
End Set
End Property
End Class
...全文
147 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复

Public bool AllPower(String cUserName ,String cDataPowerType,Sqlcommand cmd )
{
 String  cClass = "数据权限";
String cVarName =cUserName +"_"+cDataPowerType;
String Value = DAL.Var.Var.Create.getValue(cClass, cVarName, cmd);
  If (tostr(Value) == "" || tostr(Value) == "1" )
                    Return True;
            Return False;
  }
}
wangxiucn 2014-01-21
  • 打赏
  • 举报
回复
求高手
wangxiucn 2014-01-21
  • 打赏
  • 举报
回复
那个 改过来的 代码不行
wangxiucn 2014-01-21
  • 打赏
  • 举报
回复
其实我那段代码 是vb.net 一个带参数的属性 只是我想改写成 c# 代码,我也知道 c#属性是不能参数的,有什么好的把办 能实现vb.net 同样的功能
wangxiucn 2014-01-20
  • 打赏
  • 举报
回复
这写法 好像不对哦 朋友
江湖评谈 2014-01-20
  • 打赏
  • 举报
回复
public bool PropertyAllPower(string cUserName,stirngcDataPowerType,system.data.common.dbcommand optional) { string cClass=""; string cvarname=""; string value=DAL.Var.Var.Create.getValue(cClass, cVarName, cmd); if(tostr(value_==""|| tostr(value)="1") { return ture; } else if(tostr(value)="0") { return false; } set(bool value) string cclass=""; string cvarname=""; string cValue= IIf(value, "1", "0") }

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧