本文整理汇总了C#中Subput.Common.DataBaseUtility类的典型用法代码示例。如果您正苦于以下问题:C# DataBaseUtility类的具体用法?C# DataBaseUtility怎么用?C# DataBaseUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataBaseUtility类属于Subput.Common命名空间,在下文中一共展示了DataBaseUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDBBackup
public void GetDBBackup(string backupDBName, string backupPath)
{
try
{
DataBaseUtility db = new DataBaseUtility();
SqlCommand cm = new SqlCommand();
string s = DateTime.Now.ToString("MMM/dd/yyyy");
SqlParameter[] sqlParams = new SqlParameter[]
{ new SqlParameter("@DBNAME", backupDBName),
new SqlParameter("@PATH", backupPath),
new SqlParameter("@BACKUPTYPE", 1),
new SqlParameter("@MSG", "Genrate Backup"),
new SqlParameter("@BACKUPFILENAME", s.Replace("/", "_") )};
db.ExecuteSP("DATABASE_BACKUP", sqlParams);
log.Info("Backup created success fully with name "+ s.Replace("/", "_"));
}
catch (Exception ex)
{
log.Info("Exception in GetDBBackup ",ex);
}
}
示例2: AddFoodOrder
// Add Food Order this order add by only manager
public void AddFoodOrder(FoodOrderDTO dto)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[FoodOrder]([StoreId],[OrderDateTime],[CreatedDateTime],[LastUpdateDateTime])VALUES ( "
+ " " + SQLUtility.getInteger(dto.StoreId) + " , '" + SQLUtility.FormateDateYYYYMMDDWtithTime(dto.FoodOrderDate) + "' , '" + SQLUtility.FormateDateYYYYMMDDWtithTime(dto.CreatedDateTime) + "' ,'" + SQLUtility.FormateDateYYYYMMDDWtithTime(dto.LastUpdateDateTime) + "' ) ";
db.ExecuteUpdate(query);
}
示例3: Add
public void Add(string name, string role, string emailId)
{
try
{
string password = "";
if (name.Length <= 4)
{
password = ValidationUtility.CreatePassword(name.Length + 2);
}
else
{
password = ValidationUtility.CreatePassword(name.Length);
}
int roleId = ValidationUtility.ToInteger(role);
DataBaseUtility db = new DataBaseUtility();
string query = " insert into Users ([UserId],[Password],[RoleId],[EmailId],[CreatedDateTime],[LastUpdateDateTime]) "
+ " values(" + SQLUtility.getString(name) + "," + SQLUtility.getString(password) + ", " + SQLUtility.getInteger(roleId) + ", " + SQLUtility.getString(emailId) + " , '" + DateTime.Now.ToString("yyyy/MM/dd hh:mm tt") + "' ,'" + DateTime.Now.ToString("yyyy/MM/dd hh:mm tt") + "' )";
db.ExecuteUpdate(query);
}
catch (Exception ex)
{
log.Error(" Exception in Add Method ", ex);
}
}
示例4: AddActual
public void AddActual(ManagerBonusDTO managerBonusDTO)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[ManagerBonus] ([StoreId] ,[LastDateOFMonth] ,[FoodCost] ,[LaborCost] ,[FoodLaborCost] ,[SalesIncrease] ,[CustomerIndex] ,[CustomerComplaint] ,[Catering] ,[SubInspection] ,[CreatedDateTime] ,[LastUpdateDateTime]) "
+ " VALUES (" + SQLUtility.getInteger(managerBonusDTO.StoreId) + ",'" + SQLUtility.FormateDateYYYYMMDD(managerBonusDTO.LastDateOFMonth) + "',0,0,0,0,0,0,0,0,'" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "')";
db.ExecuteUpdate(query);
}
示例5: AddEmpClockingInfo
//Add Employee Clocking Information
public void AddEmpClockingInfo(int empTrackerId, EmployeeClockingDTO employeeClockingDTO)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[EmployeeClocking]([EmployeeTrackerId],[ClockFunctionTypeId],[ClockingTime],[MinutesWorked],[CreatedDateTime],[LastUpdateDateTime]) "
+ " VALUES(" + SQLUtility.getInteger(empTrackerId) + "," + SQLUtility.getInteger(employeeClockingDTO.ClockFunctionTypeId) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(employeeClockingDTO.ClockingTime) + "', "
+ " " + SQLUtility.getInteger(employeeClockingDTO.MinutesWorked) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "' )";
db.ExecuteUpdate(query);
}
示例6: AddEmpInfo
public void AddEmpInfo(int storeId, EmployeeInfoDTO employeeInfoDTO)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[EmployeeInfo] ([EmpId],[StoreId],[EmpFirstName],[EmpMiddleName],[EmpLastName],[CreatedDateTime],[LastUpdateDateTime]) "
+ " VALUES(" + SQLUtility.getInteger(employeeInfoDTO.EmpId) + "," + SQLUtility.getInteger(storeId) + "," + SQLUtility.getString(employeeInfoDTO.EmpFirstName) + "," + SQLUtility.getString(employeeInfoDTO.EmpMiddleName) + ", "
+ " " + SQLUtility.getString(employeeInfoDTO.EmpLastName) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "')";
db.ExecuteUpdate(query);
}
示例7: DeleteComplaintsData
public void DeleteComplaintsData(int cId)
{
DataBaseUtility db = new DataBaseUtility();
string query = "delete from dbo.Complaints where Id=" + SQLUtility.getInteger(cId) + "";
db.ExecuteUpdate(query);
}
示例8: AddFoodOrderItem
//Add Food order
public void AddFoodOrderItem(string item)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[FoodItem]([FoodName],[CreatedDateTime],[LastUpdateDateTime]) "
+ " VALUES(" + SQLUtility.getString(item) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "')";
db.ExecuteUpdate(query);
}
示例9: AddInactiveStore
//Add Inactive Store
public void AddInactiveStore(StoreDTO storeDTO)
{
DataBaseUtility db = new DataBaseUtility();
string query = "INSERT INTO [dbo].[Store] ([StoreNumber] ,[StoreName] ,[ConnectionString] ,[IsStoreActive] ,[CreatedDateTime] ,[LastUpdateDateTime]) VALUES(" + SQLUtility.getInteger(storeDTO.StoreNumber) + " , "
+ "" + SQLUtility.getString(storeDTO.StoreName) + "," + SQLUtility.getString(storeDTO.ConnectionString) + ",'" + storeDTO.IsActive + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "')";
db.ExecuteUpdate(query);
}
示例10: DeleteFoodItem
public void DeleteFoodItem(int id)
{
DataBaseUtility db = new DataBaseUtility();
string query = "delete from dbo.Orders where ItemId=" + SQLUtility.getInteger(id) + "";
db.ExecuteUpdate(query);
query = " delete from dbo.FoodItem where Id=" + SQLUtility.getInteger(id) + "";
db.ExecuteUpdate(query);
}
示例11: AddOrder
// Add Order by manager
// one food order have multiple order
public void AddOrder(OrderDTO dto)
{
DataBaseUtility db = new DataBaseUtility();
string query = " INSERT INTO [dbo].[Orders]([FoodOrderId],[ItemId],[NumberRemaining],[NumberOver],[CreatedDateTime],[LastUpdateDateTime])VALUES ( "
+ " " + SQLUtility.getInteger(dto.FoodOrderId) + " , " + SQLUtility.getInteger(dto.ItemId) + " , " + SQLUtility.getInteger(dto.NumberRemaining) + " , " + SQLUtility.getInteger(dto.NumberOver) + " , "
+ " '" + SQLUtility.FormateDateYYYYMMDDWtithTime(dto.CreatedDateTime) + "' , '" + SQLUtility.FormateDateYYYYMMDDWtithTime(dto.LastUpdateDateTime) + "' ) ";
db.ExecuteUpdate(query);
}
示例12: AddBounus
public void AddBounus(ManagerBonusDTO managerBonusDTO, bool isZeroBasis)
{
DataBaseUtility db = new DataBaseUtility();
String query = "INSERT INTO [dbo].[ManagerBonus] ([StoreId] ,[FirstDateOfMonth],[LastDateOfMonth],[FoodCost] ,[LaborCost] ,[FoodLaborCost] ,[SalesIncrease] ,[CustomerIndex] ,[CustomerComplaint] "
+ " ,[Catering] ,[SubInspection],[IsZeroBasis] ,[CreatedDateTime] ,[LastUpdateDateTime]) "
+ " VALUES (" + SQLUtility.getInteger(managerBonusDTO.StoreId) + ", '" + SQLUtility.FormateDateYYYYMMDD(managerBonusDTO.FirstDateOFMonth) + "','" + SQLUtility.FormateDateYYYYMMDD(managerBonusDTO.LastDateOFMonth) + "'," + SQLUtility.getDouble(managerBonusDTO.FoodCost) + "," + SQLUtility.getDouble(managerBonusDTO.LaborCost) + "," + SQLUtility.getDouble(managerBonusDTO.FoodLaborCost) + "," + SQLUtility.getDouble(managerBonusDTO.SalesIncrease) + ", "
+ " " + SQLUtility.getDouble(managerBonusDTO.CustomerIndex) + "," + SQLUtility.getDouble(managerBonusDTO.CustomerComplaint) + "," + SQLUtility.getDouble(managerBonusDTO.Catering) + ", "
+ " " + SQLUtility.getDouble(managerBonusDTO.SubInspection) + ",'" + isZeroBasis + "' , '" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(DateTime.Now) + "') ";
db.ExecuteUpdate(query);
}
示例13: GetGenMngAssignStore
// Get General Manager AssignStore Information
public ArrayList GetGenMngAssignStore(int userId)
{
ArrayList amList = new ArrayList();
DataBaseUtility db = new DataBaseUtility();
SqlConnection con = null;
try
{
// string query = " select su.*,u.UserId as AeaManagerName from dbo.StoreUser su,dbo.Users u where su.UserId=u.Id and su.UserId in(select AreaManagerId from dbo.AssignAreaManagerInfo where GeneralManagerId=" + SQLUtility.getInteger(userId) + " ) ";
// string query = "select AreaManagerId from dbo.AssignAreaManagerInfo where GeneralManagerId=" + SQLUtility.getInteger(userId) + " ";
string query = " select aami.AreaManagerId,u.UserId from dbo.AssignAreaManagerInfo aami,dbo.Users u where aami.AreaManagerId=u.Id and aami.GeneralManagerId=" + SQLUtility.getInteger(userId) + " ";
con = db.OpenConnection();
SqlCommand comm = db.getSQLCommand(query, con);
SqlDataReader reader = comm.ExecuteReader();
while (reader.Read())
{
int uId = ValidationUtility.ToInteger(reader["AreaManagerId"].ToString());
string amName = reader["UserId"].ToString();
GeneralManagerBonusDTO dto = new GeneralManagerBonusDTO {UserId = uId, AmName = amName };
amList.Add(dto);
}
reader.Close();
comm.Dispose();
}
catch (Exception ex)
{
log.Error(" Exception in GetGenMngAssignStore Method ", ex);
}
finally
{
db.CloseConnection(con);
}
return amList;
}
示例14: AddComplaints
public void AddComplaints(ComplaintsDTO complaintsDTO)
{
DataBaseUtility db = new DataBaseUtility();
//string query = "INSERT INTO [dbo].[Complaints] ([StoreId],[ComplaintDate],[CustomerContacted],[FeedbackReceived],[ProblemFixed],[Comment],[Response] "
// + " ,[CreatedDateTime],[LastUpdateDateTime]) VALUES(" + SQLUtility.getInteger(complaintsDTO.StoreId) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(complaintsDTO.ComplaintDate) + "' ,"
// + " '" + complaintsDTO.CustomerContacted + "','" + complaintsDTO.FeedbackRecieved + "','" + complaintsDTO.ProblemFixed + "',"
// + " " + SQLUtility.getString(complaintsDTO.Comment) + ", " + SQLUtility.getString(complaintsDTO.Response) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(complaintsDTO.CreatedDateTime) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(complaintsDTO.LastUpdateDateTime) + "' )";
string query = "INSERT INTO [dbo].[Complaints] ([StoreId] ,[ComplaintDate],[CustomerContacted] ,[FeedbackReceived],[ProblemFixed] ,[EmailedSubway] "
+" ,[Comment],[Response],[Name] ,[Telephone] ,[Email],[CreatedDateTime] ,[LastUpdateDateTime]) "
+ " VALUES(" + SQLUtility.getInteger(complaintsDTO.StoreId) + ",'" + SQLUtility.FormateDateYYYYMMDD(complaintsDTO.ComplaintDate) + "', '" + complaintsDTO.CustomerContacted + "','"+complaintsDTO.FeedbackRecieved+"', "
+ " '" + complaintsDTO.ProblemFixed + "','" + complaintsDTO.EmailedSubway + "'," + SQLUtility.getString(ValidationUtility.TruncateString(complaintsDTO.Comment, 500)) + "," + SQLUtility.getString(ValidationUtility.TruncateString(complaintsDTO.Response, 500)) + "," + SQLUtility.getString(complaintsDTO.Name) + "," + SQLUtility.getString(complaintsDTO.TelePhone) + "," + SQLUtility.getString(complaintsDTO.Email) + ",'" + SQLUtility.FormateDateYYYYMMDDWtithTime(complaintsDTO.CreatedDateTime) + "','" + SQLUtility.FormateDateYYYYMMDDWtithTime(complaintsDTO.LastUpdateDateTime) + "')";
db.ExecuteUpdate(query);
}
示例15: DeleteMaintenanceRequest
public void DeleteMaintenanceRequest(int id)
{
DataBaseUtility db = new DataBaseUtility();
try
{
string query = " delete from dbo.StoreMaintainance where Id = " + SQLUtility.getInteger(id) + " ";
db.ExecuteUpdate(query);
}
catch (Exception ex)
{
log.Error(" Exception in DeleteMaintenanceRequest Method ", ex);
}
}