}//getStationaryId() public string makeRequisition(int userId, string stationeryName, int quantity) { StationeryController stController = new StationeryController(); Requisition requisition = new Requisition(); // System.Diagnostics.Debug.WriteLine("inside actionGetStationeryIdByName::" + name); string newstationeryName = stationeryName.Replace('_', ' '); // System.Diagnostics.Debug.WriteLine("inside actionGetStationeryIdByName::" + newstationeryName); int stationeryId = Convert.ToInt32(stController.actionGetStationeryIdByName(newstationeryName)); requisition.stationery = stationeryId; requisition.quantity = quantity; requisition.user_obj = userId; //hardcoded department id requisition.department = 8; requisition.user_approved_by = null; RequisitionController requisitionController = new RequisitionController(); Message msg = requisitionController.actionCreateRequisition(requisition); if (msg.condition) { System.Diagnostics.Debug.WriteLine("success"); return("success"); } else { System.Diagnostics.Debug.WriteLine("fail"); return("fail"); } }//makeRequisition
}//loadAllStationaries public void getStationaryId(string stationaryName) { StationeryController stController = new StationeryController(); int id = Convert.ToInt32(stController.actionGetStationeryIdByName(stationaryName)); System.Diagnostics.Debug.WriteLine("id is :" + id); }//getStationaryId()