Esempio n. 1
0
    public string UpdateEMember(string companyCode, string json)
    {
        clsDataAccessor dataAccessor = new clsDataAccessor();

        dataAccessor.connectionstring = dataAccessor.getConnectionString_Vapt(dataAccessor, companyCode);

        MemberInfor member     = new MemberInfor();
        var         serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

        string response = "";

        /*string jSon = @"{
         *  "MemberID":"12122222",
         *  "MemberName":"Testing181212",
         *  "Gender":"F",
         *  "DOB":"1988-12-12",
         *  "CreateDate":"2019-11-07",
         *  "NRIC":"890S",
         *  "Email":"*****@*****.**",
         *  "HPH":"91838364",
         *  "Address1":"blk 63",
         *  "Address2":"kallang bahru",
         *  "Address3":"",
         *  "PostalCode":"330063",
         *  "Country":"SGD",
         *  "VendorMemberID":"",
         *  }";
         *
         *  passing value :
         *  {"MemberID":"12122222","MemberName":"Testing181212","Gender":"F",
         *   "DOB":"2078-12-12","CreateDate":"2019-11-13","NRIC":"","Email":"","HPH":"","Address1":"","Address2":"","Address3":"",
         *   "PostalCode":"","Country":"","VendorMemberID":""}
         */
        try
        {
            member = serializer.Deserialize <MemberInfor>(json);
        }
        catch (Exception ex)
        {
            return(ex.ToString());
        }
        response = dataAccessor.updateMemberData(member);

        return(response);
    }