本文整理汇总了C#中DataTier.Data类的典型用法代码示例。如果您正苦于以下问题:C# Data类的具体用法?C# Data怎么用?C# Data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Data类属于DataTier命名空间,在下文中一共展示了Data类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: list
/// <summary>
/// get a list of all payment data
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public List<Data> list(Data data)
{
String query = @"SELECT * FROM history H, GeneralPayment G
WHERE G.ID = H.payId
AND H.patientId = @patientId
AND H.payState = 0
AND G.ID > 0
ORDER BY H.date";
String medicineQuery = @"SELECT *, (M.Quantity * G.Price) AS T_Price FROM Medicine M, GeneralPayment G, history H
WHERE G.ID = M.ItemId
AND M.historyId = H.historyId
AND H.patientId = @patientId
AND M.state = 0
ORDER BY H.date";
String insuranceQuery = "SELECT * FROM Insurance I, Users U WHERE I.insuranceId = U.InsuranceId AND U.UserID = @patientId";
List<Data> result = new List<Data>();
dbc = new DBC();
dbc.open();
result.Add(dbc.select(query, data));
result.Add(dbc.select(medicineQuery, data));
result.Add(dbc.select(insuranceQuery, data));
dbc.close();
return result;
}
示例2: createPatient
/// <summary>
/// create a new patient
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public bool createPatient(Data data)
{
int result = 0;
String query = @"INSERT INTO Users (UserID, UserFirstName, UserMiddleName, UserSurName, TitleID, GenderID, Occupation, MaritalID,
Address, DOB, StateCode, PostCode, Nationality, PhoneNumber,
Email, JobCode,
PatientMotherLastName, PatientMotherFirstName,
PatientFatherLastName, PatientFatherFirstName,
insuranceId)
VALUES (@UserID, @UserFirstName, @UserMiddleName, @UserSurName,
@TitleID, @GenderID, @Occupation, @MaritalID, @Address,
@DOB, @StateCode, @PostCode, @Nationality, @PhoneNumber,
@Email, @JobCode,
@PatientMotherLastName, @PatientMotherFirstName,
@PatientFatherLastName, @PatientFatherFirstName,
@insuranceId)";
dbc = new DBC();
dbc.open();
result = dbc.update(query, data);
result = dbc.update("INSERT INTO UsersLogIn (UserID, Password) VALUES (@UserID, @Password)", data);
dbc.close();
dbc = null;
return result != 0 ? true : false;
}
示例3: list
/// <summary>
/// select patient
/// </summary>
/// <param name="field"></param>
/// <param name="value"></param>
/// <param name="data"></param>
/// <returns></returns>
public Data list(Data data)
{
String today = DateTime.Now.Date.ToString().Substring(0, 10);
data.add("today", today);
String query = @"SELECT *,
(SELECT COUNT(*) FROM NursesForm N
WHERE N.UserID = P.PatientID
AND N.state = 0
AND N.date = convert(datetime, @today, 103)
)AS Observation
FROM Room R, patientRoom P, Users U
WHERE P.Room = R.RoomID
AND R.UserId = @NurseID
AND U.UserID = P.PatientID
AND P.StartDate <= convert(datetime, @today, 103)
AND P.EndDate >= convert(datetime, @today, 103)
ORDER BY P.PatientID ASC";
Data result = select(query, data);
int count = result.Count;
for (int i = 0; i < count; i++)
{
result.add(i, "StartDate", result.getString(i, "StartDate").Substring(0,10));
result.add(i, "EndDate", result.getString(i, "EndDate").Substring(0, 10));
}
return result;
}
示例4: insert
/// <summary>
/// it will be deleted
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public override bool insert(Data data)
{
/*
if (!Text.isAble(data.getString("UserName"), 32))
{
return false;
}
if (!Text.isAble(data.getString("FirstName"), 32))
{
return false;
}
if (!Text.isAble(data.getString("SurName"), 32))
{
return false;
}
if (!Text.isAble(data.getString("Email"), 256))
{
return false;
}
Data param = new Data();
param.add("UserId", data.get("UserName"));
param.add("FirstName", data.get("FirstName"));
param.add("SurName", data.get("SurName"));
param.add("MiddleName", data.get("MiddleName"));
//param.add("DOB", data.get("DOB"));
param.add("Email", data.get("Email"));
updateSP("registration", data);
return true;
*/
return true;
}
示例5: list
/// <summary>
/// set query to select patient ID and nurse ID. Search for patient.
/// </summary>
/// <param name="field"></param>
/// <param name="value"></param>
/// <param name="data"></param>
/// <returns></returns>
public Data list(String field, String value,Data data)
{
String query = "Select * From history A, Users B WHERE A.patientId = B.UserID AND A.patientId = @pId AND A.staffId = @NurseID AND status = '0' <SEARCH> <DATE> ORDER BY historyId DESC";
String date = data.getString("date");
if (field.Equals(""))
{
query = query.Replace("<SEARCH>", "");
}
else if (field.Equals("memo"))
{
query = query.Replace("<SEARCH>", "AND memo LIKE '%" + value + "%'");
}
else if (field.Equals("patientId"))
{
query = query.Replace("<SEARCH>", "AND patientId LIKE '%" + value + "%'");
}
if (date.Equals(""))
{
query = query.Replace("<DATE>", "");
}
else
{
query = query.Replace("<DATE>", "AND CONVERT(VARCHAR(10), A.date, 103) = '<DATE>'".Replace("<DATE>", date));
}
return select(query, data);
}
示例6: view
/// <summary>
/// get a medicine data
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public override Data view(Data data)
{
String query = @"SELECT * FROM Medicine M, GeneralPayment G
WHERE G.ID = M.ItemId
AND historyId = @HistoryId AND STATE = 0 ";
return select(query, data);
}
示例7: getItemReport
/// <summary>
/// get a report for items
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public Data getItemReport(Data data)
{
String startDate = data.getString("startDate");
String endDate = data.getString("endDate");
String today = DateTime.Now.Date.ToString().Substring(0,10);
if ("".Equals(startDate))
{
data.add("startDate",today);
}
if ("".Equals(startDate))
{
data.add("endDate", today);
}
String query = @"SELECT G.Item, G.Price, COUNT(M.ItemId) AS How_many_times, SUM(G.Price) AS Total
FROM Medicine M, GeneralPayment G, history H
WHERE H.historyId = M.historyId
AND M.ItemId = G.ID
AND M.state < 9
AND H.date >= CONVERT(datetime, @startDate, 103)
AND H.date <= CONVERT(datetime, @endDate, 103)
GROUP BY G.Item, G.price
ORDER BY G.Item ASC";
return select(query, data);
}
示例8: update
/// <summary>
/// update a room data
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public override bool update(Data data)
{
DBC dbc = new DBC();
dbc.open();
dbc.update(@"UPDATE Room
SET Type = @RoomType, UserId = @RoomOwner, Beds = @Beds WHERE RoomID = @RoomID", data);
dbc.close();
return true;
}
示例9: page
/// <summary>
/// get data with paging
/// </summary>
/// <param name="query"></param>
/// <param name="data"></param>
/// <param name="index"></param>
/// <returns></returns>
protected Data page(String query, Data data, String index)
{
dbc = new DBC();
dbc.open();
result = dbc.page(query, data, index);
dbc.close();
dbc = null;
return result;
}
示例10: pageSP
/// <summary>
/// get data with paging using stored procedure
/// </summary>
/// <param name="query"></param>
/// <param name="data"></param>
/// <param name="index"></param>
/// <returns></returns>
protected Data pageSP(String spName, String spCount, Data data)
{
dbc = new DBC();
dbc.open();
result = dbc.pageSP(spName, spCount, data);
dbc.close();
dbc = null;
return result;
}
示例11: select
/// <summary>
/// get data from database
/// </summary>
/// <param name="query"></param>
/// <param name="data"></param>
/// <returns></returns>
protected Data select(String query, Data data)
{
dbc = new DBC();
dbc.open();
result = dbc.select(query, data);
dbc.close();
dbc = null;
return result;
}
示例12: selectSP
/// <summary>
/// select data from database using stored procedure
/// </summary>
/// <param name="spName"></param>
/// <param name="data"></param>
/// <returns></returns>
protected Data selectSP(String spName, Data data)
{
dbc = new DBC();
dbc.open();
result = dbc.selectSP(spName, data);
dbc.close();
dbc = null;
return result;
}
示例13: update
/// <summary>
/// update an item
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public override bool update(Data data)
{
dbc = new DBC();
dbc.open();
dbc.update(@"UPDATE GeneralPayment
SET Item = @ItemTextBox, Type = @TypeDropDownList, Price = @PriceTextBox, insuranceState = @InsuranceStateTextBox
WHERE ID = @itemID", data);
dbc.close();
return true;
}
示例14: view
/// <summary>
/// get a surgery data
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public override Data view(Data data)
{
Data result = select("SELECT * FROM DoctorsSurgery A, Users B WHERE A.UserID = B.UserID AND A.SurgeryID = @surgeryId", data);
int count = result.Count;
for (int i = 0; i < count; i++)
{
result.add(i, "UserDOS", result.getString(i, "UserDOS").Substring(0, 10));
}
return result;
}
示例15: patientlist
/// <summary>
/// get a list of new patients
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public Data patientlist(Data data)
{
//return select("Select * From Users WHERE JobCode = 0 ORDER BY UserID DESC", data);
String query = @"SELECT H.historyId, H.patientId
FROM history H, Users U
WHERE U.UserID = H.staffId
AND H.status = 0
AND H.staffId = @CaptID
ORDER BY H.patientId ASC";
return select(query, data);
}