예제 #1
0
 public static function deleteIndustrial($obj_mainpacket)
 {
     $packet = $obj_mainpacket->packet;
     $IndustrialId = $packet[0];
     $msg = "failed";
     $result = 0;
     $result_IndustrialId = 0;
     $retResult = BL_manageIndustrial::getIndustrialListByIndustrialId($IndustrialId);
     if ($retResult->type == 1) {
         $obj_Industrial = $retResult->data[0];
         $obj_result2 = DAL_manageIndustrial::deleteIndustrial($obj_Industrial->IndustrialId);
         if ($obj_result2->type == 1) {
             $result = 1;
             $result_IndustrialId = $obj_Industrial->IndustrialId;
             $msg = "success";
         } else {
             $msg = "Sorry!!! Problem occured while deleting this Industrial";
         }
     } else {
         $msg = "Sorry!!! The Industrial you are tring to delete is not found";
     }
     $obj_mainpacket->returnValues = array($result, $obj_Industrial->IndustrialId, $msg);
     $obj_mainpacket->main_setPacket();
 }
예제 #2
0
function getIndustrialByIndustrialId($sessionkey, $appcode, $id)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result .= "<AUTHSTATUS>1</AUTHSTATUS>";
        $result = BL_manageIndustrial::getIndustrialListByIndustrialId($id);
        if ($result->type == 1) {
            $arr_IndustrialList = $result->data;
            if (count($arr_IndustrialList) > 0) {
                $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
                foreach ($arr_IndustrialList as $obj_Industrial) {
                    $main_result .= getIndustrialXml($obj_Industrial);
                }
            } else {
                $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
            }
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}