Example #1
0
        private void FillTeaWorkingNumbers(string getDutyID, ref int getTeaWorkingOnTime, ref int getTeaWorkingnotOnTime, string getDept, DateTime getDate)
        {
            getTeaWorkingNumbersCommand = "GetTeaWorkingNumbers";
            dbCommandWrapper            = dbRealtimeInfo.GetStoredProcCommandWrapper(getTeaWorkingNumbersCommand);
            dbCommandWrapper.AddInParameter("@getDept", DbType.String, getDept);
            dbCommandWrapper.AddInParameter("@getDutyID", DbType.String, getDutyID);
            dbCommandWrapper.AddInParameter("@getDate", DbType.DateTime, getDate);
            dbCommandWrapper.AddOutParameter("@getTeaWorkingOnTime", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getTeaWorkingnotOnTime", DbType.Int32, 4);
            dbRealtimeInfo.ExecuteNonQuery(dbCommandWrapper);

            getTeaWorkingOnTime    += Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getTeaWorkingOnTime"));
            getTeaWorkingnotOnTime += Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getTeaWorkingnotOnTime"));
        }
Example #2
0
        /// <summary>
        /// 更新幼儿园信息
        /// </summary>
        /// <param name="gardenInfo">要更改的GardenInfo</param>
        /// <returns>返回影响的行数</returns>
        public int UpdateGardenInfo(GardenInfo gardenInfo)
        {
            int rowEffected = 0;

            try
            {
                DBCommandWrapper dbComWrapper = db.GetStoredProcCommandWrapper("UpdateGarden_Info");
                dbComWrapper.AddInParameter("@info_gardenID", DbType.String, gardenInfo.GardenID);
                dbComWrapper.AddInParameter("@info_gardenName", DbType.String, gardenInfo.GardenName);
                dbComWrapper.AddInParameter("@info_gardenRegCode", DbType.String, gardenInfo.GardenRegCode);
                dbComWrapper.AddInParameter("@info_gardenAddr", DbType.String, gardenInfo.GardenAddr);
                dbComWrapper.AddInParameter("@info_gardenContact", DbType.String, gardenInfo.GardenContact);
                dbComWrapper.AddInParameter("@info_gardenFeature", DbType.String, gardenInfo.GardenFeature);
                dbComWrapper.AddInParameter("@info_gardenGraphLocation", DbType.Binary, gardenInfo.GardenImage);
                dbComWrapper.AddOutParameter("@rowEffected", DbType.Int32, 4);

                db.ExecuteNonQuery(dbComWrapper);

                rowEffected = Convert.ToInt32(dbComWrapper.GetParameterValue("@rowEffected"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowEffected);
        }
Example #3
0
        public int InsertSMSPhoneNum(string stuID,
                                     string familialName, string mobilePhoneNum,
                                     string stuGrade, string stuClass)
        {
            int rowsAffected = 0;

            try
            {
                DBCommandWrapper dbCom = db.GetStoredProcCommandWrapper("InsertSMS_Register_Info");
                dbCom.AddInParameter("@studInfo_stuid ", DbType.String, stuID);
                dbCom.AddInParameter("@familial_name ", DbType.String, familialName);
                dbCom.AddInParameter("@mobilePhone_number ", DbType.String, mobilePhoneNum);
                dbCom.AddInParameter("@stu_grade ", DbType.String, stuGrade);
                dbCom.AddInParameter("@stu_class ", DbType.String, stuClass);
                dbCom.AddOutParameter("@smsInfo_id", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCom);

                rowsAffected = Convert.ToInt32(dbCom.GetParameterValue("@smsInfo_id"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #4
0
        public int UpdateDutyInfo(DataSet dutyInfoList)
        {
            int rowsEffected = 0;

            try
            {
                DBCommandWrapper insertComm = db.GetStoredProcCommandWrapper("Insertteacher_duty");
                insertComm.AddInParameter("@Teaduty_Begtime", DbType.String, "Teaduty_Begtime", DataRowVersion.Current);
                insertComm.AddInParameter("@Teaduty_Endtime", DbType.String, "Teaduty_Endtime", DataRowVersion.Current);
                insertComm.AddInParameter("@Teaduty_Name ", DbType.String, "Teaduty_Name", DataRowVersion.Current);
                insertComm.AddInParameter("@Teaduty_Remark", DbType.String, "Teaduty_Remark", DataRowVersion.Current);
                insertComm.AddOutParameter("@Teaduty_Dutynumber", DbType.Int32, 4);

                DBCommandWrapper updateComm = db.GetStoredProcCommandWrapper("Updateteacher_duty");
                updateComm.AddInParameter("@Teaduty_Dutynumber", DbType.Int32, "Teaduty_Dutynumber", DataRowVersion.Current);
                updateComm.AddInParameter("@Teaduty_Begtime", DbType.String, "Teaduty_Begtime", DataRowVersion.Current);
                updateComm.AddInParameter("@Teaduty_Endtime", DbType.String, "Teaduty_Endtime", DataRowVersion.Current);
                updateComm.AddInParameter("@Teaduty_Name ", DbType.String, "Teaduty_Name", DataRowVersion.Current);
                updateComm.AddInParameter("@Teaduty_Remark", DbType.String, "Teaduty_Remark", DataRowVersion.Current);

                DBCommandWrapper deleteComm = db.GetStoredProcCommandWrapper("Deleteteacher_duty");
                deleteComm.AddInParameter("@Teaduty_Dutynumber", DbType.Int32, "Teaduty_Dutynumber", DataRowVersion.Proposed);

                rowsEffected = db.UpdateDataSet(dutyInfoList, dutyInfoList.Tables[0].TableName,
                                                insertComm, updateComm, deleteComm, UpdateBehavior.Transactional);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsEffected);
        }
Example #5
0
        public int InsertTransaction(string sendFrom, string sendTo,
                                     DateTime sendDate, string content, string sendTitle)
        {
            int rowsAffected = 0;

            try
            {
                DBCommandWrapper dbCom = db.GetStoredProcCommandWrapper("InsertTransactionMessage");
                dbCom.AddInParameter("@SendFrom", DbType.String, sendFrom);
                dbCom.AddInParameter("@SendTo", DbType.String, sendTo);
                dbCom.AddInParameter("@SendDate ", DbType.DateTime, sendDate);
                dbCom.AddInParameter("@Content", DbType.String, content);
                dbCom.AddInParameter("@Title", DbType.String, sendTitle);
                dbCom.AddInParameter("@HasRead", DbType.String, "○");
                dbCom.AddOutParameter("@TransactionID", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCom);

                rowsAffected = Convert.ToInt32(dbCom.GetParameterValue("@TransactionID"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #6
0
        public int UpdateClassInfo(Classes classes)
        {
            int rowsAffected = 0;

            try
            {
                DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("UpdateClass_Info");
                dbCommandWrapper.AddInParameter("@info_classNumber", DbType.Int32, classes.InfoClassNumber);
                dbCommandWrapper.AddInParameter("@info_className", DbType.String, classes.InfoClassName);
                dbCommandWrapper.AddInParameter("@info_gradeNumber", DbType.Int32, classes.ClassInfoGradeNumber);
                dbCommandWrapper.AddInParameter("@info_machineAddr", DbType.Int32, classes.InfoMachineAddr);
                dbCommandWrapper.AddInParameter("@info_classRemark", DbType.String, classes.InfoClassRemark);
                dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCommandWrapper);

                rowsAffected = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #7
0
        public int InsertClassInfo(Classes classes, string gradeName)
        {
            int     rowsAffected = 0;
            DataSet numberList   = new DataSet();

            try
            {
                DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("InsertClass_Info");
                DBCommandWrapper dbCommand        = db.GetStoredProcCommandWrapper("SelectGradeNumber");
                dbCommand.AddInParameter("@info_gradeName", DbType.String, gradeName);
                numberList = db.ExecuteDataSet(dbCommand);
                classes.ClassInfoGradeNumber = Convert.ToInt32(numberList.Tables[0].Rows[0][0]);
                dbCommandWrapper.AddInParameter("@info_classNumber", DbType.Int32, classes.InfoClassNumber);
                dbCommandWrapper.AddInParameter("@info_className", DbType.String, classes.InfoClassName);
                dbCommandWrapper.AddInParameter("@info_gradeNumber", DbType.Int32, classes.ClassInfoGradeNumber);
                dbCommandWrapper.AddInParameter("@info_machineAddr", DbType.Int32, classes.InfoMachineAddr);
                dbCommandWrapper.AddInParameter("@info_classRemark", DbType.String, classes.InfoClassRemark);
                dbCommandWrapper.AddInParameter("@type", DbType.String, classes.ClassType);

                dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCommandWrapper);

                rowsAffected = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #8
0
        public int InsertTeaCardInfo(CardInfo card)
        {
            int rowsAffected = 0;

            try
            {
                DBCommandWrapper dbCom = db.GetStoredProcCommandWrapper("InsertTeacher_CardInfo");

                dbCom.AddInParameter("@info_teaBasicID", DbType.String, card.StuID);
                dbCom.AddInParameter("@info_teaCardNumber", DbType.String, card.CardNumber);
                dbCom.AddInParameter("@info_teaCardSendDate", DbType.DateTime, card.CardSendDate);
                dbCom.AddInParameter("@info_teaCardState", DbType.Boolean, card.CardState);
                dbCom.AddInParameter("@info_teaCardSeq", DbType.Int16, card.CardSequence);
                dbCom.AddOutParameter("@rowsAffected", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCom);

                rowsAffected = Convert.ToInt32(dbCom.GetParameterValue("@rowsAffected"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #9
0
        public int UpdateTeaDutyDetail(string tID, string sundayDuty,
                                       string mondayDuty, string tuesdayDuty, string wednesdayDuty,
                                       string thursdayDuty, string fridayDuty, string saturdayDuty)
        {
            int rowsAffected = 0;

            try
            {
                DBCommandWrapper dbCom = db.GetStoredProcCommandWrapper("Updateteacher_onduty");

                dbCom.AddInParameter("@Teaonduty_Teaid", DbType.String, tID);
                dbCom.AddInParameter("@Teaonduty_Sunday", DbType.String, sundayDuty);
                dbCom.AddInParameter("@Teaonduty_Monday", DbType.String, mondayDuty);
                dbCom.AddInParameter("@Teaonduty_Tuesday", DbType.String, tuesdayDuty);
                dbCom.AddInParameter("@Teaonduty_Wednesday", DbType.String, wednesdayDuty);
                dbCom.AddInParameter("@Teaonduty_Thursday", DbType.String, thursdayDuty);
                dbCom.AddInParameter("@Teaonduty_Friday", DbType.String, fridayDuty);
                dbCom.AddInParameter("@Teaonduty_Saturday", DbType.String, saturdayDuty);
                dbCom.AddOutParameter("@rowsAffected", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCom);

                rowsAffected = Convert.ToInt32(dbCom.GetParameterValue("@rowsAffected"));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(rowsAffected);
        }
Example #10
0
        public void GetRealtimeBackInfo_Graphic(string getGrade, string getClass, DateTime getDate, ref int getHasGone, ref int getHasnotGone, ref int getStuNumbers)
        {
            getRealtimeBackInfo_GraphicCommand = "GetRealtimeBackStat_Graphic";
            dbCommandWrapper = dbRealtime.GetStoredProcCommandWrapper(getRealtimeBackInfo_GraphicCommand);
            dbCommandWrapper.AddInParameter("@getGrade", DbType.String, getGrade);
            dbCommandWrapper.AddInParameter("@getClass", DbType.String, getClass);
            dbCommandWrapper.AddInParameter("@getDate", DbType.DateTime, getDate);
            dbCommandWrapper.AddOutParameter("@getHasGone", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getHasnotGone", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getStuNumbers", DbType.Int32, 4);
            dbRealtime.ExecuteNonQuery(dbCommandWrapper);

            getHasGone    = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getHasGone"));
            getHasnotGone = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getHasnotGone"));
            getStuNumbers = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getStuNumbers"));
        }
Example #11
0
        public bool HasAssignedUniqueGardenID()
        {
            DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("CheckHasAssignedUniqueGardenID");

            dbCommandWrapper.AddOutParameter("@retval", DbType.Boolean, 1);
            db.ExecuteNonQuery(dbCommandWrapper);
            return(Convert.ToBoolean(dbCommandWrapper.GetParameterValue("@retval")));
        }
 public bool HasCheckInfoOneDay(DateTime date)
 {
     dbCommandWrapper = dbCheckInfo.GetStoredProcCommandWrapper("HasCheckInfo");
     dbCommandWrapper.AddInParameter("@datetime", DbType.DateTime, date);
     dbCommandWrapper.AddOutParameter("@total", DbType.Int32, 4);
     dbCheckInfo.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@total")) > 0);
 }
Example #13
0
 public int DeleteStudentInfo(string getID)
 {
     deleteStudentInfoCommand = "DeleteStuInfo_BatchCreate";
     dbCommandWrapper         = dbForBatchCreate.GetStoredProcCommandWrapper(deleteStudentInfoCommand);
     dbCommandWrapper.AddInParameter("@getID", DbType.String, getID);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);
     dbForBatchCreate.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #14
0
        public int DeleteSessionClient(string macAddr)
        {
            DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("DeleteSessionClient");

            dbCommandWrapper.AddInParameter("@macAddr", DbType.String, macAddr);
            dbCommandWrapper.AddOutParameter("@retVal", DbType.Int16, 4);
            db.ExecuteNonQuery(dbCommandWrapper);
            return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@retVal")));
        }
 public void DoAttendCalcForSolo(string getName, string getNumber, string getBegTime,
                                 string getEndTime, string getState)
 {
     doStuAttendCalcForSoloCommand = "Student_AttendCalcForSolo";
     dbCommandWrapper = dbAttendCalc.GetStoredProcCommandWrapper(doStuAttendCalcForSoloCommand);
     dbCommandWrapper.AddInParameter("@setStuName", DbType.String, getName);
     dbCommandWrapper.AddInParameter("@setStuNumber", DbType.String, getNumber);
     dbCommandWrapper.AddInParameter("@setBegTime", DbType.String, getBegTime);
     dbCommandWrapper.AddInParameter("@setEndTime", DbType.String, getEndTime);
     dbCommandWrapper.AddInParameter("@setState", DbType.String, getState);
     dbCommandWrapper.AddOutParameter("@getStateAmount", DbType.Int32, 4);
     dbCommandWrapper.AddOutParameter("@getAllStateAmount", DbType.Int32, 4);
     dbCommandWrapper.AddOutParameter("@getStuAmount", DbType.Int32, 4);
     dbAttendCalc.ExecuteDataSet(dbCommandWrapper);
     StateAmount    = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getStateAmount"));
     AllStateAmount = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAllStateAmount"));
     StuAmount      = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getStuAmount"));
 }
Example #16
0
 public int DeleteNutrition(FoodMgmt foodMgmt)
 {
     deleteNutritionCommand = "DeleteNutrition";
     dbCommandWrapper       = dbFoodMgmt.GetStoredProcCommandWrapper(deleteNutritionCommand);
     dbCommandWrapper.AddInParameter("@foodID", DbType.Int32, foodMgmt.FoodID);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int16, 16);
     dbFoodMgmt.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #17
0
 private string FillAcc1FoodName(int getFoodID)
 {
     getAcc1FoodNameCommand = "GetAcc1FoodName";
     dbCommandWrapper       = dbFoodMgmt.GetStoredProcCommandWrapper(getAcc1FoodNameCommand);
     dbCommandWrapper.AddInParameter("@getFoodID", DbType.Int32, getFoodID);
     dbCommandWrapper.AddOutParameter("@getFoodName", DbType.String, 50);
     dbFoodMgmt.ExecuteNonQuery(dbCommandWrapper);
     return(dbCommandWrapper.GetParameterValue("@getFoodName").ToString());
 }
 public void DoBackCalc(string getGrade, string getClass, string getName, string getNumber, string getBegTime,
                        string getEndTime)
 {
     doStuBackCalcCommand = "Student_BackCalc";
     dbCommandWrapper     = dbAttendCalc.GetStoredProcCommandWrapper(doStuBackCalcCommand);
     dbCommandWrapper.AddInParameter("@setGrade", DbType.String, getGrade);
     dbCommandWrapper.AddInParameter("@setClass", DbType.String, getClass);
     dbCommandWrapper.AddInParameter("@setName", DbType.String, getName);
     dbCommandWrapper.AddInParameter("@setNumber", DbType.String, getNumber);
     dbCommandWrapper.AddInParameter("@setBegTime", DbType.String, getBegTime);
     dbCommandWrapper.AddInParameter("@setEndTime", DbType.String, getEndTime);
     dbCommandWrapper.AddOutParameter("@getHasGone", DbType.Int32, 4);
     dbCommandWrapper.AddOutParameter("@getHasnotGone", DbType.Int32, 4);
     dbCommandWrapper.AddOutParameter("@getAllStateAmount", DbType.Int32, 4);
     dbAttendCalc.ExecuteDataSet(dbCommandWrapper);
     HasGone        = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getHasGone"));
     HasnotGone     = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getHasnotGone"));
     AllStateAmount = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAllStateAmount"));
 }
Example #19
0
 public int DeleteAccFood(string getFoodID, string getDate)
 {
     deleteAccFoodCommand = "DeleteAccFood";
     dbCommandWrapper     = dbFoodMgmt.GetStoredProcCommandWrapper(deleteAccFoodCommand);
     dbCommandWrapper.AddInParameter("@getFoodID", DbType.Int32, Convert.ToInt32(getFoodID));
     dbCommandWrapper.AddInParameter("@getDate", DbType.String, getDate);
     dbCommandWrapper.AddOutParameter("rowsAffected", DbType.Int16, 16);
     dbFoodMgmt.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("rowsAffected")));
 }
Example #20
0
 public int DeleteMachineInfo(int getMachineAddr, int getMachineType)
 {
     deleteMachineInfoCommand = "DeleteMachineInfo_BatchCreate";
     dbCommandWrapper         = dbForBatchCreate.GetStoredProcCommandWrapper(deleteMachineInfoCommand);
     dbCommandWrapper.AddInParameter("@getMachineAddr", DbType.Int32, getMachineAddr);
     dbCommandWrapper.AddInParameter("@getMachineType", DbType.Int32, getMachineType);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);
     dbForBatchCreate.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #21
0
 private int InternalUpdateGradeNameByNumber(string getGradeNumber, string getGradeName)
 {
     updateGradeNameByNumberCommand = "UpdateGradeNameByNumber";
     dbCommandWrapper = dbForBatchCreate.GetStoredProcCommandWrapper(updateGradeNameByNumberCommand);
     dbCommandWrapper.AddInParameter("@gradeNumber", DbType.String, getGradeNumber);
     dbCommandWrapper.AddInParameter("@gradeName", DbType.String, getGradeName);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);
     dbForBatchCreate.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #22
0
 public bool HasCard(string stuID, string stuNumber)
 {
     hasCardCommand   = "HasCard_Student";
     dbCommandWrapper = dbAccess.GetStoredProcCommandWrapper(hasCardCommand);
     dbCommandWrapper.AddInParameter("@stuID", DbType.String, stuID);
     dbCommandWrapper.AddInParameter("@stuNumber", DbType.String, stuNumber);
     dbCommandWrapper.AddOutParameter("@hasCard", DbType.Boolean, 1);
     dbAccess.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToBoolean(dbCommandWrapper.GetParameterValue("@hasCard")));
 }
Example #23
0
 private int FillTeaNumbers(string getWeekDay, string getDutyID, string getDept)
 {
     getTeaNumbersCommand = "GetTeaNumberInDuty";
     dbCommandWrapper     = dbRealtimeInfo.GetStoredProcCommandWrapper(getTeaNumbersCommand);
     dbCommandWrapper.AddInParameter("@getDept", DbType.String, getDept);
     dbCommandWrapper.AddInParameter("@getWeekDay", DbType.String, getWeekDay);
     dbCommandWrapper.AddInParameter("@getDutyID", DbType.String, getDutyID);
     dbCommandWrapper.AddOutParameter("@getTeaNumbers", DbType.Int32, 4);
     dbRealtimeInfo.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getTeaNumbers")));
 }
Example #24
0
 public int UpdateFoodArrGrade(FoodMgmt foodMgmt)
 {
     updateFoodArrGradeCommand = "UpdateFoodArrGrade";
     dbCommandWrapper          = dbFoodMgmt.GetStoredProcCommandWrapper(updateFoodArrGradeCommand);
     dbCommandWrapper.AddInParameter("@foodArrID", DbType.Int32, foodMgmt.FoodArrID);
     dbCommandWrapper.AddInParameter("@suitAge", DbType.String, foodMgmt.SuitAge);
     dbCommandWrapper.AddInParameter("@isUsed", DbType.String, foodMgmt.IsUsed);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int16, 16);
     dbFoodMgmt.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #25
0
 public int InsertMachine(string getAddr, string getType, string getVol)
 {
     insertMachineCommand = "InsertMachine_ForAdmin";
     dbCommandWrapper     = dbForBatchCreate.GetStoredProcCommandWrapper(insertMachineCommand);
     dbCommandWrapper.AddInParameter("@getAddr", DbType.Int32, Convert.ToInt32(getAddr));
     dbCommandWrapper.AddInParameter("@getType", DbType.Int32, Convert.ToInt32(getType));
     dbCommandWrapper.AddInParameter("@getVol", DbType.Int32, Convert.ToInt32(getVol));
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int32, 4);
     dbForBatchCreate.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #26
0
        private DataSet FillAbsentDaysInMonth(int getNumber, DateTime getDate)
        {
            getAbsentDaysInMonthCommand = "GetAbsentDaysInMonth";
            dbCommandWrapper            = dbVisit.GetStoredProcCommandWrapper(getAbsentDaysInMonthCommand);
            dbCommandWrapper.AddInParameter("@getStuNumber", DbType.Int16, getNumber);
            dbCommandWrapper.AddInParameter("@getDate", DbType.DateTime, getDate);
            dbCommandWrapper.AddOutParameter("getAbsSum", DbType.Int32, 4);
            DataSet dsAbsentDaysInMonth = dbVisit.ExecuteDataSet(dbCommandWrapper);

            GetAbsSum = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAbsSum"));
            return(dsAbsentDaysInMonth);
        }
Example #27
0
 private int FillAllStuAmountForNut(DateTime getBegDate, DateTime getEndDate, int getMonth, int getGrade)
 {
     getAllStuAmountForNutCommnad = "GetAllStuAmountForNut";
     dbCommandWrapper             = dbFoodMgmt.GetStoredProcCommandWrapper(getAllStuAmountForNutCommnad);
     dbCommandWrapper.AddInParameter("@begDate", DbType.DateTime, getBegDate);
     dbCommandWrapper.AddInParameter("@endDate", DbType.DateTime, getEndDate);
     dbCommandWrapper.AddInParameter("@getMonth", DbType.Int32, getMonth);
     dbCommandWrapper.AddInParameter("@getGrade", DbType.Int32, getGrade);
     dbCommandWrapper.AddOutParameter("@getAmount", DbType.Int32, 32);
     dbFoodMgmt.ExecuteDataSet(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAmount")));
 }
Example #28
0
 public int UpdateAccFood(string getFoodID, double getTakeAmount, string getDate, string getRemark)
 {
     updateAccFoodCommand = "UpdateAccFood";
     dbCommandWrapper     = dbFoodMgmt.GetStoredProcCommandWrapper(updateAccFoodCommand);
     dbCommandWrapper.AddInParameter("@getFoodID", DbType.Int32, Convert.ToInt32(getFoodID));
     dbCommandWrapper.AddInParameter("@getTakeAmount", DbType.Double, getTakeAmount);
     dbCommandWrapper.AddInParameter("@getDate", DbType.String, getDate);
     dbCommandWrapper.AddInParameter("@getRemark", DbType.String, getRemark);
     dbCommandWrapper.AddOutParameter("@rowsAffected", DbType.Int16, 16);
     dbFoodMgmt.ExecuteNonQuery(dbCommandWrapper);
     return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@rowsAffected")));
 }
Example #29
0
        public int InsertSessionClient(string role, string ipAddr, string macAddr)
        {
            DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("InsertSessionClient");

            dbCommandWrapper.AddInParameter("@role", DbType.String, role);
            dbCommandWrapper.AddInParameter("@ipAddr", DbType.String, ipAddr);
            dbCommandWrapper.AddInParameter("@macAddr", DbType.String, macAddr);
            dbCommandWrapper.AddOutParameter("@retVal", DbType.Int32, 4);
            db.ExecuteNonQuery(dbCommandWrapper);

            return(Convert.ToInt32(dbCommandWrapper.GetParameterValue("@retVal")));
        }
Example #30
0
        public void GetRealtimeMorningInfo_Graphic(string getGrade, string getClass, DateTime getDate, ref int getHealth,
                                                   ref int getWatch, ref int getSick, ref int getAbsence, ref int getStuNumbers)
        {
            getRealtimeMorningInfo_GraphicCommand = "GetRealtimeMorningStat_Graphic";
            dbCommandWrapper = dbRealtime.GetStoredProcCommandWrapper(getRealtimeMorningInfo_GraphicCommand);
            dbCommandWrapper.AddInParameter("@getGrade", DbType.String, getGrade);
            dbCommandWrapper.AddInParameter("@getClass", DbType.String, getClass);
            dbCommandWrapper.AddInParameter("@getDate", DbType.DateTime, getDate);
            dbCommandWrapper.AddOutParameter("@getHealth", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getWatch", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getSick", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getAbsence", DbType.Int32, 4);
            dbCommandWrapper.AddOutParameter("@getStuNumbers", DbType.Int32, 4);
            dbRealtime.ExecuteNonQuery(dbCommandWrapper);

            getHealth     = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getHealth"));
            getWatch      = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getWatch"));
            getSick       = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getSick"));
            getAbsence    = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAbsence"));
            getStuNumbers = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getStuNumbers"));
        }