예제 #1
0
 public static function updateVillage2($VillageId, $Name, $VillageNumber, $AgaDevision, $District, $Province, $GeogrophyTypeId, $ForestTypeId, $ForestDescription, $TraditionalKnowledge)
 {
     $obj_retResult = new returnResult();
     $obj_newVillage = new Village();
     $obj_newVillage->VillageId = $VillageId;
     $obj_newVillage->Name = $Name;
     $obj_newVillage->VillageNumber = $VillageNumber;
     $obj_newVillage->AgaDevision = $AgaDevision;
     $obj_newVillage->District = $District;
     $obj_newVillage->Province = $Province;
     $obj_newVillage->GeogrophyTypeId = $GeogrophyTypeId;
     $obj_newVillage->ForestTypeId = $ForestTypeId;
     $obj_newVillage->ForestDescription = $ForestDescription;
     $obj_newVillage->TraditionalKnowledge = $TraditionalKnowledge;
     $issuccess = DAL_manageVillage::updateVillage($obj_newVillage);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageVillage::getVillageByVillageId($obj_newVillage->VillageId);
         $obj_retResult->msg = "Village updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Village updation is Failed";
     }
     return $obj_retResult;
 }
예제 #2
0
function updateVillage($sessionkey, $appcode, $Villagedata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village = new Village();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "VILLAGEID":
                    $obj_Village->VillageId = $child;
                    break;
                case "NAME":
                    $obj_Village->Name = $child;
                    break;
                case "VILLAGENUMBER":
                    $obj_Village->VillageNumber = $child;
                    break;
                case "AGADEVISION":
                    $obj_Village->AgaDevision = $child;
                    break;
                case "DISTRICT":
                    $obj_Village->District = $child;
                    break;
                case "PROVINCE":
                    $obj_Village->Province = $child;
                    break;
                case "GEOGROPHYTYPEID":
                    $obj_Village->GeogrophyTypeId = $child;
                    break;
                case "FORESTTYPEID":
                    $obj_Village->ForestTypeId = $child;
                    break;
                case "FORESTDESCRIPTION":
                    $obj_Village->ForestDescription = $child;
                    break;
                case "TRADITIONALKNOWLEDGE":
                    $obj_Village->TraditionalKnowledge = $child;
                    break;
            }
        }
        $obj_retResult_Village = DAL_manageVillage::updateVillage($obj_Village);
        if ($obj_retResult_Village->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillageXml($obj_retResult_Village->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}