Пример #1
0
function updateAgriculture($sessionkey, $appcode, $Agriculturedata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Agriculture = new Agriculture();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "AGRICULTUREID":
                    $obj_Agriculture->AgricultureId = $child;
                    break;
                case "AGRICULTURENAME":
                    $obj_Agriculture->AgricultureName = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Agriculture->Description = $child;
                    break;
            }
        }
        $obj_retResult_Agriculture = DAL_manageAgriculture::updateAgriculture($obj_Agriculture);
        if ($obj_retResult_Agriculture->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getAgricultureXml($obj_retResult_Agriculture->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
Пример #2
0
 public static function updateAgriculture2($AgricultureId, $AgricultureName, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newAgriculture = new Agriculture();
     $obj_newAgriculture->AgricultureId = $AgricultureId;
     $obj_newAgriculture->AgricultureName = $AgricultureName;
     $obj_newAgriculture->Description = $Description;
     $issuccess = DAL_manageAgriculture::updateAgriculture($obj_newAgriculture);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageAgriculture::getAgricultureByAgricultureId($obj_newAgriculture->AgricultureId);
         $obj_retResult->msg = "Agriculture updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Agriculture updation is Failed";
     }
     return $obj_retResult;
 }