function addVillage_history($sessionkey, $appcode, $Village_historydata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Village_history = new Village_history(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "TBLID": $obj_Village_history->TblId = $child; break; case "VILLAGEID": $obj_Village_history->VillageId = $child; break; case "DESCRIPTIONTYPE": $obj_Village_history->DescriptionType = $child; break; case "DESCRIPTION": $obj_Village_history->Description = $child; break; } } $obj_retResult_Village_history = DAL_manageVillage_history::addVillage_history($obj_Village_history); if ($obj_retResult_Village_history->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getVillage_historyXml($obj_retResult_Village_history->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addVillage_history2($TblId, $VillageId, $DescriptionType, $Description) { $obj_retResult = new returnResult(); $obj_newVillage_history = new Village_history(); $obj_newuser->setVillage_history($TblId, $VillageId, $DescriptionType, $Description); // $isExist = BL_manageVillage_history::isExist($obj_newVillage_history->id); if (!$isExist) { $obj_retResult_Village_history = DAL_manageVillage_history::addVillage_history($obj_newVillage_history); if ($obj_retResult_Village_history->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Village_history->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Village_history already exist"; } return $obj_retResult; }