• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DataTier.Data类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DataTier.Data的典型用法代码示例。如果您正苦于以下问题:C# Data类的具体用法?C# Data怎么用?C# Data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Data类属于DataTier命名空间,在下文中一共展示了Data类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:30,代码来源:PatientPaymentData.cs


示例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;
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:30,代码来源:UserData.cs


示例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;
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:34,代码来源:Patient.cs


示例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;
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:37,代码来源:User.cs


示例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);
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:35,代码来源:NurseData.cs


示例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);
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:12,代码来源:MedicineData.cs


示例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);
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:30,代码来源:ReportData.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:14,代码来源:RoomData.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:BaseCommand.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:BaseCommand.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:15,代码来源:BaseCommand.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:15,代码来源:BaseCommand.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:15,代码来源:GeneralPaymentData.cs


示例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;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:15,代码来源:Surgery.cs


示例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);
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:NewRoom.cs


示例16: update

 /// <summary>
 /// update a sergery data
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public override bool update(Data data)
 {
     dbc = new DBC();
     dbc.open();
     dbc.update(@"UPDATE DoctorsSurgery
                 SET        UserDOS = convert(datetime, @DOS, 103), Memo = @Memo, UserROS = @ROS, UserSD = @surgery_description, UserSSE = @surgeryse WHERE SurgeryID = @SurgeryID", data);
     dbc.update(@"UPDATE history
                 SET        Memo = @Memo WHERE type = 2 AND cntId = @SurgeryID", data);
     dbc.close();
     return true;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:Surgery.cs


示例17: delete

        /// <summary>
        /// delete a surgery data
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public override bool delete(Data data)
        {
            dbc = new DBC();
            dbc.open();
            dbc.update(@"UPDATE DoctorsOrder
                        SET        state = '9' WHERE SurgeryID = @SurgeryID", data);
            dbc.update(@"UPDATE history SET status = '9' WHERE type = 2 AND cntId = @SurgeryID", data);
            dbc.close();

            return true;
        }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:Surgery.cs


示例18: newPatientsList

 /// <summary>
 /// get a list of new patients
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public Data newPatientsList(Data data)
 {
     //return select("Select UserID, Memo From DoctorsOrder WHERE UserStay = 'True'", data);
     String query = @"SELECT H.historyId, H.patientId, H.memo
                     FROM history H, Users U
                     WHERE U.UserID = H.staffId
                         AND H.status = 0
                         AND H.staffId = @nurseId
                     ORDER BY H.patientId ASC";
     return select(query, data);
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:16,代码来源:Room.cs


示例19: delete

 /// <summary>
 /// delete a patient from a room
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public override bool delete(Data data)
 {
     String today = DateTime.Now.Date.ToString().Substring(0, 10);
     data.add("today", today);
     String query = "UPDATE PatientRoom SET EndDate = convert(datetime, @today, 103) WHERE Room = @RoomID AND PatientID = @PatientID";
     DBC dbc = new DBC();
     dbc.open();
     dbc.update(query, data);
     //dbc.update(@"DELETE From PatientRoom WHERE PatientID = @PatientID", data);
     dbc.close();
     return true;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:17,代码来源:NewRoom.cs


示例20: create

 /// <summary>
 /// create a new X-ray data
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public override bool create(Data data)
 {
     String getId = "SELECT COUNT(*) + 1 AS NEW_ID FROM XRay";
     String query = "INSERT INTO XRay (XRayID, TestResultID, name, path) VALUES (@XRayID, @TestResultID, @name, @path)";
     dbc = new DBC();
     dbc.open();
     String id = dbc.select(getId, new Data()).getString("NEW_ID");
     data.add("XRayID", id);
     dbc.update(query, data);
     dbc.close();
     return true;
 }
开发者ID:hyori7,项目名称:Hospital,代码行数:17,代码来源:XrayData.cs



注:本文中的DataTier.Data类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataSchema.DatabaseColumn类代码示例发布时间:2022-05-24
下一篇:
C# DataLayer.sql类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap