本文整理汇总了C#中UDS.Components.Database.MakeOutParam方法的典型用法代码示例。如果您正苦于以下问题:C# Database.MakeOutParam方法的具体用法?C# Database.MakeOutParam怎么用?C# Database.MakeOutParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UDS.Components.Database
的用法示例。
在下文中一共展示了Database.MakeOutParam方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdminBBS
/// <summary>
/// �ж��Ƿ��й���Ȩ��
/// </summary>
/// <param name="username">�û���</param>
/// <returns>bool</returns>
public bool AdminBBS(string username,int classid)
{
if(classid!=0)
{
int actid = 8;
Database db = new Database();
SqlParameter[] prams = {
db.MakeInParam("@Class_ID",SqlDbType.Int,4,classid),
db.MakeInParam("@Username",SqlDbType.VarChar,100,username),
db.MakeInParam("@Act_ID",SqlDbType.Int,4,actid),
db.MakeOutParam("@ReturnValue",SqlDbType.Int,4)
};
try
{
db.RunProc("sp_GetAccessPermission",prams);
// ����������
// return(true);
return((Int32.Parse(prams[3].Value.ToString())==1)?true:false);
}
catch(Exception ex)
{
Error.Log(ex.Message);
throw new Exception("BBSȨ���жϴ���!",ex);
}
}
else
return(false);
}
示例2: AddTask
/// <summary>
/// �������
/// </summary>
/// <param name="TaskClass">Task��</param>
public string AddTask(TaskClass tc)
{
// create data object and params
Database data = new Database();
string TaskID = "";
SqlParameter[] prams = {
data.MakeInParam("@ArrangedBy", SqlDbType.VarChar, 20, tc.ArrangedBy),
data.MakeInParam("@Subject", SqlDbType.VarChar, 50, tc.Subject),
data.MakeInParam("@Detail", SqlDbType.VarChar, 300, tc.Detail),
data.MakeInParam("@ProjectID", SqlDbType.SmallInt,20, tc.ProjectID),
data.MakeInParam("@StartTime", SqlDbType.DateTime, 20, DateTime.Parse(tc.StartTime.ToString())),
data.MakeInParam("@EndTime", SqlDbType.DateTime, 20, DateTime.Parse(tc.EndTime.ToString())),
data.MakeInParam("@Attribute", SqlDbType.Int, 1, tc.Attribute),
data.MakeInParam("@Type", SqlDbType.Int, 1, tc.Type),
data.MakeInParam("@Status", SqlDbType.Bit , 1, tc.Status),
data.MakeInParam("@Tag", SqlDbType.Int, 1, tc.Tag),
data.MakeInParam("@IsAwake", SqlDbType.Bit, 1, tc.IsAwake),
data.MakeInParam("@AwakeTime", SqlDbType.DateTime, 20, DateTime.Parse(tc.AwakeTime)),
data.MakeInParam("@ContractList", SqlDbType.VarChar, 50, tc.ContractList),
data.MakeInParam("@CooperatorList", SqlDbType.VarChar, 200, tc.CooperatorList),
data.MakeOutParam("@InsertedTaskID", SqlDbType.Int,20)
};
try
{
data.RunProc("SP_AddTask", prams);
TaskID = prams[14].Value.ToString();
if (TaskID == string.Empty )
return null;
else
return TaskID;
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("������ӳ���!",ex);
}
}
示例3: AddDocBody
/// <summary>
/// �ļ��������
/// </summary>
/// <param name="DocBody"> �ļ�������</param>
public string AddDocBody(DocBody docbody)
{
// create data object and params
Database data = new Database();
string DocID = "";
SqlParameter[] prams = {
data.MakeInParam("@ClassID", SqlDbType.Int, 20, docbody.DocClassID),
data.MakeInParam("@DocTitle", SqlDbType.NVarChar, 300, docbody.DocTitle),
data.MakeInParam("@DocContent",SqlDbType.NText, 8000,docbody.DocContent),
data.MakeInParam("@DocApprover", SqlDbType.NVarChar,200, docbody.DocApprover),
data.MakeInParam("@DocApproveDate", SqlDbType.NVarChar, 20, docbody.DocApproveDate),
data.MakeInParam("@DocApproved", SqlDbType.Int, 1, docbody.DocApproved),
data.MakeInParam("@DocType", SqlDbType.Int, 2, docbody.DocType),
data.MakeInParam("@DocAttribute", SqlDbType.Int , 2, docbody.DocAttribute),
data.MakeInParam("@DocAddedBy", SqlDbType.NVarChar, 300, docbody.DocAddedBy),
data.MakeInParam("@DocAddedDate", SqlDbType.DateTime, 300,DateTime.Parse(docbody.DocAddedDate)),
data.MakeOutParam("@CurrentDocID", SqlDbType.Int, 2)
};
try
{
data.RunProc("SP_Ext_AddDocument", prams);
DocID = prams[10].Value.ToString();
if (DocID == string.Empty )
return null;
else
return DocID;
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("�ĵ��������Ӵ���!",ex);
}
finally
{
if (data != null)
{
data.Close();
data.Dispose();
}
}
}
示例4: GetAccessPermission
/// <summary>
/// 判断用户对对象是否有某个权限
/// </summary>
/// <param name="UserName">用户名</param>
/// <param name="classID">被检查的对象</param>
/// <param name="actID">权限ID</param>
/// <returns>是否有权限</returns>
public bool GetAccessPermission(string UserName,int classID,int actID)
{
int flag = 0;
// 定义数据库操作类及DataReader
Database data = new Database();
// 执行存储过程,并返回SqlDataReader对象
SqlParameter[] prams = {
data.MakeInParam("@Class_ID" , SqlDbType.Int, 20, classID),
data.MakeInParam("@UserName" , SqlDbType.NVarChar, 20, UserName),
data.MakeInParam("@Act_ID" , SqlDbType.Int, 20, actID),
// data.MakeInParam("@Inheit" , SqlDbType.Bit, 1, 1),
data.MakeOutParam("@ReturnValue",SqlDbType.Int,20)
};
try
{
data.RunProc("sp_GetAccessPermission",prams);
flag = Int32.Parse(prams[3].Value.ToString());
return (flag==1)?true:false;
}
catch(Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("获取访问权出错",ex);
}
finally
{
if (data != null)
{
data.Close();
data.Dispose();
data = null;
}
}
}
示例5: Login
/// <summary>
/// ��½��֤
/// </summary>
/// <param name="userName">�û���</param>
/// <param name="password">����</param>
/// <returns>�����û�ID</returns>
public string Login(string userName, string password)
{
string UserID,IsNeedKey;
Database data = new Database();
SqlParameter[] prams = {
data.MakeInParam("@username", SqlDbType.VarChar, 25, userName),
data.MakeInParam("@password", SqlDbType.VarChar, 25, password),
data.MakeOutParam("@UserID", SqlDbType.VarChar, 25),
data.MakeOutParam("@IsNeedKey", SqlDbType.Bit, 1)
};
data.RunProc("sp_StaffLogin", prams);
UserID = (string) prams[2].Value;
IsNeedKey = prams[3].Value.ToString();
if (UserID == string.Empty)
return null;
else
return UserID+"-"+IsNeedKey;
}
示例6: Send
/// <summary>
/// �����ʼ���ֻ�������ݿ����
/// </summary>
/// <param name="mailbody">Mail��</param>
public string Send(MailMainBody mailbody)
{
// create data object and params
Database data = new Database();
string MailID = null;
SqlParameter[] prams = {
data.MakeInParam("@MailFolderType", SqlDbType.Int, 20, mailbody.MailFolderType),
data.MakeInParam("@MailReceiverStr", SqlDbType.VarChar, 300, mailbody.MailReceiverStr),
data.MakeInParam("@MailSendDate", SqlDbType.DateTime, 20, DateTime.Parse(mailbody.MailSendDate)),
data.MakeInParam("@MailSendLevel", SqlDbType.SmallInt,20, mailbody.MailSendLevel),
data.MakeInParam("@MailSender", SqlDbType.NVarChar, 20, mailbody.MailSender),
data.MakeInParam("@MailReceiver", SqlDbType.NVarChar, 20, mailbody.MailReceiver),
data.MakeInParam("@MailSubject", SqlDbType.NVarChar, 50, mailbody.MailSubject),
data.MakeInParam("@MailBody", SqlDbType.Text , 300000, mailbody.MailBody),
data.MakeInParam("@MailCcToAddr", SqlDbType.NVarChar, 300, mailbody.MailCcToAddr),
data.MakeInParam("@MailBccToAddr", SqlDbType.NVarChar, 300, mailbody.MailBccToAddr),
data.MakeInParam("@MailReadFlag", SqlDbType.Bit, 1, mailbody.MailReadFlag),
data.MakeInParam("@MailTypeFlag", SqlDbType.Bit, 1, mailbody.MailTypeFlag),
data.MakeInParam("@MailClassID", SqlDbType.Int, 1, mailbody.MailClassID),
data.MakeInParam("@MailImportance", SqlDbType.Int, 1, mailbody.MailImportance),
data.MakeOutParam("@MailID", SqlDbType.Int,20)
};
try
{
data.RunProc("SP_MailSend", prams);
MailID = prams[14].Value.ToString();
if (MailID == string.Empty )
return null;
else
return MailID;
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("�ʼ����ͳ���!",ex);
}
}
示例7: SendLocalMsg
/// <summary>
/// ����վ�ڶ���Ϣ
/// </summary>
/// <param name="sender">�������û���</param>
/// <param name="receivers">�������û��������ö���������</param>
/// <param name="msg">����Ϣ����</param>
/// <param name="sendtime">����Ϣ����ʱ��</param>
/// <returns>����ֵ</returns>
public void SendLocalMsg(string sender,string receivers,string msg,DateTime sendtime)
{
string newmsgid = "0";
Database data = new Database();
#region ����Ϣ�����ݿ⣬����MsgID
SqlParameter[] prams1 = {
data.MakeInParam("@sender", SqlDbType.VarChar, 50, sender),
data.MakeInParam("@content", SqlDbType.VarChar, 255, msg),
data.MakeInParam("@type", SqlDbType.Int, 1, 1),
data.MakeInParam("@sendtime", SqlDbType.DateTime, 30, sendtime),
data.MakeOutParam("@newmsgid", SqlDbType.Int, 4)
};
try
{
data.RunProc("SP_SMS_SendLocalMsg", prams1);
newmsgid = prams1[4].Value.ToString();
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("����Ϣ�����ݿ����!", ex);
}
finally {
if (data != null)
{
data.Close();
}
}
#endregion
#region ����Ϣ������߹���
SqlParameter[] prams2 = {
data.MakeInParam("@MsgID", SqlDbType.Int, 4, Int32.Parse(newmsgid)),
data.MakeInParam("@Receivers",SqlDbType.VarChar, 5000, receivers),
data.MakeInParam("@MobileNo", SqlDbType.VarChar, 4, ""),
data.MakeInParam("@type", SqlDbType.Int, 1, 1)
};
try
{
data.RunProc("SP_SMS_SetMsgReceiver", prams2);
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("����Ϣ������߹�������!", ex);
}
finally {
if (data != null)
{
data.Close();
}
}
#endregion
}
示例8: GetMobileNoByUsername
/// <summary>
/// �����û����ַ�����ȡ�ֻ������ַ���
/// <param name="Username">�û����ַ������ö������</param>
/// <returns>�����ֻ��ַ���</returns>
/// </summary>
public string GetMobileNoByUsername(string Username)
{
string MobileNoStr = "";
Database data = new Database();
SqlParameter[] prams = {
data.MakeInParam("@UserNameStr", SqlDbType.VarChar, 3000, Username),
data.MakeOutParam("@MobileNoStr", SqlDbType.VarChar, 3000)
};
try
{
data.RunProc("SP_SMS_GetMobileNoByUsername",prams);
MobileNoStr = prams[1].Value.ToString();
return MobileNoStr;
}
catch(Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("�����û����ַ�����ȡ�ֻ������ַ�������!",ex);
}
finally
{
if (data != null)
{
data.Close();
}
data = null;
}
}
示例9: CheckUpdate
/// <summary>
/// ���»��¼�����δ���Ա
/// </summary>
public string CheckUpdate(string Username,string SessionID,int ActiveNodeID)
{
string ReturnStr = "";
int ReturnID = 0;
int NewMsgFlag = 0;
Database data = new Database();
SqlParameter[] prams = {
data.MakeInParam("@username", SqlDbType.VarChar, 100, Username),
data.MakeInParam("@sessionid", SqlDbType.VarChar, 100, SessionID),
data.MakeInParam("@ActiveNodeID", SqlDbType.Int, 4, ActiveNodeID),
data.MakeOutParam("@ReturnID", SqlDbType.Int, 4),
data.MakeOutParam("@NewMsgFlag", SqlDbType.Int, 4)
};
try
{
data.RunProc("SP_SMS_CheckUpdate",prams);
ReturnID = Int32.Parse(prams[3].Value.ToString());
if(ReturnID==-1)
NewMsgFlag = 0;
else
NewMsgFlag = Int32.Parse(prams[4].Value.ToString());
ReturnStr = ReturnID.ToString()+"|"+NewMsgFlag.ToString();
data = null;
return ReturnStr;
}
catch(Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("���»��¼�����δ���Ա����!",ex);
}
finally
{
if (data != null)
{
data.Close();
}
data = null;
}
}
示例10: GetAccessPermission
/// <summary>
/// �ж��û��Զ����Ƿ���ij��Ȩ��
/// </summary>
/// <param name="UserName">�û���</param>
/// <param name="classID">�����Ķ���</param>
/// <param name="actID">Ȩ��ID</param>
/// <returns>�Ƿ���Ȩ��</returns>
public bool GetAccessPermission(string UserName,int classID,int actID)
{
int flag = 0;
// �������ݿ�����༰DataReader
Database data = new Database();
// ִ�д洢���̣�������SqlDataReader����
SqlParameter[] prams = {
data.MakeInParam("@Class_ID" , SqlDbType.Int, 20, classID),
data.MakeInParam("@UserName" , SqlDbType.NVarChar, 20, UserName),
data.MakeInParam("@Act_ID" , SqlDbType.Int, 20, actID),
// data.MakeInParam("@Inheit" , SqlDbType.Bit, 1, 1),
data.MakeOutParam("@ReturnValue",SqlDbType.Int,20)
};
try
{
data.RunProc("sp_GetAccessPermission",prams);
flag = Int32.Parse(prams[3].Value.ToString());
return (flag==1)?true:false;
}
catch(Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("��ȡ����Ȩ����",ex);
}
finally
{
data = null;
}
}
示例11: CheckExist
/// <summary>
/// ����ճ��Ƿ��ͻ
/// </summary>
public bool CheckExist(int PeriodID,string Username,string Date)
{
Database data = new Database();
bool IsExist = false;
SqlParameter[] prams = {
data.MakeInParam("@PeriodID", SqlDbType.Int, 8, PeriodID),
data.MakeInParam("@Username", SqlDbType.VarChar, 20, Username),
data.MakeInParam("@Date", SqlDbType.DateTime,30, DateTime.Parse(Date)),
data.MakeOutParam("@IsExist", SqlDbType.Bit ,1)
};
try
{
data.RunProc("sp_ScheduleCheckExist", prams);
IsExist = prams[3].Value.ToString()=="True"?true:false;
return IsExist;
}
catch (Exception ex)
{
Error.Log(ex.ToString());
throw new Exception("����ͻ����!",ex);
}
}