public string SaveSystemUser(SystemUser user)
    {
        string ret = "";

        if (bll.NamesExist(user) && user.Userid.Equals(0))
        {
            ret = "Account Names( " + user.Fname + " " + user.Oname + " " + user.Sname + " ) is already in the System";
        }
        else
        {
            string passwd = bll.PasswdString(8);
            if (user.Userid.Equals(0))
            {
                if (user.UserName.Equals(""))
                {
                    user.Uname = GetUserName(user).ToLower();
                }
                else
                {
                    user.Uname = user.UserName;
                }
                user.Passwd = bll.EncryptString(passwd);
            }
            else
            {
                if (user.Reset)
                {
                    user.Passwd = bll.EncryptString(passwd);
                    /// Reset Password
                    datafile.ResetPassword(user);
                }
            }
            user.User = HttpContext.Current.Session["UserName"].ToString();
            if (bll.UserNameExists(user.Uname) && user.Userid.Equals(0) && user.UserName.Equals(""))
            {
                ret = "System generated username " + user.Uname.ToString() + " already exists. Please Enter UserName & Save User again";
            }
            else if (bll.UserNameExists(user.Uname) && user.Userid.Equals(0))
            {
                ret = user.Uname + " UserName Provided already Exists";
            }
            else
            {
                datafile.SaveLoginDetails(user);
                if (user.Userid.Equals(0))
                {
                    string message = "Hello " + user.Fname + " " + user.Sname + ", \n";
                    message += "Interface Portal Credentials have been created and they are \n" + Environment.NewLine + Environment.NewLine;
                    message += " User Name : " + user.Uname + "\n" + Environment.NewLine + Environment.NewLine;
                    message += " Password : "******"INTERFACE PORTAL CREDENTIALS";
                    string name    = user.Fname + " " + user.Oname + " " + user.Sname;
                    string res     = mailer.GoogleMail(mailto, subject, message, name);
                    ret = "System Login created Successfully, Username [" + user.Uname + "]";
                }
                else
                {
                    if (user.Reset)
                    {
                        string message = "Hello " + user.Fname + " " + user.Sname + ",\n" + Environment.NewLine + Environment.NewLine;
                        message += "Your Interface Portal password has been reset \n" + Environment.NewLine + Environment.NewLine;
                        message += " User Name : " + user.Uname + Environment.NewLine + Environment.NewLine;
                        message += " Password : "******"INTERFACE PORTAL CREDENTIALS";
                        string name    = user.Fname + " " + user.Oname + " " + user.Sname;
                        string res     = mailer.GoogleMail(mailto, subject, message, name);
                    }
                    ret = "System Login Details updated Successfully";
                }
            }
        }
        return(ret);
    }