public static bool addLDAPUser(string username, string pwssword, string name, string surname) { bool ret = false; try { OpenLdapService ws = new OpenLdapService(); ws.Url = OPMBOGlobalFunction.GetOPMSysconfig("OpenLDAPURL"); ws.Timeout = 1000; DLLFunction.DLLLogFile.AddInterfaceLog("DPIS", "OpenLdapWebService", "CTLT_EMP", "user_code", "addUser user_code=" + username + " OpenLDAPURL=" + ws.Url); ret = (ws.addUser(username, name, surname, "*****@*****.**", pwssword, "", "1234567890123", "", "", "") == "0000"); ws.Dispose(); } catch (Exception ex) { DLLFunction.DLLLogFile.CreateErrorLog("Exception :" + ex.Message + " " + ex.StackTrace); } return ret; }
public static bool deleteUser(string username) { bool ret = false; try { OpenLdapService ws = new OpenLdapService(); ws.Url = OPMBOGlobalFunction.GetOPMSysconfig("OpenLDAPURL"); ws.Timeout = 1000; DLLFunction.DLLLogFile.AddInterfaceLog("DPIS", "OpenLdapWebService", "CTLT_EMP", "user_code", "deleteUser user_code=" + username + " OpenLDAPURL=" + ws.Url); ret = (ws.deleteUser(username) == "0000"); ws.Dispose(); } catch (Exception ex) { ret = false; } return ret; }