예제 #1
0
 public static function updateSoiltype($obj_mainpacket)
 {
     $retrunUserpacket = array();
     $packet = $obj_mainpacket->packet;
     $obj_Soiltype = new Soiltype();
     if (count($packet) >= 2) {
         $obj_Soiltype->TblId = $packet[0];
         $obj_Soiltype->SoilTypeId = $packet[1];
         $obj_Soiltype->SoilTypeName = $packet[2];
         $obj_Soiltype->Description = $packet[3];
         $obj_retResult = new returnResult();
         $obj_retResult_Soiltype = DAL_manageSoiltype::update($obj_Soiltype);
         if ($obj_retResult_Soiltype->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Soiltype updation is Success";
             $retrunUserpacket = $obj_retResult_Soiltype->data->wsGetSoiltypeData();
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Soiltype updation is Failed";
             $result_Soiltype = DAL_manageSoiltype::getSoiltypeByTblId($obj_Soiltype->TblId);
             if ($result_Soiltype->type == 1) {
                 $retrunUserpacket = $result_Soiltype->data->wsGetSoiltypeData();
             }
         }
         $returnPacket = array($obj_retResult->type, $obj_retResult->msg);
         $returnPacket = array_merge($returnPacket, $retrunUserpacket);
         $obj_mainpacket->returnValues = $returnPacket;
         $obj_mainpacket->main_setPacket();
     }
 }