本文整理汇总了C#中API.DAL.ConnectionManager类的典型用法代码示例。如果您正苦于以下问题:C# ConnectionManager类的具体用法?C# ConnectionManager怎么用?C# ConnectionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionManager类属于API.DAL命名空间,在下文中一共展示了ConnectionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllUserProfile
public static CustomList<UserProfile> GetAllUserProfile(String userCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<UserProfile> UserProfileCollection = new CustomList<UserProfile>();
IDataReader reader = null;
String sql = "select *from UserProfile Where UserCode='" + userCode + "'";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
UserProfile newUserProfile = new UserProfile();
newUserProfile.SetData(reader);
UserProfileCollection.Add(newUserProfile);
}
return UserProfileCollection;
}
catch(Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例2: LoadMailInfo
public DataSet LoadMailInfo(Int32 ReportID)
{
ConnectionManager conManager = new ConnectionManager(ConName);
IDataReader reader = null;
try
{
DataSet dsRef = new DataSet();
const String spName = "spGetMailInfo";
conManager.OpenDataReader(out reader, spName, ReportID);
dsRef = Util.DataReaderToDataSet(reader);
return dsRef;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader.IsNotNull() && reader.IsClosed.IsFalse())
reader.Close();
}
}
示例3: GetAllLatestNews
public static CustomList<LatestNews> GetAllLatestNews()
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<LatestNews> LatestNewsCollection = new CustomList<LatestNews>();
IDataReader reader = null;
const String sql = "select *from LatestNews";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
LatestNews newLatestNews = new LatestNews();
newLatestNews.SetData(reader);
LatestNewsCollection.Add(newLatestNews);
}
LatestNewsCollection.InsertSpName = "spInsertLatestNews";
LatestNewsCollection.UpdateSpName = "spUpdateLatestNews";
LatestNewsCollection.DeleteSpName = "spDeleteLatestNews";
return LatestNewsCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例4: GetAllGroupSecurityRule
public static CustomList<GroupRule> GetAllGroupSecurityRule(string groupCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<GroupRule> GroupSecurityRuleCollection = new CustomList<GroupRule>();
String sql = "Select *from GroupRule where GroupCode='" + groupCode + "'";
IDataReader reader = null;
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
GroupRule newGroupSecurityRule = new GroupRule();
newGroupSecurityRule.SetData(reader);
GroupSecurityRuleCollection.Add(newGroupSecurityRule);
}
reader.Close();
GroupSecurityRuleCollection.InsertSpName = "spInsertGroupRule";
GroupSecurityRuleCollection.SelectSpName = "spDeleteGroupRule";
return GroupSecurityRuleCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例5: DeleteSecurityRule
public void DeleteSecurityRule(ref CustomList<RuleDetails> objSecurityRuleDetailList, ref CustomList<SecurityRule> securityRuleList)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
Boolean blnTranStarted = false;
try
{
ReSetSPNameForDelete(securityRuleList, objSecurityRuleDetailList);
conManager.BeginTransaction();
blnTranStarted = true;
conManager.SaveDataCollectionThroughCollection(blnTranStarted, objSecurityRuleDetailList, securityRuleList);
objSecurityRuleDetailList.AcceptChanges();
securityRuleList.AcceptChanges();
conManager.CommitTransaction();
blnTranStarted = false;
conManager.Dispose();
}
catch (Exception ex)
{
conManager.RollBack();
throw (ex);
}
finally
{
if (conManager.IsNotNull())
{
conManager.Dispose();
}
}
}
示例6: GetAllConfiguration
public static CustomList<Configuration> GetAllConfiguration()
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<Configuration> ConfigurationCollection = new CustomList<Configuration>();
const String sql = "Select *from tblConfiguration";
IDataReader reader = null; ;
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
Configuration newConfiguration = new Configuration();
newConfiguration.SetData(reader);
ConfigurationCollection.Add(newConfiguration);
}
reader.Close();
ConfigurationCollection.SelectSpName = "spSelectConfiguration";
ConfigurationCollection.InsertSpName = "spInsertConfiguration";
ConfigurationCollection.UpdateSpName = "spUpdateConfiguration";
ConfigurationCollection.SelectSpName = "spDeleteConfiguration";
return ConfigurationCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例7: GetReportValue
public static CustomList<ParameterFilterValue> GetReportValue(string parent)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
IDataReader reader = null;
String sql = "select OrgKey As ActualValues, OrgName As DisplayMember, OrgName As [Values] from Gen_Org Where OrgParentKey in(" + parent + ")";//'" + userCode + "'";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ParameterFilterValue newParameterFilterValue = new ParameterFilterValue();
newParameterFilterValue.SetData(reader);
ParameterFilterValueCollection.Add(newParameterFilterValue);
}
return ParameterFilterValueCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (conManager != null)
{
conManager.CloseConnection();
conManager.Dispose();
}
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例8: SaveMailSetup
public void SaveMailSetup(CustomList<MailSetup> MailSetupList)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
Boolean blnTranStarted = false;
try
{
conManager.BeginTransaction();
blnTranStarted = true;
ReSetSPName(ref MailSetupList);
conManager.SaveDataCollectionThroughCollection(blnTranStarted, MailSetupList);
MailSetupList.AcceptChanges();
conManager.CommitTransaction();
blnTranStarted = false;
conManager.Dispose();
}
catch (Exception Ex)
{
conManager.RollBack();
throw Ex;
}
finally
{
if (conManager.IsNotNull())
{
conManager.Dispose();
}
}
}
示例9: GetAllItemSubGroup
public static CustomList<ItemSubGroup> GetAllItemSubGroup()
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
CustomList<ItemSubGroup> ItemSubGroupCollection = new CustomList<ItemSubGroup>();
IDataReader reader = null;
const String sql = "select S.ItemGroupID, S.ItemSubGroupID, S.SubGroupName from ItemGroup I inner join ItemSubGroup S on S.ItemGroupID=I.ItemGroupID order by I.GroupName desc";
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
ItemSubGroup newItemSubGroup = new ItemSubGroup();
newItemSubGroup.SetData(reader);
ItemSubGroupCollection.Add(newItemSubGroup);
}
ItemSubGroupCollection.InsertSpName = "spInsertItemSubGroup";
ItemSubGroupCollection.UpdateSpName = "spUpdateItemSubGroup";
ItemSubGroupCollection.DeleteSpName = "spDeleteItemSubGroup";
return ItemSubGroupCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例10: GetSignatureForUniqueCode
public static CustomList<Signature> GetSignatureForUniqueCode(String sql)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<Signature> signatureCollection = new CustomList<Signature>();
IDataReader reader = null;
try
{
conManager.OpenDataReader(sql, out reader);
if (reader.NextResult())
{
while (reader.Read())
{
Signature newSignature = new Signature();
newSignature.SetData(reader);
signatureCollection.Add(newSignature);
}
}
return signatureCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例11: SaveBankAccount
public void SaveBankAccount(ref CustomList<CmnBankAccount> BankAccountList)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
Boolean blnTranStarted = false;
try
{
conManager.BeginTransaction();
ReSetSPName(BankAccountList);
Int32 accountID = BankAccountList[0].AccountID;
blnTranStarted = true;
if (BankAccountList[0].IsAdded)
accountID = Convert.ToInt32(conManager.InsertData(blnTranStarted, BankAccountList));
else
conManager.SaveDataCollectionThroughCollection(blnTranStarted, BankAccountList);
BankAccountList.AcceptChanges();
conManager.CommitTransaction();
blnTranStarted = false;
}
catch (Exception Ex)
{
conManager.RollBack();
throw Ex;
}
finally
{
if (conManager.IsNotNull())
{
conManager.Dispose();
}
}
}
示例12: GetAllUserGroupWithUserCode
public static CustomList<UserGroupList> GetAllUserGroupWithUserCode(string userCode)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
CustomList<UserGroupList> UserGroupListCollection = new CustomList<UserGroupList>();
String sql = "Exec spUserGroupList'" + userCode + "'";
IDataReader reader = null;
try
{
conManager.OpenDataReader(sql, out reader);
while (reader.Read())
{
UserGroupList newUserGroup = new UserGroupList();
newUserGroup.SetData(reader);
UserGroupListCollection.Add(newUserGroup);
}
reader.Close();
return UserGroupListCollection;
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
}
}
示例13: SaveFiscalYear
public void SaveFiscalYear(ref CustomList<Gen_FY> Gen_FYList)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
Boolean blnTranStarted = false;
try
{
conManager.BeginTransaction();
ReSetSPName(Gen_FYList);
blnTranStarted = true;
conManager.SaveDataCollectionThroughCollection(blnTranStarted, Gen_FYList);
//object scope_Identity = conManager.InsertData(blnTranStarted, BankKist);
Gen_FYList.AcceptChanges();
conManager.CommitTransaction();
blnTranStarted = false;
conManager.Dispose();
}
catch (Exception Ex)
{
conManager.RollBack();
throw Ex;
}
finally
{
if (conManager.IsNotNull())
{
conManager.Dispose();
}
}
}
示例14: DeleteVoucher
public void DeleteVoucher(ref CustomList<Acc_VoucherDet> VoucherDetList, ref CustomList<Acc_Voucher> VoucherList)
{
ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
Boolean blnTranStarted = false;
try
{
ReSetSPName(ref VoucherList, ref VoucherDetList);
conManager.BeginTransaction();
blnTranStarted = true;
conManager.SaveDataCollectionThroughCollection(blnTranStarted, VoucherDetList, VoucherList);
conManager.CommitTransaction();
VoucherDetList.AcceptChanges();
VoucherList.AcceptChanges();
}
catch (Exception ex)
{
conManager.RollBack();
throw (ex);
}
finally
{
if (conManager.IsNotNull())
{
blnTranStarted = false;
conManager.Dispose();
}
}
}
示例15: GetUniqueCodeWithoutSignature
public static Int32 GetUniqueCodeWithoutSignature(ref ConnectionManager objCon, Boolean requiredTransaction, String strTableName, String strFieldName,
String strPrefix)
{
String sql = "";
Int32 strMaxId = 0;
try
{
sql = "Exec spGetIDWithoutSignature '" +
strTableName + "','" + strFieldName + "','" +
strPrefix + "'";
IDataReader reader;
objCon.OpenDataReader(sql, out reader, CommandBehavior.Default, requiredTransaction);
while (reader.Read())
{
strMaxId = Convert.ToInt32(reader["MaxId"]);
}
reader.Close();
return strMaxId;
}
catch (Exception ex)
{
throw (ex);
}
}