示例#1
0
function addSoiltype($sessionkey, $appcode, $Soiltypedata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Soiltype = new Soiltype();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "TBLID":
                    $obj_Soiltype->TblId = $child;
                    break;
                case "SOILTYPEID":
                    $obj_Soiltype->SoilTypeId = $child;
                    break;
                case "SOILTYPENAME":
                    $obj_Soiltype->SoilTypeName = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Soiltype->Description = $child;
                    break;
            }
        }
        $obj_retResult_Soiltype = DAL_manageSoiltype::addSoiltype($obj_Soiltype);
        if ($obj_retResult_Soiltype->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getSoiltypeXml($obj_retResult_Soiltype->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
示例#2
0
 public static function addSoiltype2($TblId, $SoilTypeId, $SoilTypeName, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newSoiltype = new Soiltype();
     $obj_newuser->setSoiltype($TblId, $SoilTypeId, $SoilTypeName, $Description);
     // $isExist = BL_manageSoiltype::isExist($obj_newSoiltype->id);
     if (!$isExist) {
         $obj_retResult_Soiltype = DAL_manageSoiltype::addSoiltype($obj_newSoiltype);
         if ($obj_retResult_Soiltype->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Soiltype->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Soiltype already exist";
     }
     return $obj_retResult;
 }