/// <summary> /// Get the role ID from a role's name. /// </summary> /// <param name="role">Role name.</param> /// <returns>The RoleID if exists. <value>-1</value> if it doesn't exist.</returns> public int GetRoleIdFromRoleName(string role) { ValidateParam("role", role); DBCommandWrapper cmd = this.securityDb.GetStoredProcCommandWrapper(SPGetRoleId); cmd.AddInParameter("name", DbType.String, role); cmd.AddOutParameter("roleID", DbType.Int32, 4); this.securityDb.ExecuteNonQuery(cmd); object ret = cmd.GetParameterValue("RoleID"); return(ret == DBNull.Value ? -1 : (int)cmd.GetParameterValue("RoleID")); }
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")); }
/// <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); }
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); }
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); }
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); }
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); }
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); }
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); }
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")); }
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); }
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"))); }
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 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"))); }
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 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")); }
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"))); }
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"))); }
public void CanGetOutputValueFromStoredProcedure() { DBCommandWrapper storedProcedure = this.db.GetStoredProcCommandWrapper("TestProc", null, "ALFKI"); this.db.ExecuteNonQuery(storedProcedure); int resultCount = Convert.ToInt32(storedProcedure.GetParameterValue("vCount")); Assert.AreEqual(6, resultCount); }
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"))); }
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")); }
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"))); }
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"))); }
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"))); }
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"))); }
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); }
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"))); }
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"))); }
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"))); }