本文整理匯總了C#中WSV.DAL.DataBase.MakeInParam方法的典型用法代碼示例。如果您正苦於以下問題:C# DataBase.MakeInParam方法的具體用法?C# DataBase.MakeInParam怎麽用?C# DataBase.MakeInParam使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WSV.DAL.DataBase
的用法示例。
在下文中一共展示了DataBase.MakeInParam方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Insert
/// <summary>
/// 添加數據
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static bool Insert(DC_Power Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new PowerDAL();
bool Flag = false, ReFlag = false;
int N = 0;
SqlParameter[] prams ={
db.MakeInParam("@Id", SqlDbType.BigInt,0,PublicFun.PublicFun.MaxId("DC_Power")),
db.MakeInParam("@Code", SqlDbType.VarChar,50, Item.Code),
db.MakeInParam("@Name", SqlDbType.VarChar,50, Item.Name),
db.MakeInParam("@ParentCode", SqlDbType.VarChar,50, Item.ParentCode),
db.MakeInParam("@RuleName", SqlDbType.VarChar,50, Item.RuleName)
};
try
{
ReFlag = db.TransactSql(visitor, "Insert", prams, out N);
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
if (ReFlag && N > 0)
{
Flag = true;
}
return Flag;
}
示例2: CheckPwd
/// <summary>
/// 檢查用戶密碼
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static bool CheckPwd(string pass)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new UsersDAL();
bool Flag = false;
SqlParameter[] prams ={
db.MakeInParam("@Uid",SqlDbType.VarChar,50,LUser.Uid),
db.MakeInParam("@Pwd",SqlDbType.VarChar,50,pass)
};
try
{
SqlDataReader dr;
db.GetDataReader(visitor, prams, out dr, "UserLock");
if (dr.Read())
{
Flag = true;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
return Flag;
}
示例3: CheckRolePower
/// <summary>
/// 查詢角色是否擁有某個權限
/// </summary>
/// <param name="RoleCode">角色編號</param>
/// <param name="PowerCode">權限編號</param>
/// <returns></returns>
public static bool CheckRolePower(string RuleName)
{
if (LUser.Id <= 2)
return true;
DataBase db = new DataBase();
DataBaseVisitor visitor = new RoleDAL();
bool Flag = false;
SqlParameter[] prams ={
db.MakeInParam("@RoleCode", SqlDbType.VarChar,50,LUser.Role),
db.MakeInParam("@RuleName", SqlDbType.VarChar,50,RuleName)
};
try
{
SqlDataReader dr;
db.GetDataReader(visitor, prams, out dr, "CheckRolePower");
if (dr.Read())
{
Flag = true;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
return Flag;
}
示例4: Update
/// <summary>
/// 修改數據
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static bool Update(D_Bill Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new BillDAL();
bool Flag = false, ReFlag = false;
int N = 0;
SqlParameter[] prams ={
db.MakeInParam("@BillName", SqlDbType.VarChar,50, Item.BillName),
db.MakeInParam("@PrintTitle", SqlDbType.VarChar,50, Item.PrintTitle),
db.MakeInParam("@Preview", SqlDbType.Bit,50, Item.Preview),
db.MakeInParam("@Id", SqlDbType.BigInt,0,Item.Id)
};
try
{
ReFlag = db.TransactSql(visitor, "Update", prams, out N);
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
if (ReFlag && N > 0)
{
Flag = true;
}
return Flag;
}
示例5: Update
/// <summary>
/// 修改數據
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static bool Update(C_Weight Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new WeightDAL();
bool Flag = false, ReFlag = false;
int N = 0;
SqlParameter[] prams ={
db.MakeInParam("@Save", SqlDbType.Bit,0, Item.Save),
db.MakeInParam("@Show", SqlDbType.Bit,0, Item.Show),
db.MakeInParam("@Time", SqlDbType.BigInt,0, Item.Time),
db.MakeInParam("@Id", SqlDbType.BigInt,0,Item.Id)
};
try
{
ReFlag = db.TransactSql(visitor, "Update", prams, out N);
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
if (ReFlag && N > 0)
{
Flag = true;
}
return Flag;
}
示例6: Insert
/// <summary>
/// 添加數據
/// </summary>
/// <param name="Item">model</param>
/// <returns>"0101"表示成功,"0"表示失敗</returns>
public static string Insert(D_CarCodeModel Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new D_CarCodeVisitor();
bool bSuc = false;
int nEffectRows = 0;
SqlParameter[] prams ={
db.MakeInParam("@ID", SqlDbType.BigInt,50, PublicFun.PublicFun.MaxId("D_CarCode")),
db.MakeInParam("@Code", SqlDbType.VarChar,50, Item.Code),
db.MakeInParam("@CarCode", SqlDbType.VarChar,50, Item.CarCode),
db.MakeInParam("@Tare", SqlDbType.Float,12, Item.Tare),
db.MakeInParam("@Driver", SqlDbType.VarChar,50, Item.Driver),
};
try
{
bSuc = db.TransactSql(visitor, "Insert", prams, out nEffectRows);
}
catch (Exception ex) { throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
if (bSuc && nEffectRows > 0)
return "0101";
else
return "0";
}
示例7: Insert
/// <summary>
/// �������
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static string Insert(Model.Count.D_StatProjectModel Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new DAL.Count.D_StatProjectDal();
bool bSuc = false;
int nEffectRows = 0;
SqlParameter[] prams ={
db.MakeInParam("@ID", SqlDbType.VarChar,50, PublicFun.PublicFun.MaxId("D_StatProject")),
db.MakeInParam("@Code", SqlDbType.VarChar,50,PublicFun.PublicFun.MaxId("D_StatProject")),
db.MakeInParam("@Name", SqlDbType.VarChar,50, Item.Name),
};
try
{
bSuc = db.TransactSql(visitor, "Insert", prams, out nEffectRows);
}
catch (Exception ex) { throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
if (bSuc && nEffectRows > 0)
return "0101";
else
return "0";
}
示例8: Update
public static string Update(Model.Video.D_Video Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new DAL.Video.VideoVisitor();
bool bSuc = false;
int nEffectRows = 0;
SqlParameter[] prams ={
db.MakeInParam("@VIDEOname",SqlDbType .Char ,10,Item.VIDEO_name),
db.MakeInParam("@VIDEOtable",SqlDbType .VarChar ,50,Item.VIDEO_table ),
db.MakeInParam("@VIDEOStandard",SqlDbType.Int ,4,Item.VIDEO_Standard ),
db.MakeInParam("@VIDEOSource",SqlDbType.Int,4,Item.VIDEO_Source ),
db.MakeInParam("@VIDEOBrightness",SqlDbType.Int,4,Item.VIDEO_Brightness ),
db.MakeInParam("@VIDEOContrast",SqlDbType.Int,4,Item.VIDEO_Contrast ),
db.MakeInParam("@VIDEOHue",SqlDbType.Int,4,Item.VIDEO_Hue ),
db.MakeInParam("@VIDEOSaturation",SqlDbType.Int,4,Item.VIDEO_Saturation ),
db.MakeInParam("@VIDEOSuality",SqlDbType.Int,4,Item.VIDEO_Suality)
};
try
{
bSuc = db.TransactSql(visitor, "Set_Video", prams, out nEffectRows);
}
catch (Exception ex) { throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
if (bSuc && nEffectRows > 0)
return "0101";
else
return "0";
}
示例9: UserLogin
/// <summary>
/// 用戶登陸
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static bool UserLogin(D_User Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new UsersDAL();
bool Flag = false;
SqlParameter[] prams ={
db.MakeInParam("@Uid",SqlDbType.VarChar,50,Item.Uid),
db.MakeInParam("@Pwd",SqlDbType.VarChar,50,Item.Pwd)
};
try
{
DataSet ds = new DataSet();
ds = db.ReturnDataSet(visitor, prams, "UserLogin");
DataRowCollection drc = ds.Tables[0].Rows;
if (drc.Count > 0)
{
DataRow dr = drc[0];
CUser.Id = Convert.ToInt64(dr["Id"]);
CUser.Code = dr["Code"].ToString();
CUser.Uid = dr["Uid"].ToString();
CUser.Name = dr["Name"].ToString();
CUser.Role = dr["Role"].ToString();
//PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
//if (Ini.ExistIniFile())
//{
// LUser.TableNum = Ini.IniReadValue("LoadoMeter", "TableNum");
//}
//ds = WSV.BLL.SysInfo.LoadoMeterBLL.SelectAll(" where TableNum='" + LUser.TableNum + "'");
//drc = ds.Tables[0].Rows;
//if (drc.Count > 0)
//{
// dr = drc[0];
// LUser.TableName = dr["Name"].ToString();
// LUser.Ip = dr["Ip"].ToString();
// LUser.Port = dr["Port"].ToString();
//}
//else
//{
// LUser.TableNum = "";
//}
Flag = true;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Dispose();
}
return Flag;
}
示例10: AddCurve
public static bool AddCurve(string Code, WSV.Model.Weight.WeightModel value)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new DAL.MyLog.DL_WeightVisitor();
bool retvalue = true;
SqlParameter[] prams ={
db.MakeInParam("@Code",SqlDbType.VarChar,50,Code)
};
SqlDataReader Reader = null;
try
{
db.GetDataReader(visitor, prams, out Reader, "AddCurve");
if (Reader.Read())
{
value.StateFun.Curve = (byte[])Reader["Curve"];
}
else
{
retvalue = false;
}
}
catch (Exception e)
{
db.Dispose();
return false;
}
finally
{
db.Dispose();
}
return retvalue;
}
示例11: SelectByName
/// <summary>
/// 根據名字查詢編號
/// </summary>
/// <returns></returns>
public static string SelectByName(string Name)
{
string Code = "";
DataBase db = new DataBase();
DataBaseVisitor visitor = new DC_BaseVisitor();
SqlDataReader dr = null;
SqlParameter[] prams ={
db.MakeInParam("@Name", SqlDbType.VarChar,50, Name),
};
try
{
db.GetDataReader(visitor, prams, out dr, "SelectByName");
if (dr.Read())
{
Code = dr["Code"].ToString();
}
}
catch (Exception ex)
{ throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
return Code;
}
示例12: Data_Add
/// <summary>
/// ���������
/// </summary>
/// <param name="s_Pr"></param>
/// <returns></returns>
public static string Data_Add(string s_Pr)
{
string CodeA = "";
DataBase db = new DataBase();
DataBaseVisitor visitor = new WSV.DAL.Weight.WeightDAL();
SqlParameter[] prams ={
db.MakeInParam("@Flag", SqlDbType.VarChar,50,s_Pr)
};
SqlDataReader dr = null;
try
{
db.GetDataReader(visitor, prams, out dr, "D_Add");
if (dr.Read())
{
CodeA = dr["Code"].ToString();
}
dr.Close();
}
catch (Exception ex)
{ throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
return CodeA;
}
示例13: Delete
public static bool Delete(string S_Pr)
{
bool retvalue = true;
DataBase db = new DataBase();
DataBaseVisitor visitor = new CardDAL();
SqlParameter[] prams =
{
db.MakeInParam("@Card",SqlDbType.VarChar,50,S_Pr)
};
try
{
db.TransactSql(visitor, "Delete", prams);
}
catch (Exception err)
{
db.Dispose();
MessageBox.Show(err.Message, "��Ϣ��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
finally
{
db.Dispose();
}
return retvalue;
}
示例14: Update
/// <summary>
/// 修改數據
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static string Update(DC_BaseModel Item)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new DC_BaseVisitor();
bool bSuc = false;
int nEffectRows = 0;
SqlParameter[] prams ={
db.MakeInParam("@Code", SqlDbType.VarChar,50, Item.Code),
db.MakeInParam("@Name", SqlDbType.VarChar,50, Item.Name),
db.MakeInParam("@AS", SqlDbType.VarChar,50, Item.AS),
db.MakeInParam("@Flag", SqlDbType.VarChar,50, Item.Flag),
db.MakeInParam("@Rank", SqlDbType.VarChar,50, Item.Rank),
db.MakeInParam("@ID", SqlDbType.VarChar,50, Item.ID),
};
try
{
bSuc = db.TransactSql(visitor, "Update", prams, out nEffectRows);
}
catch (Exception ex) { throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
if (bSuc && nEffectRows > 0)
return "0101";
else
return "0";
}
示例15: Insert
/// <summary>
/// 插入一條操作記錄,並返回他的編號
/// </summary>
/// <param name="Content"></param>
/// <returns></returns>
public static string Insert(string Content)
{
string ret_Code = MaxID().ToString();
DataBase db = new DataBase();
DataBaseVisitor visitor = new WSV.DAL.MyLog.DL_Run();
SqlParameter[] prams ={
db.MakeInParam("@ID", SqlDbType.BigInt,8, long.Parse(ret_Code)),
db.MakeInParam("@Code", SqlDbType.VarChar,50,ret_Code),
db.MakeInParam("@Work", SqlDbType.VarChar,50, Content),
db.MakeInParam("@InTime", SqlDbType.DateTime,8, DateTime.Now),
db.MakeInParam("@OperCode", SqlDbType.VarChar,50, Model.User.LUser.Code),
db.MakeInParam("@TableNum", SqlDbType.VarChar,50, Model.User.LUser.TableNum)
};
try
{
db.TransactSql(visitor, "Insert", prams);
}
catch (Exception ex)
{ throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
return ret_Code;
}